Maintaining Exim

Sometimes you need to troubleshoot some problems or you need to do regular maintenance work at your Exim mailserver. You might want to hold delivery of incoming mail and just keep it on the queue during the maintenance period. There are two ways to do this.

Queue mail for some domains

If you need to troubleshoot a problem with just one domain or a limited number of domains (e.g. all local domains), use hold_domains. We use this, if we test new configurations of mailinglist domains.

In your Exim configuration file set hold_domains to a list of all domains that should be affected by the maintenance and restart Exim. Mails for those domains will be held on the queue until the retry time is expired. If you want to keep mail for a longer time, you need to add a dummy retry rule for this special case.

Queue mail for all domains

If you want to do a larger maintenance that affects all mail handled by your server, you could just use hold_domains = *. A better way to do this is to set queue_only = true and restart Exim without the -q15m (or whatever time you use), so no queue runners are started. It is more efficient, because Exim won’t even start to deliver messages. With hold_domains, Exim starts the delivery, and checks every recipient to see if it is held or not. While you probably won’t be able to tell the difference on most installations, hold_domains might use more resources, if your server handles a lot of mail.

Resuming regular service

To resume regular service remove the configuration options and restart Exim. If you used hold_domains, you need to force delivery with the -M, -qf, -Rf or -Sf options additionally.

Documentation

Shameless plug: If this post was useful to you, please consider buying yourself something from one of my Amazon stores: US store, UK store, FR store, DE store, CA store. If you're not into Amazon, why not donate something to GNOME, Mozilla or Wikipedia? Thank you!

Leave a Reply