When Server upgrades itself after a Mac OS Sierra to High Sierra upgrade it can leave the mail server broken. For example you cannot send emails using command line utilities mailx etc.
The reason is that in /Library/Server/Mail/Config/postfix/master.cf this line
pickup fifo n - n 60 1 pickup
-o content_filter=smtp-amavis:[127.0.0.1]:10024
references transport 'smtp-amavis' but this is not defined.
If the Mail server preferences pane is used to turn on antivirus filtering the required definition of smtp-amavis is added at the end of master.cf and the mail system functions properly. It continues to work if the antivirus filtering is then turned off because the 'pickup' definition no longer references smtp-amavis.