Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a mail server on Ubuntu with Postfix, Amavisd, and virtual users through MySQL. I'd like to have the email body piped through an external script upon receipt, but only for one particular email recipient. The way I started going about this was to create a new transport called "vtimer" in

vtimer    unix  -       n       n       -       -       pipe
  flags=Fq   user=vmail       argv=/opt/vacationtimer.php ${recipient}

Then I created a new entry in the transport file: vtimer

Lastly, I ran postmap on the transport file and restarted Postfix (the entry in already exists because I have other functional transports currently in place). The difference between this transport and others is that the others match hostnames, but this is the only one that matches on a specific address. When an email is received at this address, it does not redirect through this transport, but instead goes through the default one that is used when none are matched.

Is this the right way to go about this? If so, what am I missing? If not, what other option(s) should I be looking at?

share|improve this question

migrated from Jul 4 '13 at 11:33

This question came from our site for computer enthusiasts and power users.

up vote 0 down vote accepted

I suspect the problem you are having is the syntax of your command in the transport table. vtimer:

Note the ":" at the end of the line to advise the transport to use, and which was missing in your example.

The way I handled a similar requirement was to set the user up in /etc/aliases with a pipe to the script -

username: "| command to pipe email into"

I set up a virtual_alias_maps entry I then set a transport map in the file with the line local:

So that user was treated as a local system user.

I think this is easier and more flexible then creating entries in the file.

share|improve this answer
The colon wasn't the issue, I had tried that as well. However, your suggestion to run it through /etc/aliases and local: was spot on and that worked perfect, thank you! – Nick Coons Jul 3 '13 at 1:09

Your Answer


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.