Q0744

Nigel Metheringham edited this page Nov 29, 2012 · 2 revisions
Clone this wiki locally

Q0744

Question

I've got a queue full of "bounce" messages. How do I get rid of them?

Why it happens

The usual reason for ending up with a queue full of bounces is that you're accepting incoming mail for non-existent users: for example, you accept incoming mail purely on the basis of the domain name, without checking the local part. Once Exim has accepted the message, it then tries to deliver the message, and only then does it find that the message is undeliverable. The message therefore bounces. If the bounce message cannot immediately be delivered, it will stay in the queue.

Example

An example of the problem: suppose the only router which handles your local domains is something like

maildir:
  domains = +local_domains
  check_local_user
  transport = user_maildir

and your acl_smtp_rcpt includes

accept domains = +local_domains

without also including "verify = recipient".

Incoming mail for +local_domains would then always be accepted (because your acl_smtp_rcpt says so). But if, say, the address was nxjgkhmu@example.com (where example.com is one of your +local_domains), and if "nxjgkhmu" isn't a real user on your system - i.e. doesn't pass check_local_user - then mail for that address would be undeliverable.

Solution

Firstly, ensure that your routers reject unrouteable addresses. Use exim -bv to test that "good" addresses, including external ones, are routeable, and that "bad" addresses are unrouteable.

Then, ensure your acl_smtp_rcpt includes "verify = recipient". See What should I put in my acl_smtp_rcpt? for details and examples.

Other Solutions

To actually get rid of bounce messages already in the queue, try one of these methods:

  • exipick -f '^$' -i | xargs exim -Mrm
    • or, equivalently: exipick '$sender_address eq ""' -i | xargs exim -Mrm