Topic: Amavis starts at boot time but not bind to tcp ports
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: Debian Stretch
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Amavis starts at boot time but not bind to its tcp ports. When booted, if I restart the service, amavis runs and bind normally to tcp ports.
System booted, or after reboot:
1) Amavis processes are running
ps aux | grep amavis
amavis 1036 3.1 2.6 263472 132520 ? Ss 10:57 0:00 /usr/sbin/amavisd-new (master)
amavis 1210 0.0 2.5 263472 127168 ? S 10:57 0:00 /usr/sbin/amavisd-new (virgin child)
amavis 1211 0.0 2.5 263472 127168 ? S 10:57 0:00 /usr/sbin/amavisd-new (virgin child)
2) But not binds to tcp ports
netstat -tlnp
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 1808/master
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 753/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1808/master
tcp 0 0 127.0.0.1:7790 0.0.0.0:* LISTEN 458/uwsgi
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 470/nginx: master p
tcp 0 0 127.0.0.1:24242 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 435/sshd
tcp 0 0 127.0.0.1:24 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1808/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 470/nginx: master p
tcp 0 0 127.0.0.1:8125 0.0.0.0:* LISTEN 1818/netdata
tcp 0 0 127.0.0.1:4190 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 127.0.0.1:19999 0.0.0.0:* LISTEN 1818/netdata
tcp 0 0 127.0.0.1:7777 0.0.0.0:* LISTEN 736/python
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 466/dovecot
tcp6 0 0 :::587 :::* LISTEN 1808/master
tcp6 0 0 :::110 :::* LISTEN 466/dovecot
tcp6 0 0 :::143 :::* LISTEN 466/dovecot
tcp6 0 0 :::22 :::* LISTEN 435/sshd
tcp6 0 0 :::25 :::* LISTEN 1808/master
tcp6 0 0 ::1:8125 :::* LISTEN 1818/netdata
tcp6 0 0 :::993 :::* LISTEN 466/dovecot
tcp6 0 0 :::995 :::* LISTEN 466/dovecot
After I restart it manually
1) amavis processes are running
ps aux | grep amavis
amavis 2192 1.3 2.6 263624 132784 ? Ss 11:00 0:00 /usr/sbin/amavisd-new (master)
amavis 2193 0.0 2.5 263624 127260 ? S 11:00 0:00 /usr/sbin/amavisd-new (virgin child)
amavis 2194 0.0 2.5 263624 127260 ? S 11:00 0:00 /usr/sbin/amavisd-new (virgin child)
2) amavis bind to its ports
netstat -tlnp
tcp 0 0 127.0.0.1:10024 0.0.0.0:* LISTEN 2192/amavisd-new (m
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 1808/master
tcp 0 0 127.0.0.1:10026 0.0.0.0:* LISTEN 2192/amavisd-new (m
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 753/mysqld
tcp 0 0 127.0.0.1:10027 0.0.0.0:* LISTEN 2192/amavisd-new (m
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1808/master
tcp 0 0 127.0.0.1:9998 0.0.0.0:* LISTEN 2192/amavisd-new (m
tcp 0 0 127.0.0.1:7790 0.0.0.0:* LISTEN 458/uwsgi
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 470/nginx: master p
tcp 0 0 127.0.0.1:24242 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 435/sshd
tcp 0 0 127.0.0.1:24 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1808/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 470/nginx: master p
tcp 0 0 127.0.0.1:8125 0.0.0.0:* LISTEN 1818/netdata
tcp 0 0 127.0.0.1:4190 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 127.0.0.1:19999 0.0.0.0:* LISTEN 1818/netdata
tcp 0 0 127.0.0.1:7777 0.0.0.0:* LISTEN 736/python
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 466/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 466/dovecot
tcp6 0 0 :::587 :::* LISTEN 1808/master
tcp6 0 0 :::110 :::* LISTEN 466/dovecot
tcp6 0 0 :::143 :::* LISTEN 466/dovecot
tcp6 0 0 :::22 :::* LISTEN 435/sshd
tcp6 0 0 :::25 :::* LISTEN 1808/master
tcp6 0 0 ::1:8125 :::* LISTEN 1818/netdata
tcp6 0 0 :::993 :::* LISTEN 466/dovecot
tcp6 0 0 :::995 :::* LISTEN 466/dovecot
I have searched for infos about this problem and I saw in this forum that it can be something about order of services started at boot time, but when I saw amavis.service file everything it's ok in relationship to dependence from network services
amavis.service:
[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/amavis
Description=LSB: Starts amavisd-new mailfilter
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
Wants=network-online.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/amavis start
ExecStop=/etc/init.d/amavis stop
Obviously when amavis is not bound to its ports and I try to use it as content-filter every mail I send is queued but not sent because of refused connections messages following no amavis bound to ports.
I did a iRedMail install on a fresh installed Debain Stretch system and I have not modified any conf file for amavis and postfix.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.