Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using a custom transport to process incoming mail. It is used for subscribing and unsubscribing to a certain channel.

twailer   unix  -       n       n       -       -       pipe
  flags=FR user=twailer argv=/home/twailer/twailer/bin/twailer

The twailer binary is a Javascript file and should be parsed with node, so I added the shebang

#!/usr/bin/env node

But that does not work, because $PATH is not exported by the pipe command. According to the manual, I can specify which environment variables to pass in a setting export_environment in main.cf, so I did that too.

export_environment = TZ MAIL_CONFIG LANG PATH=/usr/local/bin:/usr/bin:/bin

But it still does not work. So I replaced my binary with a shell script that outputs the current $PATH to stderr and I get

Command output: /usr/bin:/bin

which is clearly not what I configured.

Any ideas on how I can get my $PATH variable passed?

share|improve this question

1 Answer 1

Instead of trying to make pipe(8) do something it doesn't, consider adapting to what it does support:

twailer   unix  -       n       n       -       -       pipe
  flags=FR user=twailer argv="/usr/bin/node /home/twailer/twailer/bin/twailer"

Replace "/usr/bin/node" with the real path to your binary.

As to your problems with hacking in a PATH: as documented,

argv=command... (required) The command to be executed. This must be specified as the last command attribute. The command is exe- cuted directly, i.e. without interpretation of shell meta characters by a shell command inter- preter.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.