TLS error on connection from (localhost.localdomain) []

I have NO idea how to fix this. I get these errors from exim when trying to send emails from discourse. It is connecting fine, but not about to send.

Exim errors:

2018-10-19 00:07:41 no host name found for IP address
2018-10-19 00:07:44 no host name found for IP address
2018-10-19 00:07:44 TLS error on connection from (localhost.localdomain) [] (cert/key setup: cert=/usr/local/vesta/ssl/certificate.crt key=/usr/local/vesta/ssl/certificate.key): Error while reading file.

When running discourse-doctor it returns:

For a robust test, get an address from
Sending mail to REDACTED  . .
Testing sending to using*******
SMTP server connection successful.
Sending to . .
Sending mail failed.

It looks like you’re missing a PTR record. Might want to run mail-tester and see what it turns up

1 Like

Nothing that I can see.

-0.1	DKIM_SIGNED	Message has a DKIM or DK signature, not necessarily valid
This negative score will become positive if the signature is validated. See immediately below.
0.1	DKIM_VALID	Message has at least one valid DKIM or DK signature
Great! Your signature is valid
0.1	DKIM_VALID_AU	Message has a valid DKIM or DK signature from author's domain
Great! Your signature is valid and it's coming from your domain name
-1.985	PYZOR_CHECK	Similar message reported on Pyzor (
Please test a real content, test Newsletters will always be flagged by Pyzor
Adjust your message or request whitelisting (
0.001	SPF_HELO_PASS	SPF: HELO matches SPF record
0.001	SPF_PASS	SPF: sender matches SPF record
Great! Your SPF is valid
0.01	T_RP_MATCHES_RCVD	Envelope sender domain matches handover relay domain

The only real “potential problem” is that it reports:

Reverse DNS lookup or reverse DNS resolution (rDNS) is the determination of a domain name that is associated with a given IP address.
Some companies such as AOL will reject any message sent from a server without rDNS, so you must ensure that you have one.
You cannot associate more than one domain name with a single IP address.

Your IP address  ****  is associated with the domain  **** .
Nevertheless your message appears to be sent from  **** .

You may want to publish a pointer (PTR type) DNS record with a value of  ****  or use  ****  as hostname in your mail software

Here are the tested values for this check:

* IP:
* rDNS:

Try this:

Can you elaborate on your setup?

Was it built using our documentation and configured to use one of the recommended mail providers?

I am using my own dedicated server with exim (and dovecot)

I followed the documentation on discourse/ at master · discourse/discourse · GitHub

and then set it up by modifying containers/app.yml

and launching

./launcher bootstrap app

I did not use recommended mail providers as I already have my own servers and it looks more professional when the mail comes from the same domain as the site is being hosted on.

@boredomdenied I have no idea where or what that file is :stuck_out_tongue:

You can use any of the named providers to relay email from your domain.

The big reason we recommend those services is because they are both experts in deliverability and work pretty much flawlessly. The assumption is that you take responsibility for your own mail server if you opt to run one.

It’s a script. I’m referring to your exim server. I’m assuming it’s on the same host as your docker/discourse.

This was required to run discourse on a server which also used exim as it’s mail service as of two years ago. No guarantees for 2018. Add the docker IP ( and use the docker subnet for the dc_relay_nets

The script was not an option for me. Exim is custom installed and working with dozens of different domain names and using the script would have put files in all sorts of wrong places and changed configurations in various ways that would have broken my server.

Instead what I did was:

#edit /etc/hosts      localhost.localdomain


#added to my dns
mail._domain...TXT "v=DKIM1; k=rsa; p={my rsa key}"
_domainkeyTXT "t=y; o=~;"
_dmarcTXT "v=DMARC1; p=none"
@TXT "v=spf1 a mx ip4: ~all"
imap A
pop A
smtp A


ls -s /etc/exim4/domains/localhost.localdomain /path/to/my/domain/exim_files


#edit containers/app.yml

After all the above steps were done it started working (and yes I did try TLS false from the start but it still failed with auth denied from

Happy to say, my mails are now being delivered from the script.