Exim and sendmail compatibility

I’ve maintained a rather large mail cluster using the Exim mta .
Configuring an MTA is something that is a lot more complicated than one would expect, until you try it. I know Exim now, and aren’t really motivated at learning sendmail or postfix, so I tend to switch to exim as the default mta for any server I administer .

I just did some debugging where a Mojolicious application didn’t send out email, and it turned out the exim ‘sendmail’ compatibility wasn’t 100% compatible with sendmail’s sendmail …
( Long story short: first there was sendmail in every Unix. Then came postfix and exim, but because a lot of Unix utilities already was programmed to using sendmail ‘they’ [postfix and exim] made a sendmail binary/wrapper that accept the same options as sendmail )

Anyway after some debugging I noticed that it seemed like the perl Mail lib was default’ing to adding -t to sendmail . And I had a look in the exim documentation and noticed that they _do_ support -t, but as they wrote:

If the command has any arguments, they specify addresses to which the message is not to be delivered. That is, the argument addresses are removed from the recipients list obtained from the headers. This is compatible with Smail 3 and in accordance with the documented behaviour of several versions of Sendmail, as described in man pages on a number of operating systems (e.g. Solaris 8, IRIX 6.5, HP-UX 11). However, some versions of Sendmail add argument addresses to those obtained from the headers, and the O’Reilly Sendmail book documents it that way. Exim can be made to add argument addresses instead of subtracting them by setting the option extract_addresses_remove_arguments false.

soooo I tried adding

extract_addresses_remove_arguments = true

to exim.conf, and it seem to have solved the problem.

Exim and invalid ‘EHLO’ chars

We had some mac users complaining that they couldn’t send mail via our exim smtp server. Exim logged stuff like ‘

rejected EHLO from []: syntactically invalid argument(s): test\.no

To work around telling the end user to use an other email client, or tell Apple to fix their mail client I ended up using the directive

helo_allow_chars = '\'

in exim.conf instead.

Queue only in Exim

In the process of upgrading our server where mail for customers where being stored I had to take down the system. One thing is to give thousand of users downtime, they can (must) live with it, as long as you for instance do it during nights or so. An other thing is incoming mail, the system should be able to receive mail 24/7 at least as long as one have more than 1 incoming MX .

Normally Exim is run by the switch -bd -q5m, depending on the configuration in exim.conf Exim usually tries to deliver mail instantly and (ref. -q5m) a queue runner goes through the queue every 5 minutes and may or may not retry delivery of mail hanging in the queue (it may not retry mail where ‘retry time’ has not been reach) .

In exim.conf you may add the directive:


meaning that for each incoming mail exim will queue the mail and not try to deliver it at once. Mail is then picked up by the queue runner process and delivered later.
By using this directive and by stopping exim and starting it manually with out the queue runner process:

exim -bd

I was able to queue all incoming mail at our MX and could do what I needed to do with the server where mail is delivered (that is for local deliveries) which in my case was about 3 hours of downtime.
When done I removed the queue_only directive and restarted exim with the queue runner again and everything was well 🙂