-1

I run an Exim mail server with multiple virtual domains (a setup similar to this). The server is the smarthost for some other servers.

Suppose I have a virtual domain example.com which has a redirect: foo@example.com => bar@example.org.

When a server wants to use this Exim server to send mail to foo@example.com, I expect that the mail server sends the mail bar@example.org.

All fine so far, but what if the example.com MX record did not point to this Exim server? Then delivering the mail to bar@example.org would be incorrect.

Is there a way make Exim check MX record validity when using those virtual domain rules? If not, what should I do? The virtual domain list is quite long. Writing a cron script to invalidate (and re-validate) any invalid domains would feel wrong, or at least a bit hacky.

tuomassalo
  • 738
  • 2
  • 8
  • 22

1 Answers1

1

Your expectation:

When a server wants to use this Exim server to send mail to foo@example.com, I expect that the mail server sends the mail to bar@example.org.

is wrong. Alias expansion is not done by intermediate servers and mail relays, they should simply forward the mail unmodified to its destination. Alias expansion should only happen for local delivery at the final destination.

If your Exim configuration treats example.net as a local (virtual or not) domain and the MX records for example.net do not point to your Exim server; simply put either the server or the MX records are misconfigured. Exim will simply follow it's configuration and accept mail for example.net for local delivery. Other senders will simply follow the MX priority and either fail to deliver the mail (in case of incorrect MX records) or that is the only mail that will reach the correct destination (when the MX records are correct and Exim will keep mail in local mailboxes that nobody reads).

Maintaining the correct configuration is one of the actual jobs you have as system administrator...

HBruijn
  • 72,524
  • 21
  • 127
  • 192
  • I might have written unclearly, but I'm not understanding why you claim that my expectation is wrong. If someone connects to this Exim server and tries to send email to `foo@example.com`, the mail _is_ delivered to bar@example.org (regardless of MX records). I'm not talking about local alias expansion on a server that has actual mailboxes, but a redirect-only service (see the link in the post). However, the actual MX question still applies, and it seems I do have to find a way to periodically clean the virtual address list. – tuomassalo Aug 29 '14 at 05:49