I manage a VPS with a custom configuration in the Postfix master.cf file (link to my blog explaining the trick) that allows me to associate unique SSL certificates to each domain/IP for smtp and pop/imap services. Everything runs flawlessly, except for one big flaw:

Every time the system reboots, somehow the following gets appended to the master.cf file, which breaks Postfix.

smtp       inet n - n - - smtpd
smtps      inet n - n - - smtpd -o smtpd_tls_wrappermode=yes 
submission inet n - n - - smtpd -o smtpd_enforce_tls=yes -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination

Thus, after each restart, I have to open the master.cf file, delete the lines you see below, and restart the postfix service for everything to function again.

My question is this: can anyone please tell me what script is doing this?

I looked in the following, without ever finding the culprit (but that doesn't necessarily mean it's not in one of these):

  • /etc/init.d
  • /etc/rc.d
  • /usr/libexec
  • /usr/local/psa/bootstrapper/pp11.5.30-bootstrapper/
  • /usr/local/psa/admin/conf/
  • /var/lock/spool/postfix

closed as off-topic by HopelessN00b Jan 14 '15 at 9:18

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Not really an answer to your question, but with Plesk installed, I'd make sure to have /etc/ in git or bzr. I manage a Plesk server too, and it constantly messes up my configuration, particularly Postfix, both main.cf and master.cf. – Halfgaar Nov 27 '14 at 22:18
  • I've learned long ago to keep backups of my custom-config files in Plesk... Thank you anyway! – Peter Nov 29 '14 at 12:12
  • This question appears to be off-topic because it is about working with a service provider's management interface, such as cPanel. – HopelessN00b Jan 14 '15 at 9:18
  • This is not about dealing with the Plesk interface, it's about figuring out what Plesk is doing to Postfix 'behind the scenes'... But leave the hold if that stimulates you.. – Peter Jan 15 '15 at 10:35

The culprit is Plesk.


Snippet from both page:

The default settings in /etc/postfix/master.cf will be restored after mail reconfiguration on any domain. Consider creating a scheduled task to replace /etc/postfix/master.cf with a custom file.

Which file did caused modification, you should ask plesk.

disclaimer: never use plesk, never administrating plesk server. All info was result from googling

  • I can imagine that it's Plesk that does it... But it must have a config file or a script that it applies... That's what i'm looking for.. – Peter Nov 27 '14 at 22:07
  • @Peter, in that page, plesk state that in the future, plesk won't rewrite master.cf again. So it' s unconfigurable and default behavior. – masegaloeh Nov 27 '14 at 23:53
  • Anyway, plesk is closed-source program written with C. The program who responsible rewrite it maybe buried deep in its binary not a script. – masegaloeh Nov 27 '14 at 23:54
  • That's what i'm afraid of... Because i really can't find anything that is called up at startup, and modifies de master.cf file... Thank you anyway! – Peter Nov 29 '14 at 12:08

This lines are added by a call of mchk (usually placed in /usr/local/psa/admin/sbin/mchk --without-spam)

But this tool shouldn't be executed on any stop/start/restart server or any service.

As I am sure you understand what are you doing, (as bad ultimate solution) you can just remove execution bit on this file.

But of course you have to find out where this utility called from.

  • Are you sure that this shell script is the one that adds the lines i'm concerned about to the master.cf file? i see no reference to it inside the script.. PS: thank you for your answer! – Peter Dec 1 '14 at 16:13
  • Peter, yes I'm sure, because I've checked it. mchk just run necessary binaries from /usr/lib64/plesk-9.0/(or /usr/lib/plesk-9.0/) – Oleg Neumyvakin Dec 2 '14 at 5:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.