postfix/postfix-script: fatal: the Postfix mail system is not running

Solution 1:

To use the same postfix in both Server app and terminal with Server app 5 it is needed some fixes.

The main difference from Server app 3 and 5 is that in Server app 3, used postfix from the system, so it was possible in that time to command that postfix from Server app 3 through terminal, now with Server app 5, that ability has changes, now you have the postfix from the system and another postfix in,

/Applications/Server.app/Contents/ServerRoot/

there are a lot of locations where the new main.cf if pointing, that are different from Server app 3.

Here i will do a list of changes from /Library/Server/Mail/Config/postfix/main.cf of Server app 3 to Server app 5(also in the same path)for anyone who wants to use the native postfix (in comment is the new values of Server app 5):

#command_directory = /Applications/Server.app/Contents/ServerRoot/usr/sbin
command_directory = /usr/sbin

#daemon_directory = /Applications/Server.app/Contents/ServerRoot/usr/libexec/postfix
daemon_directory = /usr/libexec/postfix

#sendmail_path = /Applications/Server.app/Contents/ServerRoot/usr/sbin/sendmail
sendmail_path = /usr/sbin/sendmail

#mailq_path = /Applications/Server.app/Contents/ServerRoot/usr/bin/mailq
mailq_path = /usr/bin/mailq

#html_directory = /Applications/Server.app/Contents/ServerRoot/usr/share/doc/postfix/html
html_directory = /usr/share/doc/postfix/html

#manpage_directory = /Applications/Server.app/Contents/ServerRoot/usr/share/man
manpage_directory = /usr/share/man

#sample_directory = /Applications/Server.app/Contents/ServerRoot/usr/share/doc/postfix/examples
sample_directory = /usr/share/doc/postfix/examples

#readme_directory = /Applications/Server.app/Contents/ServerRoot/usr/share/doc/postfix
readme_directory = /usr/share/doc/postfix

At least with me in Server app 3 turning off mail didnt turn off both postfix and dovecot, but now with Server App 5, it turns both off, so you must start then postfix through:

postfix start

and then start dovecot (you just need arguments to stop or reload),

dovecotd