1

Topic: DKIM Annoyances with iRedMail EE

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello Huangbin!

Thank you for the offer to upgrade to iRedMail Enterprise Edition, I have been able to successfully deploy EE with very minor issues, migrating from iRedMail Pro. I followed all the wonderful tutorials as well.

When installing the AntiSpam and AntiVirus component, I seem to run into errors. I followed the instructions relating to the Amavis migration but see to have the following issues. Any ideas? Seems it is getting hung up over a semantic but the error log isnt very descriptive.

~~~~ DUMP OF OUTPUT LOG WHEN INSTALLING ~~~~
TASK [common] Get version of deployed iRedMail Enterprise Edition.

changed [53.338µs]

Deployed version: 2025031101

Running version: 2025031101


TASK [postfix] Stop and disable conflict MTA services.

failed: exim

[ERROR] task error: failed in starting service exim: exit status 5, Failed to stop exim.service: Unit exim.service not loaded.

...ignore error

failed: exim4

[ERROR] task error: failed in starting service exim4: exit status 5, Failed to stop exim4.service: Unit exim4.service not loaded.

...ignore error

failed: sendmail

[ERROR] task error: failed in starting service sendmail: exit status 5, Failed to stop sendmail.service: Unit sendmail.service not loaded.

...ignore error

failed: smtpd

[ERROR] task error: failed in starting service smtpd: exit status 5, Failed to stop smtpd.service: Unit smtpd.service not loaded.

...ignore error


TASK [postfix] Install Postfix packages.

ok: postfix postfix-pcre libsasl2-modules [60.051808ms]

ok: postfix-mysql [17.293809ms]


TASK [postfix] Enable Postfix service.

changed: postfix [746.609825ms]


TASK [postfix] Create symbol link to main.cf: /etc/postfix/main.cf.iredmail -> /etc/postfix/main.cf.

changed: /etc/postfix/main.cf [741.842µs]


TASK [postfix] Run shell script for advanced customizations: /opt/iredmail/custom/postfix/custom.sh.

changed [5.69791ms]


TASK [antispam] Install Amavisd + SpamAssassin + ClamAV packages.

ok: amavisd-new libcrypt-openssl-rsa-perl libmail-dkim-perl altermime arj nomarch cpio liblz4-tool lzop cabextract p7zip-full rpm libmail-spf-perl unrar-free pax libdbd-mysql-perl spamassassin clamav-freshclam clamav-daemon [353.250246ms]


TASK [antispam] Amavisd: Enable service.

changed: amavis [757.109553ms]


TASK [antispam] SQL: Create database: amavisd.

changed [5.37567ms]


TASK [antispam] SQL: Create and grant permissions to user 'amavisd'.

changed [47.868288ms]


TASK [antispam] Generate ~/.my.cnf-amavisd.

ok: /root/.my.cnf-amavisd [163.83µs]


TASK [antispam] [SQL] Generate file on disk from embedded file: amavisd/amavisd.mysql.

changed: /tmp/upload.sql [3.331109ms]


TASK [antispam] [SQL] Import file (MariaDB).

changed [112.376232ms]


TASK [antispam] [SQL] Remove uploaded file.

changed: /tmp/upload.sql [231.213µs]


TASK [antispam] [SQL] Generate file on disk from embedded file: amavisd/default_spam_policy.sql.

changed: /tmp/upload.sql [2.943633ms]


TASK [antispam] [SQL] Import file (MariaDB).

changed [20.117395ms]


TASK [antispam] [SQL] Remove uploaded file.

changed: /tmp/upload.sql [116.975µs]


TASK [antispam] [SQL] Generate file on disk from embedded file: amavisd/extend_msgs.mysql.

changed: /tmp/upload.sql [1.34095ms]


TASK [antispam] [SQL] Import file (MariaDB).

changed [311.337258ms]


TASK [antispam] [SQL] Remove uploaded file.

changed: /tmp/upload.sql [214.014µs]


TASK [antispam] Amavisd: Generate directories required by Amavisd.

ok: /var/spool/amavisd [64.54µs]

ok: /var/spool/amavisd/tmp [46.509µs]

ok: /var/spool/amavisd/quarantine [44.849µs]

ok: /var/spool/amavisd/db [181.78µs]

ok: /var/spool/amavisd/var [45.208µs]


TASK [antispam] Amavisd: Generate main config file: /etc/amavis/conf.d/50-user.

ok: /etc/amavis/conf.d/50-user [7.41758ms]


TASK [antispam] Amavisd: Create directory used to store custom config files.

ok: /opt/iredmail/custom/amavisd [42.445µs]

ok: /opt/iredmail/custom/amavisd [32.302µs]


TASK [antispam] Amavisd: Make sure custom config file exist with correct owner and permission: /opt/iredmail/custom/amavisd/amavisd.conf.

ok: /opt/iredmail/custom/amavisd/amavisd.conf [36.523µs]


TASK [antispam] Amavisd: Generate /opt/iredmail/custom/amavisd/README.

ok: /opt/iredmail/custom/amavisd/README [691.928µs]


TASK [antispam] Amavisd: Generate directory used to store DKIM keys: /opt/iredmail/custom/amavisd/dkim

ok: /opt/iredmail/custom/amavisd/dkim [57.75µs]


TASK [antispam] Amavisd: Detect old DKIM key: /var/lib/dkim/encryp.email.pem

changed [59.564µs]


TASK [antispam] Amavisd: Detect new DKIM key: /opt/iredmail/custom/amavisd/dkim/encryp.email.pem

changed [49.962µs]


TASK [antispam] Amavisd: Find all DKIM keys.

changed [8.084245ms]

[ERROR] assembleTask utils.RenderArgValues err yaml: line 13: did not find expected '-' indicator

[ERROR] task:

file:

group: '{{ sys_group_amavisd }}'

mode: "0400"

owner: '{{ sys_user_amavisd }}'

path: '{{ item }}'

loop:

- '{{ _pem_files.StdoutLines }}'

name: 'Amavisd: Set owner and permission for all DKIM keys.'

notify:

- restart amavisd

when: (_pem_files.StdoutLines |length) > 0

parse task error: yaml: line 13: did not find expected '-' indicator

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: DKIM Annoyances with iRedMail EE

Some screenshots of the environment, ideas?

Post's attachments

Screenshot 2025-03-13 at 15-38-45 Components.png 14.95 kb, 2 downloads since 2025-03-13 

Screenshot 2025-03-13 at 15-40-44 Components.png 154.42 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

3

Re: DKIM Annoyances with iRedMail EE

Do you have any files under directory "/opt/iredmail/custom/amavisd/dkim/"?

4 (edited by subarticThrone 2025-03-14 18:09:30)

Re: DKIM Annoyances with iRedMail EE

yes I do, about 890 keys for domains under the dkim directory specified. Note, I did follow the tutorials and treating the EE install as a migration...impressively minor issues so that is a plus.

what I know I am missing is the white and black lists, including the quarantine. I got DKIM working later last evening after some trial an error.

The log i posted, seems to suggest an ansible error when I attempt to Enable and deploy the "Antivirus/Antispam" component.

I am game for going to fix it, just want to know where the right yaml files would be, it seems this may be a "-" indentation issue and the playbook is not happy smile

One issue down, so lets figure out how to get antivirus/antispam component going because I cannot get it installed due that error. I assume whitelisting and blacklisting, along with spam scores fall within that package/component. Greylisting works just fine.

5

Re: DKIM Annoyances with iRedMail EE

subarticThrone wrote:

yes I do, about 890 keys for domains under the dkim directory specified.

We didn't expect so many keys in this file, not sure whether this is the cause.
Will test it shortly.

6 (edited by subarticThrone 2025-03-14 22:50:23)

Re: DKIM Annoyances with iRedMail EE

ZhangHuangbin wrote:
subarticThrone wrote:

yes I do, about 890 keys for domains under the dkim directory specified.

We didn't expect so many keys in this file, not sure whether this is the cause.
Will test it shortly.

This volume of domains and DKIMs worked on iRedMail Pro, I even dropped it down to five domains just for fun and an empty directory, still same issue. I think iRedMail is very well built for scalability. This might just be a minor deployment bug with the Component installer for Antivirus/Antispam. Everything else works 100%, just not this specific part, we can send/receive mails and attain a valid DKIM.

7

Re: DKIM Annoyances with iRedMail EE

I can reproduce this issue locally. Stay tuned.

8

Re: DKIM Annoyances with iRedMail EE

It works with just few DKIM keys, but when there're a lot keys, it failed. Still working on it.

9

Re: DKIM Annoyances with iRedMail EE

ZhangHuangbin wrote:

It works with just few DKIM keys, but when there're a lot keys, it failed. Still working on it.

Great you can reproduce the error, thank you for investigating, I look forward to possible fixes.

10

Re: DKIM Annoyances with iRedMail EE

Huangbin, any updates?

11

Re: DKIM Annoyances with iRedMail EE

Hi,

This issue has been fixed yesterday, i will built a patched version for you.
New EE release will be out soon.

12

Re: DKIM Annoyances with iRedMail EE

Here's the patched version, please download[1] and upgrade[2].

[1] https://dl.iredmail.org/ee/iredmail-ent … inux-amd64
[2] https://docs.iredmail.org/upgrade.ee.html

13

Re: DKIM Annoyances with iRedMail EE

HuangBin, thank you so much for your fast turn around and support - that worked wonderfully!!!

14

Re: DKIM Annoyances with iRedMail EE

subarticThrone wrote:

HuangBin, thank you so much for your fast turn around and support - that worked wonderfully!!!

Post's attachments

Screenshot 2025-03-18 at 07-45-41 Whitelists and Blacklists.png
Screenshot 2025-03-18 at 07-45-41 Whitelists and Blacklists.png 85.65 kb, 1 downloads since 2025-03-18 

You don't have the permssions to download the attachments of this post.

15

Re: DKIM Annoyances with iRedMail EE

subarticThrone wrote:

that worked wonderfully!!!

Thanks for the feedback. smile