New Install and Postfix Fails

SYSTEM INFORMATION
OS type and version Rocky Linux 9.4
Webmin version 2.202
Virtualmin version 7.20.2
Webserver version Apache 2.4.57
Related packages SUGGESTED

Brand new install is having problems with Postfix. Added the host name to the “mydestination” option. Then restarted Postfix which now fails with the following:

Job for postfix.service failed because the control process exited with error code.
See “systemctl status postfix.service” and “journalctl -xeu postfix.service” for details.

If I run the systemctl command I get the following:

[root@server1 postfix]# systemctl status postfix.service
× postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Sun 2024-09-01 12:25:32 CDT; 23s ago
Duration: 1d 16h 44min 23.907s
Process: 670336 ExecStartPre=/usr/sbin/restorecon -R /var/spool/postfix/pid (code=exited, status=0/SUCCESS)
Process: 670337 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=75)
Process: 670341 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 670343 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)
CPU: 56ms

Sep 01 12:25:30 server1.MYDOMAIN.com systemd[1]: Starting Postfix Mail Transport Agent…
Sep 01 12:25:30 server1.MYDOMAIN.com aliasesdb[670338]: /usr/sbin/postconf: fatal: bad mynetworks_style value: ; specify exactly one value
Sep 01 12:25:31 server1.MYDOMAIN.com aliasesdb[670340]: newaliases: fatal: bad string length 0 < 1: mynetworks_style =
Sep 01 12:25:31 server1.MYDOMAIN.com postfix/sendmail[670340]: fatal: bad string length 0 < 1: mynetworks_style =
Sep 01 12:25:31 server1.MYDOMAIN.com postfix[670343]: fatal: bad string length 0 < 1: mynetworks_style =
Sep 01 12:25:32 server1.MYDOMAIN.com systemd[1]: postfix.service: Control process exited, code=exited, status=1/FAILURE
Sep 01 12:25:32 server1.MYDOMAIN.com systemd[1]: postfix.service: Failed with result ‘exit-code’.
Sep 01 12:25:32 server1.MYDOMAIN.com systemd[1]: Failed to start Postfix Mail Transport Agent.

I can no longer access the Postfix Mail Server in Webmin to make any changes. If I look at the file: /etc/postfix/main.cf for the “mynetworks_style=” option, they are all commented out. Not sure why it is erroring then. So, now what? How do I undo this problem?

I don’t know just suggesting. What If you “uncomment” it ?

According to what I understood it seems that Postfix is awaiting something precise from “mynetworks_style”

mynetworks_style is here:

Webmin ---> Servers --> Postfix Mail Server --> General Options --> Automatic local networks

On my Ubuntu server, in the Webmin GUI I have this options set to Default and in main.cf I do not have this option defined.

image

If I run the command postconf | grep mynetworks_style I get the following results which is normal and shows that the postfix default is being used (and this is because it is not defined in main.cf or commented out)

mynetworks_style = ${{$compatibility_level} <level {2} ? {subnet} : {host}}

My Destination

I am not sure why you have altered this, my demo site looks like this:

mydestination = $myhostname, myserver.example.com, localhost.example.com, localhost