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:

"|/bin/command"

postfix is reading it as:

"|/bin/command"@mydomain.com

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!

Thanks.

link|improve this question

75% accept rate
feedback

1 Answer

The way i do it is to alias

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

postfix/virtual
domain@domain.co.uk        domain_alias@localhost

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

/etc/aliases
domain_alias:                 "|/bin/command"

This works well for me.

link|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
feedback

Your Answer

 
or
required, but never shown

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