I'm receiving error mails: couldn't reach your server; e-mail not sent. When I look at the Exim error logs, I see the host where I sent the mails from, followed by 'relay not permitted'. What can I do now?
5 Answers
You need to add the IP address of your host(s) to the list of the "permitted relayers".
Here is a simple article on how to configure that under Ubuntu, which has a split file type of configuration (as debian) and so differs from the official one.
Basically:
you set
dc_relay_nets
underupdate-exim4.conf.conf
to the IP address of the machine you want to relay from. Then you do the split config dance and runupdate-exim4.conf
and you should now be able to relay email from that IP (or range of IPs).
After several hours of working in circles I stumbled upon the answer that worked for me. It didn't matter how many permutations of dpkg-reconfigure exim4-config
I tried, adding in entries for dc_relay_nets or dc_relay_domains or direct edits of exim4-local-domains.txt. It turns out there is a file named exim4-relay-mail-from-this-list-of-ip-addresses.txt in /etc/exim4
that simply needs the ip address or CIDR block of the net you want to relay for (e.g. 1.2.3.0/24). Mine is set up with a single entry on each line, not a semicolon separated list like much else in exim4. A restart of exim4 was required in my case.
Now, with a name like that it would seem only a fool could miss something this obvious, but in all my internet searches this file name never once materialized and everything I read directs back to using dpkg-reconfigure
and working with dc_relay_nets. Hope this helps someone else avoid lost time.
Well, exim thinks that the domain of the receiving email is not local (so it should relay it) and correctly is denying to be a relaying host. You have to add your domain to local_domains like this: domainlist local_domains = @ : localhost : mydomain.com
-
1
I had the same problem. I found an answer to this question here:
https://alioth-lists.debian.net/pipermail/pkg-exim4-users/2009-April/001611.html
the solution is to edit the file update-exim4.conf.conf as follows:
dc_other_hostnames='localhost:hostname:example1.com:example2:com'
for "hostname" I entered the output of the command hostname, although I don't know if that is right. I also entered the relevant values for example1.com, and I was able to receive email when I sent it to [email protected].
I also had the same problem except it was because I had dc_other_hostnames='mail.example.com'
rather than dc_other_hostnames='example.com'
in /etc/exim4/update-exim4.conf.conf
-
please be more precise and add more context as currently i tend to vote to delete this comment– djdomiNov 9, 2021 at 18:34