opendkim Service unavailable

  • After upgrade to 4.1.7 (but also in 4.1.6) i get the following error in /var/log/mail.log


    Code
    1. After restart opendkim/var/log/mail.logJul 10 08:28:30 web4you-server-02 dovecot: master: Dovecot v2.2.27 (c0f36b0) starting up for imap, sieve, pop3 (core dumps disabled)Jul 10 08:29:15 web4you-server-02 opendkim[13151]: OpenDKIM Filter v2.11.0 starting (args: -P /var/run/opendkim/opendkim.pid -p local:/var/run/opendkim/opendkim.sock)and after "sending" emailJul 10 08:31:00 web4you-server-02 postfix/smtpd[13440]: connect from 203-18-138-91.dyn.cable.fcom.ch[91.138.18.203]Jul 10 08:31:00 web4you-server-02 postfix/smtpd[13440]: warning: connect to Milter service unix:/opendkim/opendkim.sock: No such file or directoryJul 10 08:31:00 web4you-server-02 postfix/smtpd[13440]: NOQUEUE: milter-reject: CONNECT from 203-18-138-91.dyn.cable.fcom.ch[91.138.18.203]: 451 4.7.1 Service unavailable - try again later; proto=SMTPJul 10 08:31:00 web4you-server-02 postfix/smtpd[13440]: NOQUEUE: milter-reject: EHLO from 203-18-138-91.dyn.cable.fcom.ch[91.138.18.203]: 451 4.7.1 Service unavailable - try again later; proto=SMTP helo=<[192.168.10.10]>



    I think there must be something wrong with paths:


    Code
    1. root@web4you-server-02:/home/juerg# ls -la /var/spool/postfix/opendkim/opendkim.sock socketls: Zugriff auf '/var/spool/postfix/opendkim/opendkim.sock' nicht möglich: Datei oder Verzeichnis nicht gefundenls: Zugriff auf 'socket' nicht möglich: Datei oder Verzeichnis nicht gefundenroot@web4you-server-02:/home/juerg#

    There is a /var/run/opendkim directory with opendkim.pid and opendkim.sock


    /etc/opendkim.conf look like:






    Means access to socket not possible: File or Directory not found.


    After completly removing i can send mails.

    I-MSCP 1.5.3 - Debian 9 Stretch

  • After upgrade to 4.1.7 (but also in 4.1.6)

    Please, stop the bottle ;)


    We will investigate for that issue as soon as possible.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hi together,
    it seems i had the same problem after a fresh installation.
    This is a bug of Debian 9: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864162


    You can fix the problem with the following command:

    Code
    1. systemctl edit opendkim


    Insert the following lines:

    Code
    1. [Service]
    2. ExecStart=
    3. ExecStart=/usr/sbin/opendkim -P /var/run/opendkim/opendkim.pid -p local:/var/spool/postfix/opendkim/opendkim.sock


    Restart openDKIM and everything will work

    Edited 2 times, last by TheCry ().

  • @TheCry


    We can always provide our own systemd service file if needed.


    However, why an empty ExecStart= ?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @TheCry


    You're welcome.


    There is no longer an /etc/default/opendkim file under Stretch for environment variables which we could import in systemd service? Eg, as done in the bug report:


    Shell-Script
    1. [Service]
    2. Type=forking
    3. EnvironmentFile=-/etc/default/opendkim
    4. PIDFile=/var/run/opendkim/opendkim.pid
    5. User=opendkim
    6. UMask=0007
    7. ExecStart=/usr/sbin/opendkim -P /var/run/opendkim/opendkim.pid -p $SOCKET
    8. Restart=on-failure
    9. ExecReload=/bin/kill -USR1 $MAINPID

    ???


    My idea is to provide our own systemd service configuration file for opendkim which would be installed in the /etc/systemd/system directory. This would override the default systemd configuration file that is provided by the package.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Mhhh.. I'd tested with only one line.. There i got an error

    Quote

    opendkim.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.

    The empty line must added

  • @TheCry


    You're welcome.


    There is no longer an /etc/default/opendkim file under Stretch for environment variables which we could import in systemd service? Eg, as done in the bug report:
    ??

    The /etc/default/opendkim is still available, but the systemd does not read the file. SO you got the error line in the first post.

  • Read my previous answer. You must tell systemd to import the variables from the file as shown above.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @TheCry


    Based on default, could you try with:


    /etc/systemd/system/opendkim.service

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206