MacOS – How to destroy postfix on mac os x

launchdmacos

I see these two log statements non-stop in my console logs..
postfix error

I have previously tried to eliminate postfix using this command

sudo launchctl unload /System/Library/LaunchDaemons/org.postfix.master.plist

and

sudo launchctl remove /System/Library/LaunchDaemons/org.postfix.master.plist

But it keeps coming back to life after every reboot.

Do I really need postfix? I am a regular GMail user and I don't need any system apps to send emails.

I tried using the instructions at
How can I revert my etc/postfix/main.cf file?
to reset my postfix configuration to the stock version with the hope that it might start working normally but it did not help.

Best Answer

sudo rm /System/Library/LaunchDaemons/org.postfix.master.plist will prevent postfix from starting at launch and being daemonized (if it has been installed in a usual way). This will effectively prevent postfix from running. However, removal of all files and config is another matter. If you installed using a package manager then that’s the way to remove it. Otherwise you have to search your computer and remove postfix-related files.

The unload comando just stops a service from running but, as you have noticed, starts again at boot because the plist file is still present.

You probably don’t need postfix on your Mac. It’s mostly for use for sending mail from a server (smtp server)—Gmail, yes, does that for you. You might have installed postfix so PHP can send emails, but for development you could try a faux postfix that logs instead of sends like Mailhog.