[SOLVED] DNS domain in main.cf

BitMaster

New Member
Oct 27, 2019
1
4
1
I'm running 2 servers with Proxmox Mail Gateway in cluster mode :). One is the master, the other the slave.

I was debugging an issue with the smtpd_banner setting in /etc/postfix/main.cf and in the end I could solve it. I'd like to talk you through the process.

First I discovered the variable 'myhostname' was used on line 11, before it was declared on line 23. After I moved (in the template file) both mydomain and myhostname above line 11, the issue was fixed on the master.

I did the same for the slave. However, for some reason the mydomain and myhostname are not being filled in correctly:
mydomain = localdomain
myhostname = mailgw2.localdomain

The following settings are in place:
  • My /etc/hostname is containing the FQDN: mailgw2.mydomain.xx
  • /etc/hosts contains an entry with the hostname and FQDN: 80.79.78.77 mailgw2.mydomain.xx mailgw2
  • /etc/mailname contains the FQDN: mailgw2.mydomain.xx
  • hostname -f returns the FQDN: mailgw2.mydomain.xx
After some time i found out that apparently I was missing the search mydomain.xx entry in /etc/resolv.conf.

I am not in control of the DHCP server and it is not providing the search domain option. If I add the search option manually and run pmgconfig sync the postfix configuration is working! Now to find the best way to make it persistent.

I hope I could save someone else the trouble.
 
Thanks for sharing your experience - this question does pop up every now and then - you probably already helped someone (or will do so in the future)!