sympa-community / sympa

Sympa, Mailing List Management Software
https://www.sympa.community/sympa
GNU General Public License v2.0
237 stars 94 forks source link

Prevent duplicates from being sent if recipient is both in the mailing list and in the To: or Cc: headers #1758

Open tomsonas1337 opened 7 months ago

tomsonas1337 commented 7 months ago

Expected Behavior

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 does not get the list email, only the personal one.

Current Behavior

When sending an email to someone, and they are both in the list and in the To: or Cc: headers, they receive duplicate emails, one meant for them personally, and one for the list. 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 gets the email meant for the list and for him.

Possible Solution

Possibly checking in Sympa::Spindle::DoMessage, whether the person in a list is also in the To: or Cc: headers, and then excluding them from the mail delivery (not the other list members)

Context

This is one of those cases that is not a critical error, but is expected behavior from a mailing list manager system. (Mailman already does this)

ikedas commented 7 months ago

Hi @tomsonas1337 , What is the MTA you are using with Sympa?

tomsonas1337 commented 7 months ago

Hi @tomsonas1337 , What is the MTA you are using with Sympa?

Hello, I am using Postfix and a slightly older version of Sympa (6.2.70, from Debian packages) Also I noticed that someone has mentioned this issue way back in the day: https://listes.renater.fr/sympa/arc/sympa-users/2009-10/msg00036.html

ikedas commented 7 months ago

Postfix cannot merge message deliveries both directly sent to recipient and forwarded through another applications such as mailing lists. Most of all MTA cannot do such a job.

tomsonas1337 commented 7 months ago

It's not merging that's the intended outcome. The expected behaviour would be Sympa checking the To: or Cc: headers of the mail and checking whether one of the addresses in said headers is in the list(-s), and does not distribute the mail to him (he would still get a personal email, since Sympa has no control over that, but not the one distributed by the list(-s)) The rest of the mailing list would get the email, but not the person in the To: or Cc: headers.