Our company just switched to a new email domain and wants to keep the old domain around for a year as they notify everyone about the change. The old email domain was on Exchange 2007 and the new email domain is on Google Apps. Everyone is 100% on Google Apps, and the Exchange server just forwards on emails.
I would like to replace the Exchange server (it's underpowered and a waste of resources just forwarding emails) with something lightweight, based around Postfix or another email server. It needs to do the following:
- Forward emails sent to old_domain.com to new_domain.com
- Autoreply to the sender that everyone's email has changed to new_domain.com
Is this possible with Postfix, and does anyone have documentation on how to do it? I know just enough Linux to be dangerous, so I want to be sure before I suggest this.
I expect you want to fake a bounce message on the old domain. I use Exim and their is a control to do this.
You will also want a clear bounce message that indicates that the email was accepted for delivery, but future messages should be sent to the new address.
Exim also allows for custom bounce messages in the aliases file. This can be used to specify the new address.
Postfix or exchange may have similar functionality.
EDIT: Exim documentation is quite good. See the specification chapter 40 (Access Control Lists) and Chapter 11 (String Expansions) for details related to your issue.
You could try an entry in the recipient ACL something like this:
Redirecting to your new server can be done by individual aliases, a redirect router (see chapter 22 section 3), or a rewrite rule (see chapter 31 Address rewiting) such as:
I would do that with Postfix and Cyrus-Imapd. Postfix would just forward everything to cyrus-imapd, and then you can use a Sieve Filter to :
From the top of my head, I think you could do it like that:
The difficulty is that Sieve rules are defined for each user, so you need to create a set of rules for each of your user. But you can easily script it.
More information about Sieve in Cyrus-Imapd can be found here: http://wiki.linuxwall.info/doku.php/en:ressources:astuces:sieve
I am not sure if this is possible with Google Apps, but what I would do with a "normal" mail server is to let it handle the mails for the old domain as well, pointing the MX for the old domain to the new server and then configure the MTA accordingly.
You can use a procmail and a postfix.
Postfix can do this easily (we did something like this in postfix about 7 years ago, so I no longer have access to the very simple filter that we wrote).
I would recommend using an autoresponder (see http://www.postfix.org/addon.html for a few examples) to generate the the autoreply so that you can avoid all of the pitfalls in an autoreply generator.
Then, a simple filter (see http://www.postfix.org/SMTPD_PROXY_README.html for how one might implement a before-queue filter to change the destination) for the auto-forwarder.