1

Topic: Prevent duplicates from being sent if recipient is both in the mailing

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.8
- Deployed with iRedMail Easy or the downloadable installer? Yes.
- Linux/BSD distribution name and version: Ubuntu 22.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
When sending an email to someone, and they are both in the mailing list and in the To: or Cc: headers, Sympa does not send them the list email, after checking the To: and Cc: headers.
Mailing list is list@example.com, mail sent from alice@example.com to both -> bob@example.com and list@example.com.
Bob is a part of list@example.com, therefore he receives emails from distribution lists and personal emails.

----

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

2

Re: Prevent duplicates from being sent if recipient is both in the mailing

That definitely doesn't happen here. I've tested a message from account A to account B and list L (which includes B). In the postfix log, I see the message being processed by amavis separately for each user in list L, but user B is only listed once.

I wonder what the difference between our setups is? For one thing, we use MariaDB rather than LDAP.

PS: "Deployed with iRedMail Easy or the downloadable installer? Yes." Lol -- you're supposed to answer one or the other!

3

Re: Prevent duplicates from being sent if recipient is both in the mailing

Hello,

I wonder what the difference between our setups is? For one thing, we use MariaDB rather than LDAP. <- i am using LDAP for user management.

Deployed with iRedMail Easy or the downloadable installer. <-  the downloadable installer.

If User B belongs to the list list@example.com, then when User A sends a message to list@example.com, at the same time CC sends it separately to User B. This will cause User B to receive 2 duplicate messages repeat sad

Thanks,

4

Re: Prevent duplicates from being sent if recipient is both in the mailing

Try this: In /etc/postfix/master.cf, find transport "127.0.0.1:10028" like below:

127.0.0.1:10028 inet n  -   n   -   -  smtpd
    ...
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

Append "no_address_mappings" to "-o receive_override_options":

127.0.0.1:10028 inet n  -   n   -   -  smtpd
    ...
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks, no_address_mappings

Then restart postfix and send testing email to reproduce the issue.

5

Re: Prevent duplicates from being sent if recipient is both in the mailing

Hello,

I tried it but it still doesn't work.

A transaction that you can refer to according to the log below. When user longhm@preview-pro.mcloud.vn sent to list-a@preview-pro.mcloud.vn and cc for demo@preview-pro.mcloud.vn. demo is a part of list-a@preview-pro.mcloud.vn, demo@ address received two messages

 Jul  3 15:22:15 Server amavis[3696234]: (3696234-07) Passed CLEAN {RelayedInternal}, ORIGINATING/MYNETS LOCAL [127.0.0.1]:38936 ESMTP/ESMTP <longhm@example.com> -> <demo@example.com>, (), Queue-ID: 4WDXnb6kwjz74VV, Message-ID: <77f097184980b42ba593faac3c508841@example.com>, mail_id: WxHSOBmOjlkz, b: CTqM4hr-o, Hits: -0.998, size: 1161, queued_as: 4WDXng0SCwz74VX, Subject: "Thử nghiệm (raw: =?UTF-8?Q?Th=E1=BB=AD_nghi=E1=BB=87m?=)", From: <longhm@example.com>, User-Agent: MatBao_Webmail1.6.5, helo=localhost, Tests: [ALL_TRUSTED=-1,HTML_MESSAGE=0.001,TVD_SPACE_RATIO=0.001], autolearn=unavailable autolearn_force=no, autolearnscore=0.002, dkim_new=dkim:email.example.com, 2217 ms
Jul  3 15:22:15 Server postfix/amavis/smtp[3697689]: 4WDXnb6kwjz74VV: to=<demo@preview-pro.mcloud.vn>, relay=127.0.0.1[127.0.0.1]:10026, delay=3.3, delays=1/0/0/2.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 4WDXng0SCwz74VX)
Jul  3 15:22:15 Server postfix/pipe[3697497]: 4WDXng0SCwz74VX: to=<demo@example.com>, relay=dovecot, delay=0.14, delays=0.01/0.01/0/0.13, dsn=2.0.0, status=sent (delivered via dovecot service)
Jul  3 15:22:15 Server amavis[3697836]: (3697836-02) Passed CLEAN {RelayedInternal}, MLMMJ LOCAL [127.0.0.1] /ESMTP <list-a+bounces-1-demo=example.com@example.com> -> <demo@example.com>, (), Message-ID: <77f097184980b42ba593faac3c508841@example.com>, mail_id: AGMUZDv1wWP6, b: Kr1U2KnXE, Hits: -, size: 2710, queued_as: 4WDXng243Tz74VV, Subject: "Thử nghiệm (raw: =?UTF-8?Q?Th=E1=BB=AD_nghi=E1=BB=87m?=)", From: <longhm@example.com>, User-Agent: Server_Webmail1.6.5, helo=, dkim_new=dkim:email.example.com, 202 ms
Jul  3 15:22:15 Server postfix/pipe[3697740]: 4WDXng243Tz74VV: to=<demo@example.com>, relay=dovecot, delay=0.19, delays=0.01/0.01/0/0.18, dsn=2.0.0, status=sent (delivered via dovecot service) 

6

Re: Prevent duplicates from being sent if recipient is both in the mailing

Okay, I guess I misunderstood. You seem to be using true mailing lists whereas my test example above was about "simple" mailing lists (using an alias routing to multiple users -- see https://docs.iredmail.org/sql.create.mail.alias.html).

We use this method for virtually all internal working groups, and it works great. See also https://forum.iredmail.org/topic17412-c … lists.html for clarification.

So please ignore my earlier post saying it works here, as what works here is something different.

7

Re: Prevent duplicates from being sent if recipient is both in the mailing

Hello,

That's right, your problem doesn't seem like what I described. Sending to a list and another user who is on this list leads to that person receiving 2 messages at the same time, which is causing difficulties for me.

Looking forward to a good solution to fix it sad

Thanks,

8

Re: Prevent duplicates from being sent if recipient is both in the mailing

That is how a carbon copy works, i don't see a problem here, it is working as intended