2010-11-09 23:51

In a previous post, I explained how to setup a catchall with Exim. This to create multiple addresses all redirecting to the same destination:

catchall_pub:
  driver = redirect
  domains = ads.mydomain.com
  data = user@mydomain.com

Then, I wrote that on destination address we could setup a Sieve or Exim filter with a .forward file.

If you want to do that directly in Exim, to have all config in one place, or simply if your destination mail box doesn’t supports filters…

Just add a local_parts option:

catchall_pub:
  driver = redirect
  domains = ads.mydomain.com
  local_parts = !/etc/exim4/ads.mydomain.com.blacklist
  data = user@mydomain.com

In /etc/exim4/ads.mydomain.com.blacklist we put all rejected addresses, one per line:

foo1
bar2

This way foo1@ads.mydomain.com and bar2@ads.mydomain.com will be rejected.

Exim4 Doc:

2010-11-09 23:51 · Tags: , , ,
2010-05-24 23:52

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:

2010-05-24 23:52 · Tags: , , ,
2009-10-19 14:01

To add mail subjects in Exim4 log (/var/log/exim4/mainlog), just change the /etc/exim4/exim4.conf.template file as following to add +subject to log_selector:

.ifdef MAIN_LOG_SELECTOR
log_selector = MAIN_LOG_SELECTOR +subject
.endif

Then restart Exim:

/etc/init.d/exim4 restart
2009-10-19 14:01 · Tags: ,