Skip to content

post_message.js: Configuration property "web.port" is not defined #72

@rda0

Description

@rda0

Using post_message.js from a postfix mailserver via pipe produces the following error:

WARNING: No configurations found in configuration directory:/etc/postfix/config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
post_message Using stdin as email source
/opt/email-bot/node_modules/config/lib/config.js:182
    throw new Error('Configuration property "' + property + '" is not defined');
    ^

Error: Configuration property "web.port" is not defined
    at Config.get (/opt/email-bot/node_modules/config/lib/config.js:182:11)
    at postMessage (/opt/email-bot/post_message.js:40:43)
    at Socket.<anonymous> (/opt/email-bot/post_message.js:23:9)
    at Socket.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

I tried hardcoding process.env.NODE_ENV = 'production'; which did not help (no idea how to set the env variable via postfix).

Postfix is configured as in https://serverfault.com/a/258491/209089 and in /etc/postfix/master.cf:

matrixemailbot   unix  -       n       n       -       -       pipe
  flags=FR user=email-bot argv=/usr/bin/node /opt/email-bot/post_message.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions