I setup postfix to run with virtual mailbox setup:

virtual_mailbox_domains = domaina.com domainb.com domainc.com
virtual_mailbox_base = /var/mail/virtualhosts
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox
virtual_minimum_uid = 500
virtual_uid_maps = static:500
virtual_gid_maps = static:12
virtual_alias_maps = hash:/etc/postfix/virtual


postmaster@domaina.com postmaster
postmaster@domainb.com postmaster
postmaster@domainc.com postmaster


first.account@domaina.com domaina.com/first.account
second.account@domainb.com domainb.com/second.account
@domainb.com domainb.com/catch-all
@domaina.com domaina.com/catch-all
@domainc.com domainc.com/catch-all

My question is; where should I set aliases for existing user accounts, forwarding to another email address or piping to a local file? For example; I want to set these three:

pipe@domaina.com /var/my_app/pipe_a.php
pipe@domainb.com /var/my_app/pipe_b.php
email@domainc.com domainc@gmail.com
email@domaina.com domaina@gmail.com

Should I set these in /etc/postfix/virtual or in /etc/postfix/virtual_mailbox file? I couldn't make them working.

Your help is appreciated. Thanks.

| improve this question | | | | |

I found that pipes and aliases should be set in the /etc/postfix/virtual file.
Virtual mailbox users can be set under the /etc/postfix/virtual_mailbox file.

| improve this answer | | | | |

Postfix pipes are configured in main.cf as described in the manual.

Then you set transport_maps to map (some) recipients to transports you defined (for pipeing).

Whereas delivering to virtual users remains configured as usual.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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