Score:0

Exim sends outgoing mail to all or none, not some

au flag

I have a PHP application sending emails via SMTP through a local Exim (v4.96) server. I am connecting on port 587 with authentication, and in the vast majority of cases everything works great. The problem arises when I try to send to multiple addresses, and one of them does not have a valid DNS. On other servers I've worked with, in such a case, it will go ahead and deliver to all the valid addresses, and issue bounces for the bad ones.

On this one particular server (set up by someone else), it's failing to send anything in such a case, regardless of what order the addresses are in; exim_mainlog says The mail server could not deliver mail to [email protected]. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries., and closes the connection, no mention of the good address at all.

Is there some setting somewhere that could cause this? I can't see anything like that in the documentation, but I'm no expert in Exim config, so maybe I'm just using the wrong search term.

Score:0
us flag

It is possible that the server has the "reject_unknown_recipient_domain" option set in its Exim configuration file. This option causes Exim to reject all incoming mail that is addressed to a recipient domain that does not have a valid DNS entry. You can check if this option is set in the Exim configuration file (/etc/exim4/exim4.conf.template or /etc/exim/exim.conf) by searching for the line "reject_unknown_recipient_domain". If you find this option set to true, you can change it to false to allow delivery to addresses with invalid DNS.

Additionally, you can also try to add a route in the Exim configuration file that specifies how to handle unknown recipient domains. For example, you can add the following line in the configuration file:

route_list = * @ : [email protected]

This route specifies that any incoming email addressed to an unknown recipient domain should be sent to [email protected]. This way, the valid recipients will still receive their emails, and the email for the invalid recipient will bounce back to the sender.

Greg Schmidt avatar
au flag
I can't find anything about `reject_unknown_recipient_domain` in any Exim config file here. Googling, it seems it's a Postfix option? Is it the same for Exim, or a different name?
Greg Schmidt avatar
au flag
Also, this is not about *incoming* mail, but *outgoing*. My application is trying to send email for example to two people "[email protected]" and "[email protected]". When it does so, Bob's bad DNS lookup is preventing the email from going to Alice.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.