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

I am using virtual domains, and I'd like to setup the server to alias to custom scripts. I manage all accounts using postfix mappings to mysql.

It seems that postfix automatically appends a virtual domain regardless of how the forwarded/aliased result comes back. So even though i have:


postfix is reading it as:


Is there any work-around, or setting I can fix?

It would seem than append_at_myorigin=no would be ideal, but that's unsupported according to the documentation.

Another option, maybe I can skip virtual aliases altogether and use the "/etc/postfix/aliases" table - assuming all emails go to the main domain. I'll try this, but if anyone has any other ideas how to make it work with virtual domains, please let me know as this would be very useful!


share|improve this question

The way i do it is to alias

in postfix/virtual create an alias to a "local alias" in /etc/aliases

postfix/virtual        domain_alias@localhost

then in /etc/aliases you can pipe the alias to a script

domain_alias:                 "|/bin/command"

This works well for me.

share|improve this answer
Just as a side node: This is the only way to do it. Virtual aliases cannot use shell commands directly. In a virtual context Postfix doesn't have a notion of system users. – Signum Nov 16 '09 at 20:11

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.