Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Possible Duplicate:
How to configure postfix to pipe all incoming email to a script?

I'm having problems setting up simple piping for Redmine (or '|cat > /tmp/temp')

/etc/postfix/virtual: support


support: "|/opt/redmine-1.2.2/"

virtual_alias_maps = hash:/etc/postfix/virtual, mysql:/etc/postfix/
virtual_mailbox_domains =, mysql:/etc/postfix/
virtual_mailbox_maps = hash:/etc/postfix/virtual_alias, mysql:/etc/postfix/

alias_maps = hash:/etc/postfix/aliases
alias_database = $alias_maps

/opt/redmine-1.2.2/extra/mail_handler/rdm-mailhandler.rb --url --key f5obfctmGfqZWnOWNtR8 --project test --tracker support --allow-override tracker,project --verbose --unknown-user accept --no-permission-check

I've run newaliases; postmap virtual; postalias aliases; postalias virtual_alias; newalias - Yeah, probably overdoes it, but still misses the pouint :(

I've run newaliases and restarted postfix. Mail is delivered as usual, but nothing is added to /tmp

This is the only log entry saying anything about virtual.

Dec 10 04:08:41 master postfix/virtual[3112]:
A3F46AD1BF: to=<>, relay=virtual, delay=0.4,
delays=0.38/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)

If I run cat someemail | in the shell, everything works. Processemail isn't even run by postfix.

Anyone knows what might be wrong? Or how I can turn on more logging?

share|improve this question

marked as duplicate by mailq, Ward, Chris S, Scott Pack, MDMarra Dec 11 '11 at 15:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Yes, an exact duplicate. I just found a solution and was posting it the same second the question was closed :) Would have saved a couple of hours if I found that answer first. – simendsjo Dec 11 '11 at 15:11

Pipe Alias are implemented by local(8) postfix agent.


This means you are using the virtual(8) agent delivery to but you need local(8) to fetch that email. Maybe you using virtual as your local_transport or you need to put in your 'virtual_alias_maps' file something like: support@localhost

This postfix-users thread and the postfix documentation may help.

share|improve this answer

You could use a simple alias in /etc/aliases (or wherever it is located):

support: |/usr/local/bin/yourscripthandler

Don't forget to run newaliases afterwards.

Note that redirection (>/tmp/blah) is something handled by the shell, and AFAIK postfix won't invoke a shell to run your command; so yourscripthandler should be something like:

/usr/local/bin/theactualscripthandler >/tmp/dummy
share|improve this answer
Isn't that exactly what I'm doing above? – simendsjo Dec 10 '11 at 11:01
You're absolutely right. Sorry, I'll expand my answer. – ΤΖΩΤΖΙΟΥ Dec 10 '11 at 11:02

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