Bug 260700 - mail/milter-greylist: handle mlmmj sender addresses correctly
Summary: mail/milter-greylist: handle mlmmj sender addresses correctly
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
Keywords: needs-qa
Depends on:
Reported: 2021-12-26 15:22 UTC by Helge Oldach
Modified: 2022-07-26 07:03 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (m.tsatsenko)
koobs: merge-quarterly?

Remove '+' and suffix from local part (910 bytes, patch)
2021-12-26 15:22 UTC, Helge Oldach
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Oldach 2021-12-26 15:22:51 UTC
Created attachment 230423 [details]
Remove '+' and suffix from local part

Currently, milter-greylist unconditionally strips sender addresses up to and including the first '=' before checking against the database. This is done to ensure mailing list sender addresses are handled correctly.

However mlmmj generates mailing list sender addresses in a different style: the common '+' format. That yields a basically wrong mungling of sender addresses:

Dec 26 06:34:34 nuc milter-greylist[56938]: 1BQ5YQ5a068146: addr from <oldach.net@FreeBSD.org> rcpt <freebsd@oldach.net>: autowhitelisted for another 8760:00:00
Dec 26 06:34:34 nuc sm-mta[68146]: 1BQ5YQ5a068146: from=<freebsd-stable+bounces-424-freebsd=oldach.net@FreeBSD.org>, size=6340, class=0, nrcpts=1, msgid=<80df9457-886a-d5ad-23c4-98d54c4b4dcb@world.com>, bodytype=8BITMIME, proto=ESMTPS, daemon=MTA, relay=mx2.freebsd.org []

Here, <freebsd-stable+bounces-424-freebsd=oldach.net@FreeBSD.org> is cut down to just <oldach.net@FreeBSD.org> (which is OK in my case as I'm the owner of oldach.net). Actually that should better be stripped by removing the '+' part from the local part, yielding <freebsd-stable@FreeBSD.org>.

The attached patch facilitates that (but keeps the '=' logic in place).

NB: Probably a more general sender rewriting should be implemented, e.g. by using regex replacement.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-12-26 23:02:29 UTC
Is this something that should be sent upstream as a bugfix?
Comment 2 Helge Oldach 2021-12-27 09:17:23 UTC
(In reply to Kubilay Kocak from comment #1)
Actually I had discussed with Emmanuel Dreyfus <manu@netbsd.org> by email and suggested to include this patch.
Comment 3 m.tsatsenko 2022-01-11 21:03:09 UTC
Although this doesn't seem to me as port issue neither and I agree with @koobs that this should be rather submitted to the upstream, the patch seems fine to me.
Comment 4 Helge Oldach 2022-01-12 05:18:30 UTC
(In reply to m.tsatsenko from comment #3)
As mentioned already, this patch has been submitted.

To be clear: This fixes interoperability of milter-greylist with mlmmj to which the FreeBSD has moved.
Comment 5 m.tsatsenko 2022-01-20 16:33:24 UTC
Fine by me. We probably also need to bump PORTREVISION due to binary change