OK, I've opened a bug on Launchpad to attach my very basic implementation (plus a unit test). It's just 3 lines, it does not implement Stephen's suggestion (which is probably better but involves some refactoring). Here is the ticket: https://bugs.launchpad.net/mailman/+bug/1291452 I've tested it on my setup, it works as expected.
Aurélien 2014-03-12 1:43 GMT-03:00 Stephen J. Turnbull <step...@xemacs.org>: > Aurelien Bompard writes: > > > I'd like to discuss what happens when an email is sent by both a > > member and a nonmember in Mailman3. How is that possible? Very easy, > > here's my use case : I have my own domain, say example.com, and for > > convenience and portability I choose to use Gmail as a > > server/storage/interface. My main adress is al...@example.com and I > > redirect it to al...@gmail.com, while I set a default identity in > > gmail to al...@example.com which will set the proper From header. > > However, for spam detection and spoofing reasons, gmail adds a Sender > > header with al...@gmail.com. My outgoing emails thus have both a From > > and a Sender header, and in this case email clients only display the > > >From header (except Outlook, but eh...) > > Your outgoing emails also have an envelope sender, which might be > different from both of the above. > > > Mailman now: when I subscribe to a list, I use my regular address, > > al...@example.com. But the message.senders property will contain both > > addresses because of the Sender header. The email goes through the > > MemberModeration rule, which finds my subscribed address and, by > > default, associates the "defer" action. > > The email then goes through the NonMemberModeration rule, which finds > > my Gmail address and sets the action to "hold" (it ignores my main > > address because it's a member already). > > > > What do you think about all that? Do you agree there's actually an > > issue there? > > Yes. > > > Any idea how to solve it? For example, make the NonMember rule exit > > if a member is found amongst the senders (which would simply be > > equivalent to making it yield to the Member rule). Bad idea? > > Offhand I'd say that having both a Member rule and a NonMember rule is > a bad idea. There should be one conceptual test: can we identify a > member as the originator of this post? Having Member and NonMember > rules that can both "succeed" is not coherent. > > I think that what should happen here is that the Member rule should > try to identify the originator, and the NonMemberModeration (if in > effect) should just check for a "member_identified" property. The > member_identified property could be a Boolean or actually contain a > list of members (list because it's not obvious what to do if each of > From, Sender, and envelope sender corresponds to a different member; > that would probably be a policy issue). > > I don't really see how order dependence can be avoided without > violating DRY all over the place. > > Alternatively, NonMemberModeration might not be a rule, but rather a > chain. Perhaps that's the most elegant solution, as order dependence > between chains is necessary. > > > _______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org https://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org Security Policy: http://wiki.list.org/x/QIA9