I’m running Postfix version 2.10.2 using dovecot, mysql, and postfixadmin.
The single server receives email for main.com, client.com and client.main.com. main.com has only one mailbox, [email protected]. All mail for client.main.com is aliased to [email protected] and then parsed by a ruby script to determine the mailbox and the subdomain (client in my example above, but there could be many different “clients”). Usually the the mailbox is a number that refers to a customer number. So, we receive email for [email protected], it is delivered to [email protected] and my script identifies customer 1234 for business client, processing the email accordingly. Client.com has several employees, and the server receives the email for all the employees at client with normal [email protected] addresses. This all works great I want to set up an alias for [email protected] which will forward the mail to [email protected]. Any mail received will be forwarded to [email protected]. Again, all works fine. The problem is that when my script pulls the email from [email protected]’s mailbox, the alias [email protected] is not preserved in the header, and I lose the ability to process the email by my script. Is there some way to preserve the full history of aliasing that the email passes through?
