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

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.

share|improve this question

1 Answer 1

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.

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

 
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.