Setup DKIM in ISPC with Postfix

Discussion in 'ISPConfig 3 Priority Support' started by MaxT, Jul 28, 2017.

  1. MaxT

    MaxT Active Member HowtoForge Supporter

    I have activated dkim in ISPC, and the keys are already present inside the dns zones.
    However, the dkim keys are not present in the headers when sending messages.

    I cannot find a tutorial (only for CentoS). Please, Do you know if there some guide to configure this properly?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no additional configuration required beside the perfect server tutorial. Did you choose 'reconfigure services = yes" at the time you updated from ISPconfig 3.0.x to 3.1?
     
  3. MaxT

    MaxT Active Member HowtoForge Supporter

    yes, I have reconfigured services.

    Is there some requeriment, port or executable to configure or to check?

    ps: I see that I have not any /etc/opendkim.conf
    I'm reading this guide for wheezy and I wonder if maybe I have not dkim installed:
    https://www.digitalocean.com/commun...-configure-dkim-with-postfix-on-debian-wheezy

    I don't find any opendkim and opendkim-tools with a #locate...

    I wonder if the problem is that in my initial guide installation, there is no mention to install dkim:
    https://www.howtoforge.com/perfect-...ix-dovecot-mysql-phpmyadmin-rkhunter-binutils

    ...and maybe I have updaded the server to Jessie with this absence. I don't know really although it's sure that I dont' have opendkim installed.
     
    Last edited: Jul 30, 2017
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    opendkim is not used in ISPConfig setups, that's why you don't find it. Dkim signing is done by amavisd and as you can see in the perfect server guide, amavis get's installed.

    Maybe @florian030 is able to help you with that, he maintains the Dkim functions.
     
  5. MaxT

    MaxT Active Member HowtoForge Supporter

    oh... I didn't know this. Then the problem is that I have the amavis disabled.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, this explains the issue :) Without amavis, there is no DKIM.
     
  7. MaxT

    MaxT Active Member HowtoForge Supporter

    I believe I had some scripts modified from time ago to stop amavis, and I cannot remember well

    Code:
    # apt-get install amavisd-new
    Creating/updating amavis user account...
    insserv: Service amavisd-new has to be enabled to start service amavis-snmp-subagent
    insserv: exiting now!
    update-rc.d: error: insserv rejected the script header
    dpkg: error ... amavisd-new (--configure):
    subprocessiscript post-installation retunr exit code  error 1
    errors processing:
    amavisd-new
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    I believe some modified scripts exists and the reinstall is not success
    Is there some way for a quick reinstall of amavis?.
    Can I delete the scrpts /etc/init.d/amavis-mc and /etc/init.d/amavisd-snmp-subagent before trying a reinstall?

    thanks!
     
    Last edited: Jul 31, 2017
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Try e.g.:

    apt-get install --reinstall amavisd-new
     
    MaxT likes this.
  9. MaxT

    MaxT Active Member HowtoForge Supporter

    thank you. It is installed and I can see amavisd-new with #netstat -atpn
    However, the service is not configured for reboot. It is my fault because I have disabled this in the past using sysv-rc-conf :
    Code:
     service      1       2       3       4       5       0       6       S                                                                                                                                                         │
    │ ----------------------------------------------------------------------------                                                                                                                                                   │
    │ acpid       [ ]     [X]     [X]     [X]     [X]     [ ]     [ ]     [ ]                                                                                                                                                        │
    │ amavis-mc   [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]                                                                                                                                                        │
    │ amavisd-s$  [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]     [ ]
    Should I mark the levels 2,3,4,5 or still more?. Sorry, I cannot find info on this.

    I think this is my last question. For the rest inside postfix I think I'm able to reconfigure amavis sections.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess these levels should be fine.
     
  11. MaxT

    MaxT Active Member HowtoForge Supporter

    so at the end I'm not able to solve this... :(

    I'm receiving an error in mail.log:
    "status=deferred (mail transport unavailable)". And no message is sent can be received.

    I have inside /etc/postfix/main.cf:
    Code:
     content_filter = amavis:[127.0.0.1]:10024
    
    I have in /etc/postfix/master.cf:
    Code:
     127.0.0.1:10025 inet n - n - - smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_client_restrictions=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks=127.0.0.0/8
      -o strict_rfc821_envelopes=yes
      -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
      -o smtp_send_xforward_command=yes
    
    127.0.0.1:10027 inet n - n - - smtpd
      -o content_filter=
      -o local_recipient_maps=
      -o relay_recipient_maps=
      -o smtpd_restriction_classes=
      -o smtpd_client_restrictions=
      -o smtpd_helo_restrictions=
      -o smtpd_sender_restrictions=
      -o smtpd_recipient_restrictions=permit_mynetworks,reject
      -o mynetworks=127.0.0.0/8
      -o strict_rfc821_envelopes=yes
      -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
      -o smtp_send_xforward_command=yes
      -o milter_default_action=accept
      -o milter_macro_daemon_name=ORIGINATING
    
    
    #amavis unix - - - - 2 smtp
    #  -o smtp_data_done_timeout=1200
    #          -o smtp_send_xforward_command=yes
    
    and doing # netstat I can see:
    Code:
    tcp  0  0 127.0.0.1:10024  0.0.0.0:*  LISTEN  8110/amavisd-new (m
    tcp  0  0 127.0.0.1:10026  0.0.0.0:*  LISTEN  8110/amavisd-new (m
    
    Is this not right?
     
  12. MaxT

    MaxT Active Member HowtoForge Supporter

    sorry, these lines should be uncommented and messages can be sent and received
    Code:
    #amavis unix - - - - 2 smtp
    # -o smtp_data_done_timeout=1200
    # -o smtp_send_xforward_command=yes
    
    although still the Dkim is not working. I will ask to @florian030

    thanks!
     
  13. MaxT

    MaxT Active Member HowtoForge Supporter

    till likes this.

Share This Page