Discarding duplicate emails send to groups (again)

NethServer Version: 7.2009
Module: nethserver-mail

Greetings. Had this question prior and was given a solution, found here:
https://community.nethserver.org/t/discarding-duplicate-emails-send-to-groups

However this solution seem to no longer work, and actually breaks Dovecot, and as a result, mail from flowing.

I’m not sure if something changed between when it was implemented and now, however when adding the sieve_extensions = +imapflags +editheader +vnd.dovecot.duplicate to /etc/e-smith/templates-custom/etc/dovecot/dovecot.conf/60lmtp and using the signal-event nethserver-mail-server-update command to regenerate the configuration files, I’m met with the following error when viewing the status of Dovecot.

[23:38] [network ~] # service dovecot status
Redirecting to /bin/systemctl status dovecot.service
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/dovecot.service.d
└─limits.conf
Active: failed (Result: exit-code) since Wed 2022-11-09 23:38:08 EST; 4s ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 12867 ExecStart=/usr/sbin/dovecot (code=exited, status=89)
Process: 12864 ExecStartPre=/usr/sbin/portrelease dovecot (code=exited, status=0/SUCCESS)
Process: 12860 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 36421 (code=exited, status=0/SUCCESS)

Nov 09 23:38:08 network systemd[1]: Starting Dovecot IMAP/POP3 email server…
Nov 09 23:38:08 network dovecot[12867]: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 346: Unknown setting: sieve_extensions
Nov 09 23:38:08 network dovecot[12867]: doveconf: Error: managesieve-login: dump-capability process returned 89
Nov 09 23:38:08 network dovecot[12867]: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 346: Unknown setting: sieve_extensions
Nov 09 23:38:08 network systemd[1]: dovecot.service: control process exited, code=exited status=89
Nov 09 23:38:08 network systemd[1]: Failed to start Dovecot IMAP/POP3 email server.
Nov 09 23:38:08 network systemd[1]: Unit dovecot.service entered failed state.
Nov 09 23:38:08 network systemd[1]: dovecot.service failed.

@Andy_Wismer @mrmarkuz @Shane_Treweek, do you have any insight on why suddenly this would stop working after more than a year of functioning perfectly?

** Edit ** Nothing has changed with the previous configuration we came to after the previous post was marked solution. No changes were made to Dovecot, or Postfix. The duplicate plugin just seems to have stopped working.

You seem to still use the custom template /etc/e-smith/templates-custom/etc/dovecot/dovecot.conf/60lmtp but it isn’t needed anymore as explained here:

Just remove it and rerun signal-event nethserver-mail-server-update

Apologies, I mistyped, that doesn’t exist in our configuration. However even with the after.sieve configuration, we’re still receiving duplicates.

It worked fine for about 8 months and then slowly stopped working, despite the configuration not having changed at all.

For giggles, I created 3 groups in nethserver with only myself as a member, then sent an email to it. I received 3 copies in my inbox. Here are the logs from /var/log/maillog.

> Nov 10 15:17:29 network rspamd[4613]: <3e8593>; proxy; rspamd_mime_part_detect_language: detected part language: af
> Nov 10 15:17:29 network rspamd[4613]: <3e8593>; proxy; rspamd_mime_part_detect_language: detected part language: ro
> Nov 10 15:17:29 network rspamd[4613]: <3e8593>; lua; settings.lua:379: <462601d8f541$75d76780$61863680$@domain.com> apply static settings authenticated (id = 1937017268); authenticated matched; priority high
> Nov 10 15:17:29 network rspamd[4613]: <3e8593>; proxy; rspamd_add_passthrough_result: <462601d8f541$75d76780$61863680$@domain.com>: set pre-result to 'no action' (no score): 'Matched map: FROM_SUBDOMAINS_WHITELIST' from multimap(1)
> Nov 10 15:17:29 network rspamd[4613]: <3e8593>; proxy; rspamd_task_write_log: id: <462601d8f541$75d76780$61863680$@domain.com>, qid: <50762324252>, ip: 127.0.0.1, user: brad.trammell@domain.com, from: <brad.trammell@domain.com>, (default: F (no action): [0.00/20.00] [FROM_SUBDOMAINS_WHITELIST(0.00){domain.com;}]), len: 3653, time: 22.473ms, dns req: 0, digest: <592c09dac3c348d43d9ad02ccae09157>, rcpts: <itgroup3@domain.com,itgroup2@domain.com,itgroup1@domain.com>, mime_rcpts: <itgroup3@domain.com,itgroup2@domain.com>, forced: no action "Matched map: FROM_SUBDOMAINS_WHITELIST"; score=nan (set by multimap), settings_id: authenticated
> Nov 10 15:17:29 network rspamd[4613]: <3e8593>; proxy; rspamd_protocol_http_reply: regexp statistics: 0 pcre regexps scanned, 0 regexps matched, 172 regexps total, 0 regexps cached, 0B scanned using pcre, 0B scanned total
> Nov 10 15:17:29 network opendkim[13923]: 50762324252: DKIM-Signature field added (s=default, d=domain.com)
> Nov 10 15:17:29 network postfix/qmgr[14067]: 50762324252: from=<brad.trammell@domain.com>, size=3895, nrcpt=3 (queue active)
> Nov 10 15:17:29 network postfix/smtpd[19677]: disconnect from localhost[127.0.0.1]
> Nov 10 15:17:29 network rspamd[4613]: <66640a>; proxy; proxy_milter_finish_handler: finished milter connection
> Nov 10 15:17:29 network dovecot: lmtp(19316): Connect from local
> Nov 10 15:17:29 network dovecot: lmtp(brad.trammell@domain.com): save: box=INBOX, uid=21100, msgid=<462601d8f541$75d76780$61863680$@domain.com>, from="Brad J. Trammell" <brad.trammell@domain.com>, subject=Test 3, flags=()
> Nov 10 15:17:29 network dovecot: lmtp(brad.trammell@domain.com): msgid=<462601d8f541$75d76780$61863680$@domain.com>: saved mail to INBOX
> Nov 10 15:17:29 network postfix/lmtp[19315]: 50762324252: to=<brad.trammell@domain.com>, orig_to=<itgroup3@domain.com>, relay=network.domain.com[/var/run/dovecot/lmtp], delay=0.24, delays=0.23/0/0/0.01, dsn=2.0.0, status=sent (250 2.0.0 <brad.trammell@domain.com> YHyCHllcbWN0SwAAcGdNhg Saved)
> Nov 10 15:17:29 network dovecot: lmtp(brad.trammell@domain.com): save: box=INBOX, uid=21101, msgid=<462601d8f541$75d76780$61863680$@domain.com>, from="Brad J. Trammell" <brad.trammell@domain.com>, subject=Test 3, flags=()
> Nov 10 15:17:29 network dovecot: lmtp(brad.trammell@domain.com): msgid=<462601d8f541$75d76780$61863680$@domain.com>: saved mail to INBOX
> Nov 10 15:17:29 network postfix/lmtp[19315]: 50762324252: to=<brad.trammell@domain.com>, orig_to=<itgroup2@domain.com>, relay=network.domain.com[/var/run/dovecot/lmtp], delay=0.25, delays=0.23/0/0/0.02, dsn=2.0.0, status=sent (250 2.0.0 <brad.trammell@domain.com> YHyCHllcbWN0SwAAcGdNhg:2 Saved)
> Nov 10 15:17:29 network dovecot: lmtp(brad.trammell@domain.com): save: box=INBOX, uid=21102, msgid=<462601d8f541$75d76780$61863680$@domain.com>, from="Brad J. Trammell" <brad.trammell@domain.com>, subject=Test 3, flags=()
> Nov 10 15:17:29 network dovecot: lmtp(brad.trammell@domain.com): msgid=<462601d8f541$75d76780$61863680$@domain.com>: saved mail to INBOX
> Nov 10 15:17:29 network postfix/lmtp[19315]: 50762324252: to=<brad.trammell@domain.com>, orig_to=<itgroup1@domain.com>, relay=network.domain.com[/var/run/dovecot/lmtp], delay=0.26, delays=0.23/0/0/0.03, dsn=2.0.0, status=sent (250 2.0.0 <brad.trammell@domain.com> YHyCHllcbWN0SwAAcGdNhg:3 Saved)
> Nov 10 15:17:29 network dovecot: lmtp(19316): Disconnect from local: Successful quit
> Nov 10 15:17:29 network postfix/qmgr[14067]: 50762324252: removed
> Nov 10 15:17:36 network rspamd[4614]: <4rcy9k>; lua; bayes_expiry.lua:440: finished expiry step 9: 988 items checked, 73 significant (0 made persistent), 3 insignificant (0 ttls set), 14 common (0 discriminated), 898 infrequent (0 ttls set), 5 mean, 19 std

For some reason, that rule doesn’t appear to be applying anymore, and for the life of me, I can’t see why it would not be, as absolutely nothing has changed in terms of Postfix/Dovecot configurations.

Is dovecot working now or do you still get these errors?

Did you already try to use the custom template and just add +duplicate instead of +vnd.dovecot.duplicate ?

1 Like

Forgive my ignorance, where are you suggesting I add that? When adding it to the 60lmtp file it produces an error (as stated originally), since that’s not the accepted solution anymore, where should I add it?

I guess this issue can be closed, and marked resolved. I appear to have resolved this issue. For some reason +duplicate was removed from the sieve_extensions parameter in the template itself located in /etc/e-smith/templates/etc/dovecot/dovecot.conf/60lmtp.

After adding it manually, and then running signal-event nethserver-mail-server-update, I am no longer receiving duplicate emails. Strange how that got removed. Is there a function or update that will cause the templates to be overwritten like that?

1 Like