Postfix warning: duplicate master.cf entry for service "smtps"

🛈 SYSTEM INFORMATION
Operating system Ubuntu Linux 20.04.3
Webmin version 1.984 Usermin version 1.834

On Jan 26, I upgraded to Ubuntu 20.04 (postfix v3.4.13), from 18.04 (postfix v3.3.0).
I noticed this warning in my syslog. I went back to my logs on the 25th and I had no warnings at all.

Feb 1 06:30:39 ns1 postfix/master[139758]: warning: duplicate master.cf entry for service “smtps” (465) – using the last entry

My /etc/postfix/master.cf has the following 2 smtps related entries:
A]

smtps inet n - y - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_client_restrictions=$mua_client_restrictions -o smtpd_helo_restrictions=$mua_helo_restrictions -o smtpd_sender_restrictions=$mua_sender_restrictions -o smtpd_recipient_restrictions= -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING

B]

smtps inet n - y - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_tls_wrappermode=yes

I have not made any config changes manually. Everything was done by Virtualmin in 2019. Also during the upgrade last week, I opted to leave all config files unchanged whenever I was given the option to replace with an updated file. I do not remember specifically if I was asked to do so with /etc/postfix/master.cf.

PS.
Bear in mind that I also noticed some other warnings that may be related to this warning.

Feb 1 06:30:39 ns1 postmulti[139642]: /usr/sbin/postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
Feb 1 06:30:39 ns1 postmulti[139642]: /usr/sbin/postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
Feb 1 06:30:39 ns1 postmulti[139642]: /usr/sbin/postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions

These were fixed by adding the following to /etc/postfix/main.cf:

smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions
mua_client_restrictions = permit_sasl_authenticated, reject
mua_sender_restrictions = permit_sasl_authenticated, reject
mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit

Can anyone chime in and tell me which of the two lines should I leave in the master.cf file?

I’m pretty sure A is commented out in a default Ubuntu configuration, and we add B during installation of Virtualmin.

1 Like

I went back to /etc/postfix/main.cf and removed my additional lines.
I went back to /etc/postfix/master.cf and commented out the silly line A].
Restarted dovecot and postfix.
Checked syslog… clean as a whistle.
Thanks a lot.
I will double check and make sure if this was a result of my upgrade to 20.04 and will report back.

UPDATE:
No this was there from Ubuntu 18.04. Don’t know why.

Rory, I have checked all your other recent posts on the forum, and it seems that you’re not including Virtualmin version installed – is this on purpose?

I remember fixing that Posfix issue many releases ago, where those lines mention in A were incorrectly added. This should not be a problem, in case you have latest Virtualmin 6.17-3 installed.

Probably left out by mistake.
This is my setup before the upgrade:
Operating system Ubuntu Linux 18.04.6
Webmin version 1.984 Usermin version 1.834
Virtualmin version 6.17-3 Authentic theme version 19.84.7
Time on system Wednesday, January 26, 2022 5:20 AM Kernel and CPU Linux 4.15.0-166-generic on x86_64

This after the upgrade:
Operating system Ubuntu Linux 20.04.3
Webmin version 1.984 Usermin version 1.834
Virtualmin version 6.17-3 Authentic theme version 19.84.7
Time on system Tuesday, February 1, 2022 5:55 AM Kernel and CPU Linux 5.4.0-96-generic on x86_64

I I could not begin to imagine how those lines ended up in there. Beats me!

Perhaps been there for a long time before, and recent Posfix restart made the issue popup.

Please let us know if that ever happens again!

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.