SMTP, RDNS (PTR) troubles

Hey community, I am again a little bit stucked by getting things 100% clean because of knowledge gap.

Here my situation:
I have hestiacp on my server up and running good but some mail receipients denying mails from me because of some issues in stmp and ptr.

Konfiguration:

Server Hostname: randlweb.de
PTR: randlweb.de

On adding new mail domains and addresses HestiaCP is confiuguring mail.* as domain for them.

Added a customer with the domain: klaus-parzinger.de
added mail service and HestiaCP set mail.klaus-parzinger.de as domain for IMAP and SMTP but mail.klaus-parzinger.de cant be the PTR in any case because as far as I know a PTR is unique to 1 and only 1 hostname and ip pair. So how can I set up all my customers?

Sure, I can configure mail.randlweb.de as hostname and PTR but this wont fix the problem for the other customers isnt it?

Searching in the net and asking chatgpt brought up the idea to use 1 general host like mailhost.randlweb.de for all other domains but how do I have to set this up and what do I have to do in my cloudflare (which I am using for all DNS stuff)?

Hi @kparzinger

Technically, your configuration is correct. That said, some mail servers expect a Fully Qualified Domain Name (FQDN), so whatever.randlweb.de could be a better solution. Just change your server’s name to whatever.randlweb.de, point whatever.randlweb.de to your public IP, and update the PTR record of the public IP to point to whatever.randlweb.de.

That’s all, you don’t need to modify any other domain or worry too much about the PTR record.

2 Likes

Ok thats nice to hear, so Telekom for example requires a FQDN to accept mails and therefore mails came back. Ok I will setup a FQDN and set up the PTR aswell.

Do I have to set the hostname as primary_hostname into exim4 config? I read about this to do it but in the file /etc/exim4/exim4.conf.template there is no primary_hostname setting and “exim -bV | grep -i primary” delivers no answer (also if I set the primary_hostname into the conf file)

By default, Exim will use your server’s hostname as primary_hostname.

To check it, you can just connect to your mail server:

telnet HereThePublicIP 25

And you will see how your server identifies itself:

$ telnet HereThePublicIP 25
Trying HereThePublicIP...
Connected to HereThePublicIP.
Escape character is '^]'.
220 HereWillAppearTheHostnameUsedByExim

primary_hostname is an internal variable used by other directives.

grep primary_hostname /etc/exim4/exim4.conf.template

Use -bP instead of -bV.

exim4 -bP | grep primary_hostname
2 Likes

I got this for the telnet test:

kpssh@hub:~$ sudo hostname
hub.randlweb.de
kpssh@hub:~$ sudo hostname -f
hub.randlweb.de
kpssh@hub:~$ sudo telnet 152.53.239.113 25
Trying 152.53.239.113...
Connected to 152.53.239.113.
Escape character is '^]'.
220 randlweb.de

But maybe I have to wait 24 hours for the PTR record?

Did you restart Exim?

systemctl restart exim4

All good — it really was just the time it took for the PTR record to propagate on the hoster’s side.
Telnet and dig are showing the correct results, mail-tester gives a 10/10, and MXToolbox looks good too.
I’ve restarted the reputation check with T-Online and will also test my reputation with Gmail and others, but things are looking pretty good so far.

Thinking back to when I set up my first servers (10–13 years ago), I eventually dropped the DIY approach because there were just too many manual steps.
Now, with HestiaCP, Cloudflare, and five or six additional steps, the whole process was surprisingly easy.
I just need to have a bit more patience while everything finishes syncing :grinning_face_with_smiling_eyes:

Great!

Just to clarify, Exim is not using or checking your PTR record to determine its hostname.

1 Like