Cara Mengatasi 'Milter error connecting to filter connection refused by localhost'

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
Post Reply
User avatar
bang_andi
Been thanked: 5 times
Contact:

Cara Mengatasi 'Milter error connecting to filter connection refused by localhost'

Post 17 Aug 2018, 23:03

Spesifikasi:
Ubuntu server 16.04 lts, Postfix, Opendkim, Clamav, Mysql, Roundcube, Apache2, SSL Lets Encrypt ( tanpa Dovecot )

Masalah ini diketahui saat menjalankan perintah,

Code: Select all

# service postfix status
Kemudian masalah ini terlihat dengan keterangan sbb:

Code: Select all

warning : connect to Milter service inet:localhost:12301: Connection refused
...yang menyebabkan masalah ini adalah Milter (Opendkim), saat di cek service-nya running, normal

Code: Select all

# service opendkim status
namun saat di cek dengan, maka kelihatan Opendkim is not listening on port 12301

Code: Select all

# netstat -tulnp | grep opendkim
# ' No result'
Solusinya :

1) Cek konfigurasi opendkim, perbaiki bila ada kesalahan konfigurasi,

Code: Select all

# cat /etc/opendkim.conf
Restart opendkim dan cek statusnya.

2) Jika masih bermasalah, maka lakukan ini, gunakan editor yang biasa anda gunakan,

Code: Select all

# nano /etc/systemd/system/multi-user.target.wants/opendkim.service

Code: Select all

# If you are using OpenDKIM with SQL datasets it might be necessary to start OpenDKIM after the database servers.
# For example, if using both MariaDB and PostgreSQL, change "After=" in the "[Unit]" section to:
# After=network.target nss-lookup.target syslog.target mariadb.service postgresql.service
 
[Unit]
Description=DomainKeys Identified Mail (DKIM) Milter
Documentation=man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) ma$
After=network.target nss-lookup.target
 
[Service]
Type=forking
EnvironmentFile=-/etc/default/opendkim
PIDFile=/var/run/opendkim/opendkim.pid
PermissionsStartOnly=true
User=opendkim
Group=opendkim
ExecStartPre=-/bin/mkdir -p /var/run/opendkim
ExecStartPre=-/bin/chown opendkim.opendkim /var/run/opendkim
#ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p $SOCKET $DAEMON_OPTS
ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:12301@localhost
TimeoutStartSec=10
ExecReload=/bin/kill -USR1 $MAINPID
 
[Install]
WantedBy=multi-user.target
Dan edit di line ini, add inet:port@localhost sehingga menjadi,

Code: Select all

#ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p $SOCKET $DAEMON_OPTS
ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:12301@localhost
Save dan reload opendkim, cek ulang dengan netstat,

Code: Select all

Warning: opendkim.service changed on disk. Run 'systemctl daemon-reload' to reload units.
root@smtp-ubuntu:/etc# systemctl daemon-reload
root@smtp-ubuntu:/etc# service opendkim restart
root@smtp-ubuntu:/etc# netstat -tulnp | grep opendkim
tcp        0      0 127.0.0.1:12301         0.0.0.0:*               LISTEN      9754/opendkim

Done. Problem solved.


Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests