Problem with DKIM and Emails

Discussion in 'Installation/Configuration' started by c3do, Jun 19, 2017.

  1. c3do

    c3do New Member

    hello,
    i have installed a fresh centos 7.3 server with ispconfig following this tutorial :
    https://www.howtoforge.com/tutorial...l-php-pureftpd-postfix-dovecot-and-ispconfig/

    i am newbie on Centos, ispconfig, postfix, ....
    First, i had a problem with amavis that didn't want to start. It work now thanks to this post: https://www.howtoforge.com/community/threads/amavisd-wont-start.73673/#post-346676

    Now my problems are:
    1- i can send an email from roundcube but not from an email client.
    2- i can receive emails from the same email adress when i send it with roundcube. (the email client receive the email too)
    3- i can't receive any email from an external email adress.

    4- result of: amavisd -c /etc/amavisd/amavisd.conf testkeys
    Code:
    TESTING#1 mydomain1.com: default._domainkey.mydomain1.com => invalid (public key: DNS error: SERVFAIL)
    TESTING#2 mydomain2.fr: default._domainkey.mydomain2.fr => invalid (public key: not available)
    5- result of: dig @xxx.xxx.xxx.xxx -t txt dkim._domainkey.mydomain1.com
    Code:
    ; <<>> DiG 9.9.4-RedHat-9.9.4-38.el7_3.3 <<>> @xxx.xxx.xxx.xxx -t txt dkim._domainkey.mydomain1.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 36420
    ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
    ;; WARNING: recursion requested but not available
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;dkim._domainkey.mydomain1.com. IN    TXT
    
    ;; AUTHORITY SECTION:
    mydomain1.com.        3600    IN      SOA     myvps.ovh.net. webmaster.mydomain1.com. 2017061936 7200 540 604800 3600
    
    ;; Query time: 1 msec
    ;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)
    ;; WHEN: lun. juin 19 14:05:55 CEST 2017
    ;; MSG SIZE  rcvd: 123
    Please help me. Linux doesn't like me...
     
    Last edited: Jun 19, 2017
  2. Tuumke

    Tuumke Member

    Did you check the DKIM box in ISPConfig e-mail domain and also the generate button?
     
  3. c3do

    c3do New Member

    i have disable DKIM for mydomain1 and i have removed the DNS record but the problem is still here.
     
  4. c3do

    c3do New Member

    here is my maillog when i try to receive an email.
    Code:
    Jun 19 15:20:49 vps postfix/postfix-script[22732]: starting the Postfix mail system
    Jun 19 15:20:49 vps postfix/master[22734]: daemon started -- version 2.10.1, configuration /etc/postfix
    Jun 19 15:21:04 vps dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=22790, secured, session=<X3nLAVBSogB/AAAB>
    Jun 19 15:21:04 vps dovecot: imap([email protected]): Disconnected: Logged out in=90 out=856
    Jun 19 15:21:09 vps postfix/smtpd[22800]: connect from mail-ua0-f178.google.com[209.85.217.178]
    Jun 19 15:21:10 vps postfix/smtpd[22800]: NOQUEUE: filter: RCPT from mail-ua0-f178.google.com[209.85.217.178]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10026; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-ua0-f178.google.com>
    Jun 19 15:21:10 vps postfix/smtpd[22800]: NOQUEUE: filter: RCPT from mail-ua0-f178.google.com[209.85.217.178]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10024; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-ua0-f178.google.com>
    Jun 19 15:21:10 vps postfix/smtpd[22800]: CCD791FBF2: client=mail-ua0-f178.google.com[209.85.217.178]
    Jun 19 15:21:11 vps postfix/cleanup[22817]: CCD791FBF2: message-id=<[email protected]om>
    Jun 19 15:21:11 vps postfix/qmgr[22736]: CCD791FBF2: from=<[email protected]>, size=2248, nrcpt=1 (queue active)
    Jun 19 15:21:11 vps postfix/smtp[22818]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
    Jun 19 15:21:11 vps postfix/smtp[22818]: CCD791FBF2: to=<[email protected]>, relay=none, delay=0.62, delays=0.61/0.01/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
    Jun 19 15:21:11 vps postfix/smtpd[22800]: disconnect from mail-ua0-f178.google.com[209.85.217.178]
    Jun 19 15:21:37 vps postfix/smtpd[22800]: connect from mail-vk0-f41.google.com[209.85.213.41]
    Jun 19 15:21:37 vps dovecot: imap-login: Login: user=<[email protected]1.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=22860, secured, session=<it/JA1BSugB/AAAB>
    Jun 19 15:21:38 vps dovecot: imap([email protected]): Disconnected: Logged out in=322 out=2749
    Jun 19 15:21:38 vps postfix/smtpd[22800]: NOQUEUE: filter: RCPT from mail-vk0-f41.google.com[209.85.213.41]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10026; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-ua0-f178.google.com>
    Jun 19 15:21:38 vps postfix/smtpd[22800]: NOQUEUE: filter: RCPT from mail-vk0-f41.google.com[209.85.213.41]: <[email protected]>: Sender address triggers FILTER amavis:[127.0.0.1]:10024; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-ua0-f178.google.com>
    Jun 19 15:21:38 vps postfix/smtpd[22800]: 2880921688: client=mail-vk0-f41.google.com[209.85.213.41]
    Jun 19 15:21:38 vps postfix/cleanup[22817]: 2880921688: message-id=<[email protected]om>
    Jun 19 15:21:38 vps postfix/qmgr[22736]: 2880921688: from=<[email protected]>, size=3374, nrcpt=1 (queue active)
    Jun 19 15:21:38 vps postfix/smtp[22818]: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused
    Jun 19 15:21:38 vps postfix/smtp[22818]: 2880921688: to=<[email protected]>, relay=none, delay=0.24, delays=0.24/0/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10024: Connection refused)
    Jun 19 15:21:38 vps postfix/smtpd[22800]: disconnect from mail-vk0-f41.google.com[209.85.213.41]
    Jun 19 15:21:39 vps dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=22867, secured, session=<mmDcA1BSvgB/AAAB>
    Jun 19 15:21:39 vps dovecot: imap([email protected]): Disconnected: Logged out in=312 out=1714
    
    
     
  5. c3do

    c3do New Member

    and finally amavis is down again

    Code:
    restart amavisd.service
    Job for amavisd.service failed because the control process exited with error code. See "systemctl status amavisd.service" and "journalctl -xe" for details.
    [[email protected] log]# systemctl status amavisd.service
    ● amavisd.service - Amavisd-new is an interface between MTA and content checkers.
       Loaded: loaded (/usr/lib/systemd/system/amavisd.service; enabled; vendor preset: disabled)
       Active: failed (Result: start-limit) since lun. 2017-06-19 15:34:41 CEST; 21s ago
         Docs: http://www.ijs.si/software/amavisd/#doc
      Process: 24646 ExecStart=/usr/sbin/amavisd -c /etc/amavisd/amavisd.conf (code=exited, status=2)
    Main PID: 5332 (code=exited, status=0/SUCCESS)
    
    juin 19 15:34:40 vps.ovh.net systemd[1]: amavisd.service: control process exited, code=exited status=2
    juin 19 15:34:40 vps.ovh.net systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
    juin 19 15:34:40 vps.ovh.net systemd[1]: Unit amavisd.service entered failed state.
    juin 19 15:34:40 vps.ovh.net systemd[1]: amavisd.service failed.
    juin 19 15:34:41 vps.ovh.net systemd[1]: amavisd.service holdoff time over, scheduling restart.
    juin 19 15:34:41 vps.ovh.net systemd[1]: start request repeated too quickly for amavisd.service
    juin 19 15:34:41 vps.ovh.net systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
    juin 19 15:34:41 vps.ovh.net systemd[1]: Unit amavisd.service entered failed state.
    juin 19 15:34:41 vps.ovh.net systemd[1]: amavisd.service failed.
    
    
     
  6. c3do

    c3do New Member

    just tried "amavisd debug" and it work in debug mode. i can receive and send emails with roundcube, but i can't send email with the client.
    now, the problem is, why amavisd.service don't start
     
  7. c3do

    c3do New Member

    Code:
    [[email protected] log]# systemctl start amavisd.service
    Job for amavisd.service failed because the control process exited with error code. See "systemctl status amavisd.service" and "journalctl -xe" for details.
    [[email protected] log]# journalctl -xe
    -- L'unité (unit) amavisd.service a échoué, avec le résultat failed.
    juin 19 16:11:36 vps.ovh.net systemd[1]: Unit amavisd.service entered failed state.
    juin 19 16:11:36 vps.ovh.net systemd[1]: amavisd.service failed.
    juin 19 16:11:36 vps.ovh.net systemd[1]: amavisd.service holdoff time over, scheduling restart.
    juin 19 16:11:36 vps.ovh.net systemd[1]: Starting Amavisd-new is an interface between MTA and content checkers....
    -- Subject: L'unité (unit) amavisd.service a commencé à démarrer
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- L'unité (unit) amavisd.service a commencé à démarrer.
    juin 19 16:11:36 vps.ovh.net amavisd[30178]: Error in config file "/etc/amavisd/amavisd.conf": Can't open PEM file /var/lib/amavis/dkim/mydomain1.com.private: Aucun fichier ou dossier de ce type at /usr/sbin/amavisd line 636.
    juin 19 16:11:36 vps.ovh.net systemd[1]: amavisd.service: control process exited, code=exited status=2
    juin 19 16:11:36 vps.ovh.net systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
    -- Subject: L'unité (unit) amavisd.service a échoué
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- L'unité (unit) amavisd.service a échoué, avec le résultat failed.
    juin 19 16:11:36 vps.ovh.net systemd[1]: Unit amavisd.service entered failed state.
    juin 19 16:11:36 vps.ovh.net systemd[1]: amavisd.service failed.
    juin 19 16:11:36 vps.ovh.net systemd[1]: amavisd.service holdoff time over, scheduling restart.
    juin 19 16:11:36 vps.ovh.net systemd[1]: Starting Amavisd-new is an interface between MTA and content checkers....
    -- Subject: L'unité (unit) amavisd.service a commencé à démarrer
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- L'unité (unit) amavisd.service a commencé à démarrer.
    juin 19 16:11:37 vps.ovh.net amavisd[30182]: Error in config file "/etc/amavisd/amavisd.conf": Can't open PEM file /var/lib/amavis/dkim/mydomain1.com.private: Aucun fichier ou dossier de ce type at /usr/sbin/amavisd line 636.
    juin 19 16:11:37 vps.ovh.net systemd[1]: amavisd.service: control process exited, code=exited status=2
    juin 19 16:11:37 vps.ovh.net systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
    -- Subject: L'unité (unit) amavisd.service a échoué
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- L'unité (unit) amavisd.service a échoué, avec le résultat failed.
    juin 19 16:11:37 vps.ovh.net systemd[1]: Unit amavisd.service entered failed state.
    juin 19 16:11:37 vps.ovh.net systemd[1]: amavisd.service failed.
    juin 19 16:11:37 vps.ovh.net systemd[1]: amavisd.service holdoff time over, scheduling restart.
    juin 19 16:11:37 vps.ovh.net systemd[1]: start request repeated too quickly for amavisd.service
    juin 19 16:11:37 vps.ovh.net systemd[1]: Failed to start Amavisd-new is an interface between MTA and content checkers..
    -- Subject: L'unité (unit) amavisd.service a échoué
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- L'unité (unit) amavisd.service a échoué, avec le résultat failed.
    juin 19 16:11:37 vps.ovh.net systemd[1]: Unit amavisd.service entered failed state.
    juin 19 16:11:37 vps.ovh.net systemd[1]: amavisd.service failed.
    
    amavisd.service works again when i comment these 2 lines in /etc/amavisd/amavisd.conf
    Code:
    #dkim_key('mydomain1.com', 'default', '/var/lib/amavis/dkim/mydomain1.com.private');
    #dkim_key('mydomain2.fr', 'default', '/var/lib/amavis/dkim/mydomain2.fr.private');
    
    so i have resolved the problem with this command "chown amavis:amavis /var/lib/amavis/dkim"
    i have checked DKIM in ispconfig and if's working like a charm.
    after 2 days of research, i solve the problem by myself posting on the forum....

    Just one problem remain, i can't send any email from my email client. a port?
     
    Last edited: Jun 19, 2017
  8. c3do

    c3do New Member

    Last problem fixed
    i have edited /etc/postfix/master.cf
    and uncommented these lines
    Code:
    submission inet n       -       n       -       -       smtpd
      -o syslog_name=postfix/submission
      -o smtpd_tls_security_level=encrypt
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_client_restrictions=$mua_client_restrictions
    
    smtps     inet  n       -       n       -       -       smtpd
      -o syslog_name=postfix/smtps
      -o smtpd_tls_wrappermode=yes
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_client_restrictions=$mua_client_restrictions
    
    Then i have restarted postfix with:
    Code:
    systemctl restart postfix
    Et voilà !
     
    Thaddeus likes this.

Share This Page