[FIXED] Domain marked as spam because DKIM is not working properly.

Discussion in 'Installation/Configuration' started by Daniel Gil, Jul 29, 2020.

  1. Daniel Gil

    Daniel Gil New Member

    Hi to all.
    I have a ISPConfig 3.1.15p3 over a debian 9.13 with apache and amavis. All outgoing emails are marked as spam because emails are not signed properly with DKIM.
    I generated the DKIM keys in the web panel and made a TXT entry in the DNS server with the generated key in the panel.
    But when in the shell I launch amavisd-new showkeys I get this message : No DKIM private keys declared in a config file.
    So I don't know what i am doing wrong.
    Any ideas of what to do or where I can start to solve this?

    Thanks in advance.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I have set up e-mail following the e-mail tutorial linked to in my signature. Are you doing something differently?
     
    Daniel Gil likes this.
  3. Jesse Norell

    Jesse Norell Well-Known Member

    Is /etc/amavis/conf.d/60-dkim being generated, with a key for each domain, and the corresponding key files are being created?

    Refer to the pinned 'read before posting' post for how to debug what the server is doing, which should include the clues to track down what's going on. (enable debug mode, create a new mail domain with dkim or something and post the debug output here if it's not obvious what to do from it)
     
  4. Daniel Gil

    Daniel Gil New Member

    Hello Taleman, thanks for your answer.
    Yes, I have continued the same steps as you. But thanks to the page mail-tester.com I have discovered that had the record SPF bad written and have corrected it.
     
  5. Daniel Gil

    Daniel Gil New Member

    Hello Jesse, thanks for your answer.
    No, the /etc/amavis/conf.d/60-dkim is not generated. Do you know how can i generate it?
    I generated the DKIM in the webpanel.
     

    Attached Files:

  6. Th0m

    Th0m Active Member HowtoForge Supporter

    Can you go through the debug steps as Jesse noted?
     
  7. Jesse Norell

    Jesse Norell Well-Known Member

    And one additional thing to check is that you have the `mail_plugin_dkim.inc.php` server plugin enabled (symlink exists in /usr/local/ispconfig/server/plugins-enabled/ to the file in plugins-available).
     
  8. Daniel Gil

    Daniel Gil New Member

    Hi, here is the debug output:


    30.07.2020-18:40 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    30.07.2020-18:41 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    30.07.2020-18:41 - DEBUG - Found 2 changes, starting update process.
    30.07.2020-18:41 - DEBUG - Calling function 'user_settings_update' from plugin 'rspamd_plugin' raised by event 'spamfilter_users_insert'.
    30.07.2020-18:41 - DEBUG - Processed datalog_id 1338
    30.07.2020-18:41 - DEBUG - Calling function 'domain_dkim_insert' from plugin 'mail_plugin_dkim' raised by event 'mail_domain_insert'.
    30.07.2020-18:41 - DEBUG - Saved DKIM Private-key to /var/lib/amavis/dkim/debuggingmode.net.private
    30.07.2020-18:41 - DEBUG - safe_exec cmd: cat '/var/lib/amavis/dkim/debuggingmode.net.private'|openssl rsa -pubout 2> /dev/null - return code: 0
    30.07.2020-18:41 - DEBUG - Saved DKIM Public to debuggingmode.net.
    30.07.2020-18:41 - DEBUG - Processed datalog_id 1339
    30.07.2020-18:41 - DEBUG - Calling function 'restartRspamd' from module 'mail_module'.
    30.07.2020-18:41 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    30.07.2020-18:42 - DEBUG - Calling function 'check_phpini_changes' from plugin 'webserver_plugin' raised by action 'server_plugins_loaded'.
    30.07.2020-18:42 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
     
  9. Th0m

    Th0m Active Member HowtoForge Supporter

    You told us you were using amavis, but it seems like you use rspamd. Which one do you want to use?
     
  10. Jesse Norell

    Jesse Norell Well-Known Member

    That's good, that's the plugin which needs to be running.
    Sounds like you have your domain set to Rspamd, not Amavis.
     
  11. Daniel Gil

    Daniel Gil New Member


    Oops! Sorry, my mistake. I continued the steps of this manual
    https://www.howtoforge.com/replacing-amavisd-with-rspamd-in-ispconfig/
    A few months ago i had a lot of problems because i received tons of spam emails. When i changed to Rspamd the received spam diminished significantly so Rspamd is better.
     
    Last edited: Jul 30, 2020
  12. Jesse Norell

    Jesse Norell Well-Known Member

    So if you're using Rspamd, this is not a problem:
    And your issue is simply your outgoing emails are not signed. Before trying to dig into what is/isn't configured, try going to Server Config and change the content filter back to Amavis, then save, then change to Rspamd and save again; then go to Tools > Resync and resync Maildomains and DNS Records. See if that fixes things.
     
    ahrasis and Daniel Gil like this.
  13. Daniel Gil

    Daniel Gil New Member

    :O :O :O
    I don't know how, I don't know why but after two attempts it works!!
    Thank you very very much.
    :)
     
  14. Jesse Norell

    Jesse Norell Well-Known Member

    I've seen some instances of similar bad config with the amavis/rspamd changes, I wouldn't worry much about it in 3.1.15p3 as there are a lot of things changed in the upcoming 3.2 release. I'd be quite interested in those cases after that point (or in current git-stable release) if anyone has any you want to dig in to.
     
    Th0m, ahrasis and Daniel Gil like this.
  15. Th0m

    Th0m Active Member HowtoForge Supporter

    Kind of off topic, but rspamd it not necessarily better, with a good configuration of amavis, it does quite a good job ;)
     

Share This Page