add new multiple domains to sign dkim

Posted September 11, 2014 6.5k views
  • iRedMail version: 0.8.7
  • Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
  • Linux/BSD distribution name and version: Ubuntu 14.04

Hello guys I have got my iredmail up and running. The only thing is when I get to send emails they go to spam in gmail and don’t arrive at all in hotmail or outlook.

After testing it says that the dkim is not signed. How can I solve this? I have more than 1 virtual domain.

I tried to generate a new RSA key for my second domain. But in /etc/amavis/
there is no amavisd.conf or anything like that.. But there is the following:

/etc/amavis/conf.d# ls
01-debian 15-contentfiltermode 30-templatelocalization
id 20-debiandefaults 40-policybanks
05-nodeid 21-ubuntudefaults 50-user
15-avscanners 25-amavishelpers 50-user.2014.

Can someone guide me through this to add the next domain?


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

I am not familiar with iredmail but the config file you edit is the 50-user. has a good info on amavisd and dkim signing.

  • Thanks it is was very useful the new domain gets a bad RSA signature though causing it to fail.

    Could it be possible that the DNS needs time to update?

  • Yes it can take some time to update. Double check the txt record with you config. Then check it again.

    You can see what amavis uses by
    amavisd-new showkeys

    Just run
    amavisd-new testkeys

    To check things out.

  • Ok so I have added the new key like so

    dkimkey(“”, “dkim”, “/var/lib/dkim/”);
    key(“”, “dkim”, “/var/lib/dkim/”); in the config file.

    I double checked the dkim keys so I have to wait now until it accepts the RSA signature and thats it? and what about the headers are those correct? ( see other post )

  • edit

    All the tests passed and I reloaded amavisd but it still says that the mails are not signed with DKIM..

  • Since I am not familiar with iredmail not sure I can be much more help. Not sure how it setups config files.

    You can try comparing your setup with

    Just make sure you backup your current config in case you break something. Or better yet snapshot the server and bring snapshot up as test server. I can give you examples of my setup config files if needed. They are close to whats in the link above.

See below I have changed some confidential stuff :) the mail is sent to a gmail account since the hotmail and outlook accounts don’t receive mail at all. The mail is send with Laravel so I guess those should be fine..

Received: by with SMTP id dv1csp550274lbc;
Thu, 11 Sep 2014 00:00:40 -0700 (PDT)
X-Received: by with SMTP id fq12mr15922wic.4.1410418840431;
Thu, 11 Sep 2014 00:00:40 -0700 (PDT)
Received: from ( [])
by with ESMTPS id yw4si15174wjc.94.2014.
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 11 Sep 2014 00:00:40 -0700 (PDT)
Received-SPF: pass ( domain of designates as permitted sender);
spf=pass ( domain of designates as permitted sender)
Received: by (Postfix, from userid 33)
id 9A72F20A2F; Thu, 11 Sep 2014 03:00:39 -0400 (EDT)
To: User Name
Subject: Subscription
X-PHP-Originating-Script: 0:SimpleMailInvoker.php
Date: Thu, 11 Sep 2014 07:00:39 +0000
From: Tcr
Cc: User Name
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Thanks in advance

And see my email test