MTA does not start

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
yakuraku1
Posts: 6
Joined: Fri Mar 30, 2018 11:43 am

MTA does not start

Postby yakuraku1 » Wed Nov 20, 2019 9:06 am

Hi,

I have zimbra running on a Ubuntu 16.04. This server is Zimbra exclusive, so nothing installed beside it. It happens (more often than is should) that the MTA stops working, or will not start at all (even after reboot). In the log files are no traces of postfix or mta to be found.

Here some information:

Code: Select all

zimbra@zimbra:~$ zmcontrol -v     
Release 8.8.12.GA.3794.UBUNTU16.64 UBUNTU16_64 FOSS edition, Patch 8.8.12_P6.
zimbra@zimbra:~$ lsb_release -a
No LSB modules are available.
Distributor ID:   Ubuntu
Description:   Ubuntu 16.04.6 LTS
Release:   16.04
Codename:   xenial

Code: Select all

zimbra@zimbra:~$ zmcontrol status
Host zimbra.xxx.xxx
   amavis                  Running
   antispam                Running
   antivirus               Running
   dnscache                Running
   ldap                    Running
   logger                  Running
   mailbox                 Running
   memcached               Running
   mta                     Stopped
      postfix is not running
   opendkim                Running
   proxy                   Running
   service webapp          Running
   snmp                    Running
   spell                   Running
   stats                   Running
   zimbra webapp           Running
   zimbraAdmin webapp      Running
   zimlet webapp           Running
   zmconfigd               Running

Code: Select all

zimbra@zimbra:~$ zmmtactl restart
Rewriting configuration files...done.
Stopping saslauthd...done.
Starting saslauthd...done.
/postfix-script: fatal: the Postfix mail system is not running

Code: Select all

root@zimbra:~# systemctl restart postfix
Failed to restart postfix.service: Unit postfix.service not found.


phoenix
Ambassador
Ambassador
Posts: 26343
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: MTA does not start

Postby phoenix » Wed Nov 20, 2019 11:17 am

First of all, the last command you're running to start postfix is incorrect as you're trying to start the system version of postfix and that's not installed or used by zimbra - the ZCS postfix is started by the "zmmtactl restart" that you've already used.

Your use of the "zmmtactl restart" tells you that postfix is "not running" and you'll need to look in the log files for the reason it's not starting, see here: https://wiki.zimbra.com/wiki/Log_Files
Regards

Bill

Rspamd: A high performance spamassassin replacement

If you'd like to see this implemented in a future version of ZCS then please vote on Bugzilla entries 97706 & 108168
yakuraku1
Posts: 6
Joined: Fri Mar 30, 2018 11:43 am

Re: MTA does not start

Postby yakuraku1 » Wed Nov 20, 2019 11:33 am

I looked into the MTA logs from, but there is no real information which may help to resolve it.

From /var/log/zimbra.log:

Code: Select all

Nov 20 12:21:41 zimbra zmconfigd[1528]: Processing rewrite request for antispam
Nov 20 12:21:41 zimbra zmconfigd[1528]: Processing rewrite request for antivirus
Nov 20 12:21:41 zimbra zmconfigd[1528]: Processing rewrite request for opendkim
Nov 20 12:21:41 zimbra zmconfigd[1528]: Processing rewrite request for mta
Nov 20 12:21:41 zimbra zmconfigd[1528]: Processing rewrite request for sasl
Nov 20 12:21:41 zimbra zmconfigd[1528]: Fetching All configs
Nov 20 12:21:41 zimbra zmconfigd[1528]: All configs fetched in 0.04 seconds
Nov 20 12:21:45 zimbra zmconfigd[1528]: Tracking service mta
Nov 20 12:21:46 zimbra zmconfigd[1528]: Watchdog: service antivirus status is OK.
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/freshclam.conf with mode 600 (0.01 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/opendkim.conf with mode 440 (0.01 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/dspam.conf with mode 440 (0.01 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/clamd.conf with mode 440 (0.01 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/common/conf/tag_as_originating.re with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/sasl2/smtpd.conf with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/postfix_header_checks with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/opendkim-localnets.conf with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/common/conf/tag_as_foreign.re with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/saslauthd.conf with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/common/conf/master.cf with mode 440 (0.01 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/data/spamassassin/localrules/salocal.cf with mode 440 (0.00 sec)
Nov 20 12:21:46 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/mta_milter_options with mode 440 (0.00 sec)
Nov 20 12:22:00 zimbra zmconfigd[1528]: All rewrite threads completed in 13.95 sec
Nov 20 12:22:00 zimbra zmconfigd[1528]: All restarts completed in 0.00 sec
Nov 20 12:22:02 zimbra postfix/postqueue[18579]: fatal: Queue report unavailable - mail system is down
Nov 20 12:22:05 zimbra saslauthd[23773]: server_exit     : master exited: 23773
Nov 20 12:22:05 zimbra systemd-logind[1115]: Removed session 13.
Nov 20 12:22:06 zimbra zmconfigd[1528]: Processing rewrite request for sasl
Nov 20 12:22:07 zimbra zmconfigd[1528]: Fetching All configs
Nov 20 12:22:07 zimbra zmconfigd[1528]: All configs fetched in 0.04 seconds
Nov 20 12:22:11 zimbra zmconfigd[1528]: Tracking service mta
Nov 20 12:22:11 zimbra zmconfigd[1528]: Service status change: zimbra.xxx.xxx sasl changed from running to stopped
Nov 20 12:22:12 zimbra zmconfigd[1528]: Watchdog: service antivirus status is OK.
Nov 20 12:22:12 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/sasl2/smtpd.conf with mode 440 (0.00 sec)
Nov 20 12:22:12 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/saslauthd.conf with mode 440 (0.00 sec)
Nov 20 12:22:12 zimbra zmconfigd[1528]: All rewrite threads completed in 0.01 sec
Nov 20 12:22:12 zimbra zmconfigd[1528]: All restarts completed in 0.00 sec
Nov 20 12:22:15 zimbra clamd[4639]: SelfCheck: Database status OK.
Nov 20 12:22:17 zimbra saslauthd[19382]: detach_tty      : master pid is: 19382
Nov 20 12:22:17 zimbra saslauthd[19382]: ipc_init        : listening on socket: /opt/zimbra/data/sasl2/state/mux
Nov 20 12:22:17 zimbra zmconfigd[1528]: Processing rewrite request for mta
Nov 20 12:22:18 zimbra zmconfigd[1528]: Fetching All configs
Nov 20 12:22:18 zimbra zmconfigd[1528]: All configs fetched in 0.03 seconds
Nov 20 12:22:22 zimbra zmconfigd[1528]: Tracking service mta
Nov 20 12:22:22 zimbra zmconfigd[1528]: Service status change: zimbra.xxx.xxx sasl changed from stopped to running
Nov 20 12:22:23 zimbra zmconfigd[1528]: Watchdog: service antivirus status is OK.
Nov 20 12:22:23 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/common/conf/tag_as_originating.re with mode 440 (0.00 sec)
Nov 20 12:22:23 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/postfix_header_checks with mode 440 (0.00 sec)
Nov 20 12:22:23 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/common/conf/tag_as_foreign.re with mode 440 (0.00 sec)
Nov 20 12:22:23 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/common/conf/master.cf with mode 440 (0.01 sec)
Nov 20 12:22:23 zimbra zmconfigd[1528]: Rewrote: /opt/zimbra/conf/mta_milter_options with mode 440 (0.00 sec)
Nov 20 12:22:36 zimbra zmconfigd[1528]: All rewrite threads completed in 13.35 sec
Nov 20 12:22:36 zimbra zmconfigd[1528]: All restarts completed in 0.00 sec
Nov 20 12:22:38 zimbra postfix/postqueue[20403]: fatal: Queue report unavailable - mail system is down
Nov 20 12:22:40 zimbra sshd[20747]: Connection closed by 192.168.90.42 port 56164 [preauth]
Nov 20 12:22:41 zimbra /postfix-script[20758]: fatal: the Postfix mail system is not running
Nov 20 12:23:08 zimbra postfix/postqueue[20765]: fatal: Queue report unavailable - mail system is down
mja
Posts: 8
Joined: Sun Dec 04, 2016 2:51 am

Re: MTA does not start

Postby mja » Wed Nov 20, 2019 2:18 pm

Are exim disabled?

Try to stop it and start zimbra again

systemctl stop exim

Verify if the port 25 is being used by another process:

netstat -luntp
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 482
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 8.7.11_P14 RHEL6 Network Edition
Contact:

Re: MTA does not start

Postby JDunphy » Wed Nov 20, 2019 2:21 pm

/opt/zimbra/libexec/zmmtastatus (perl script) is run as root to see if the MTA is running... which should do this:
/opt/zimbra/common/sbin/postfix status which calls: /opt/zimbra/common/libexec/postfix-script status (bash script) ... but Zimbra chose the kill -0 pattern instead to determine if postfix is running and ignore the logic already built into postfix that uses the pid file as an advisory lock ... Zimbra doesn't account for pid wrap so it can be confused and not start the MTA if you are really unlucky even on reboot depending on the value of the pid in that master.pid ... If you cat /opt/zimbra/data/postfix/spool/pid/master.pid and it contains a really low pid number, you are a victim of this bug. Some people blow the master.pid file away, but a better approach is to call /opt/zimbra/common/sbin/postfix status since it knows how to handle this file and do the correct thing.

BTW, zimbra will eventually call /opt/zimbra/common/sbin/postfix start which uses that postfix-script again as the logic that starts it. Not sure why they chose to ignore status but called start???

I describe this bug here.

ref: viewtopic.php?f=15&t=65332

Note: they did use this patch for 8.8.15 but I don't believe it made it's way to older versions. I run with the patch I describe above in 8.7.11+ without issues given I have to restart often unattended with letsencrypt certs.

Jim
yakuraku1
Posts: 6
Joined: Fri Mar 30, 2018 11:43 am

Re: MTA does not start

Postby yakuraku1 » Wed Nov 20, 2019 2:37 pm

After another 2 reboots and a zmcontrol restart zimbra is running again.

Thanks for the suggestions. :)

Return to “Administrators”

Who is online

Users browsing this forum: Google [Bot] and 7 guests