Still problems that break Postfix when changing network settings

Hi,

We still run into problems when changing/saving settings in network config! This morning one employee added a DNS server and saved the changes, and this also made changes to Postfix... it removed the FQDN and added just the hostname breaking the mail traffic. I did realize this when I got back in the office in the afternoon! In other word - Our mail was down all day!

When this happens the mail routs back to it self! dsn=5.4.6, status=bounced (mail for HOST.DOMAIN.TLD loops back to myself) And I have addressed this bug/behavior many month ago, with other network issues.

Operating system CentOS 7.7.1908, Webmin version 1.941, Usermin version 1.791, Virtualmin version 6.08 Pro, Authentic theme version 19.45

Best regards, Leffe

Status: 
Active

Comments

Title: Still problems that break Postfix on when changing network settings » Still problems that break Postfix when changing network settings
Ilia's picture
Submitted by Ilia on Sat, 02/15/2020 - 07:44

Assigned: Unassigned »

Hi,

Thanks for your feedback. I will pass this to Jamie for an overview.

If you go to Webmin -> Webmin Actions Log and find the action for changing the network settings, what modification does it show was made to the Postfix config file main.cf ?

Hi,

Here is the action log.

Changed file /etc/sysconfig/network-scripts/ifcfg-em1

2d1
< BROWSER_ONLY=no
4,5c3,4
< DNS3=8.8.8.8
< DNS2=1.1.1.1
---
> BROWSER_ONLY=no
> DNS2=8.8.8.8
7c6
< DNS1=127.0.0.1
---
> DNS1=1.1.1.1
19d17
< IPADDR=111.222.333.444
20a19
> IPADDR=111.222.333.444
22d20
< DOMAIN=DOMAIN.TLD
23a22
> DOMAIN=DOMAIN.TLD

Changed file /etc/resolv.conf

1,3d0
< # Generated by NetworkManager
< search domain.tld
< nameserver 127.0.0.1
5a3,4
> domain DOMAIN.TLD
> # Generated by NetworkManager

Executed command

hostname servertwo

Changed file /etc/sysconfig/network

0a1
> HOSTNAME=servertwo

Executed command

hostnamectl set-hostname servertwo

Changed file /etc/postfix/main.cf

161c161
< mydestination = $myhostname, localhost.$mydomain, localhost, servertwo.DOMAIN.TLD
---
> mydestination = $myhostname, localhost.$mydomain, localhost, servertwo
698c698
< myhostname = servertwo.DOMAIN.TLD
---
> myhostname = servertwo

Executed command

/usr/sbin/postfix -c /etc/postfix reload

This change the Postfix General settings What domains to receive mail for and Internet hostname of this mail system so that mail delivery breaks.

I guess FQDN and hostname is used in many other places and I don't know if other things get affected by this as well. And as I have said before, this behavior started AFTER I did my first change in network settings on a fresh install. At first there were no problem, I could do a restarts without any changes, but after the first change in network settings many things started to change and break after a server restart. Se my previous issue 66983.

Best regards, Leffe

I would guess that the problem is the changes to the myhostname and mydestination lines.

When you changed the hostname, did you remove the FQDN and just switch it back to a bare hostname?

Hi Jamie,

Do you mean about the changes shown in the log? If so, No, I did not touch that, the only thing I did was changing DNS Servers.

But in Network "Configuration" and "Hostname and DNS Client" the "Hostname" just holds the hostname part. All these settings did get changed after the first time I hit "Save" and "Apply Configuration" there. The "Hostname" field at first after the install held the full FQDN, but after save/apply that it changed to just the hostname, and I did change that to FQDN again but it changed back to just the hostname part again. The field requires the hostname and to be fair, that would be just the hostname part not the FQDN so I have left it at that!