The main idea is to have a set of anything@ads.mydomain.com
addresses, all redirecting to a single mailbox. Then I can use any address @ads.mydomain.com
as an alias to my primary mailbox.
This way, I give ebay@ads.mydomain.com
to Ebay, amazon@ads.mydomain.com
to Amazon and so on.
This solutions allows me to disable an alias if unsubscribing on the site doesn’t work. I can also use this to track sites selling my address to other sites.
First, Exim has to listen on the network, and accept mail to the ads.mydomain.com
domain. Under Debian, put this in /etc/exim4/update-exim4.conf.conf
:
dc_local_interfaces='0.0.0.0'
dc_relay_domains='ads.mydomain.com'
Note under Debian: each time Exim starts the /etc/exim4/exim4.conf.template
file is filled with variables set in /etc/exim4/update-exim4.conf.conf
, générating the /var/lib/exim4/config.autogenerated
file. This is to ease Exim configuration in standard cases.
Then edit the /etc/exim4/exim4.conf.template
file to add a new router, in first position just bellow begin routers
:
catchall_pub:
driver = redirect
domains = ads.mydomain.com
data = user@mydomain.com
The router will be called for any mail @ads.mydomain.com. It give all mails to the redirect transport sending them to the address set in data.
Finally, you can then use a /home/user/.forward
file to disable aliases with a Sieve or Exim filter.
UPDATE 2010-11-10: another way of disabling aliases
References: