[Mailman-Developers] --- in DMARC From: rewritings

2022-03-17 Thread Stephen J. Turnbull
Дилян Палаузов writes:

 > realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname)

The obvious hack is to change '---' to '', which you can do locally.

I'm not sure why we use '---', since it's not informative.  I will
have to see if one of the other devs knows, or maybe there's something
in the history.

 > compare to the IETF mailing lists, which would send:
 > From:where a and b are from a@b, d is from c@d

That's elegant, but I suspect that it would be confusing to anyone who
isn't an email hacker.

 > In my real-world case the From: is a...@example.org, the ML name is
 > a...@l.example.org (localname is the same, the domains are
 > different).  The result is:
 > 
 > From: aaa--- via Aaa 
 > 
 > So there is twice trippe-A and @example.org disappeared.  Mentioning
 > twice AAA in the display name in this case really has to added value.

Of course there's added value.  The first "aaa" is a necessary hack to
identify the author, while the second is the name of the list.  That
they are the same is just an accident (unless the list owner is "aaa",
in which case they should just add their display name).  You could
argue that since the mailing list's display name is usually just a
capitalized version of the local part of the posting address, it's
unnecessary, but that turns out to be untrue since some common MUAs
suppress addresses in the display, leaving only the display name.

 > and in the future offer as options:
 >   From:  User Name 
 >   From:  “User Name”  (userem...@address.com) <
 > listn...@lists.illinois.edu >
 >   From:  “User Name”  (userem...@address.com via listName Mailing List)
 > 
 >   From:  “User Name via listName” 

None of these work in the case of interest since they assume the
display name is available, and I don't see enough value in additional
options to do this myself.  FWIW, I don't think any of the other core
developers would be interested in doing it, either.  You could submit
a patch, but I can't promise it would be accepted, unless one of the
core devs here expresses an interest in it.

I think it's definitely possible to make a case for changing the
default here, but if we're going to offer options, I think we would
probably allow the admin to specify a format string rather than
offering multiple fixed formats.  And if we're going to change at all,
be prepared for a long bikeshedding conversation because (1) the
current approach works for everybody, although it is occasionally
ugly, and (2) we need to be careful that the result is readable and
informative in almost all MUAs.

Steve

___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9


[Mailman-Developers] --- in DMARC From: rewritings

2022-03-16 Thread Дилян Палаузов
Hello,

the DMARC Mitigation action “Replace From: with list address” is
evaluated in mailman/handlers/dmarc.py:munged_headers().  In the case,
where From: is a non-member email address, without display part, which
non-member may post, this happens: 

realname = email
realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname)
with _.using(mlist.preferred_language.code):
via = _('${realname} via ${mlist.display_name}')
display_name = str(Header(via, mlist.preferred_language.charset))
value = [('From', formataddr((display_name, mlist.posting_address)))]

In short, if a@b is a non-member, who may post to mailing list “E
”, and b is DMARC-protected, the final distrubuted email will have

From: "a--- via E "
Reply-To: a@b

compare to the IETF mailing lists, which would send:
From:where a and b are from a@b, d is from c@d

The bottom of https://answers.uillinois.edu/illinois/page.php?id=86787
describes the mitigariton options offered by Sympa:

display name
  From:  User Name 

display name and e-mail
  From:  “User Name”  (userem...@address.com) <
listn...@lists.illinois.edu >

email “via Mailing List”
  From:  “User Name”  (userem...@address.com via listName Mailing List)


name “via Mailing List”
  From:  “User Name” 
(the website likely means:)
  From:  “User Name via listName” 


As can be seen, the other MLMs do not replace domains with --- .  I
find ugly the --- , inserted by mailman.  In my real-world case the
From: is a...@example.org, the ML name is a...@l.example.org (localname
is the same, the domains are different).  The result is:

From: aaa--- via Aaa 

So there is twice trippe-A and @example.org disappeared.  Mentioning
twice AAA in the display name in this case really has to added value.

That said, I propose removing now the line

realname = re.sub(r'@([^ .]+\.)+[^ .]+$', '---', realname)

and in the future offer as options:
  From:  User Name 
  From:  “User Name”  (userem...@address.com) <
listn...@lists.illinois.edu >
  From:  “User Name”  (userem...@address.com via listName Mailing List)

  From:  “User Name via listName” 


___
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-le...@python.org
https://mail.python.org/mailman3/lists/mailman-developers.python.org/
Mailman FAQ: https://wiki.list.org/x/AgA3

Security Policy: https://wiki.list.org/x/QIA9