views:

162

answers:

2

I have setup a catchall router on exim (used as last router):

catchall:
  driver = redirect
  domains = +local_domains
  data = ${lookup{*@$domain}lsearch{/etc/aliases}}
  retry_use_local_part

This works perfectly when sending emails locally. However, if I login to my GMail account and send an email to [email protected], then I get an "Unrouteable Address".

Thank you for any hints to solve this issue.

A: 

For this router to work, make sure that

  1. mydomain.com is in local_domains
  2. there is an entry for *@mydomain.com in /etc/aliases
  3. MX record for mydomain.com is pointing to the server, where you've configured this
unbeli
Mh - seems that everything is ok. What I did to make sure to match your guidelines:1. setup of a catchall_domains list (making sure my domain is in the list) domainlist catchall_domains = +local_domains : mydomain.com2. Entry is there. Locally I can send/receive these emails3. MX pointing to my server, normal emails (non catch-all) work.Thanks for further hints.
Markus
A: 

In the system_aliases: section of the config file you already have a section which does the lookup in /etc/aliases.

Replace
    data = ${lookup{$local_part}lsearch{/etc/aliases}}
with
    data = ${lookup{$local_part}lsearch*@{/etc/aliases}}
and make sure you have "*:catchall_username*" in /etc/aliases

This works great for a single domain mail server which is already using /etc/aliases.

Andy Ruddock
Thanks for the tip - unfortunately I don't have a single-domain mailserver. So I would need to have a catchall for each domain individually.
Markus