I have configured two instances of exim4 on two different Ubuntu servers. They both accept e-mail for the same three domains. The primary one acts as the final destination whereas the secondary only relays e-mails to the primary one.

There is a problem however with unroutable addresses. Every once in a while the secondary server will receive an e-mail for a non-existent address but within the proper domain. It accepts this message and then tries to relay it to the primary server. The primary server however rejects it with "550 Unrouteable address" thus getting the secondary stuck with all those messages frozen in the queue.

What is the proper solution to this problem? Should the secondary server drop messages rejected by the primary server? If so, how do I configure it to do that?

And how do I do it without losing the redundancy. Let's say the primary server comes up with a broken config and rejects all messages. I wouldn't want to lose them. I would actually appreciate if the secondary server held on to them until primary is restored to its proper config.

Surely, the problem is not new and canonical solutions exist...?

  • What do you mean by primary server coming up with a broken config and rejecting all messages? – clement Aug 10 '13 at 2:20

I have seen thee mechanisms in use:

  • Drop messages which are sent to non-existent addresses via the secondary server. This prevents use of the secondary server to generate back-scatter spam.

  • Arrange to have the user database available on the secondary server. If you are using LDAP for your user database, this is relatively easy. Users in /etc/passwd are more difficult, but can be done by replicating file to a location Exim can use.

  • Doing a call-out to the target server to validate the address. This would break if the main server fails, but I believe there is caching.

I don't believe your secondary server will get any legitimate mail if the primary server is up and rejecting mail. If any server rejects a message, the mail should be bounced. Servers (excluding spambots) won't then try the secondary server to see if it will deliver the mail.

Most email servers handle server outages properly and will queue the mail for later delivery. Many will try for days. Those that don't are generally spambots, or poorly implemented automated mail delivery systems.

|improve this answer|||||
  • Dropping messages for NE-addresses is not so good idea. Humans sometimes do the typos, and they never realize that their message has not reached addressee. Sending bounces is a must, but back-scattering can be avoided via senders ACLing. – Kondybas Aug 23 '13 at 0:37
  • @Kondybas I don't recommend dropping addresses to NE-addresses. However, if you accept the message and cannot positively verify the address you got it from you risk generating backscatter spam. Given that this is for a secondary server a rare first contact may be dropped. – BillThor Aug 24 '13 at 1:32
  • aptivate.org/en/blog/2009/01/28/backup-mail-exchangers looks like a good way of doing the 3rd option – Flexo Dec 24 '18 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.