[Remail] [patch v2 00/11] remail: Spring cleaning and improve 'From:' mangling

Thomas Gleixner tglx at linutronix.de
Sun Jun 18 22:13:41 CEST 2023


Hi!

Linus asked recently whether the 'From:' mangling of remail is really
required to be as obscure as it is.

The from mangling is required due to re-encryption, but it's not required
to be as obscure as it is.

As Konstantin noticed that the address parsing is error prone and
recommended to use email.utils.parseaddr(), I went trough the code with a
fine comb to find all places which might be affected, cleaned them up and
did moar testing.

As a consequence the series is now way bigger than the V1 attempt.

It contains the following changes:

   1) Remove unused functions and debug leftovers

   2) Use parseaddr() and get_addresses() for address retrieval

      I wanted to use formataddr() too, but that turned out to have an
      issue:

	If a display name contains non-ascii characters it encodes it
	correctly, but it fails to force quotes on it when the display name
	contains characters like ',' which is popular with corporate mail
	setups. For ascii-only display names this works correctly.

   3) Simplify send_mail() and the header handling in that code

   4) On top of #3 check the outgoing mail for defects and report them to
      the admins

   5) Fix boundary handling as a consequence of #4

   6) Preserve the original 'From:' header in 'X-Original-From:' header

      Vs. V1 this is not longer configurable and uses 'X-Original-From' as
      suggested by Konstantin. Handles encoding properly now.

   7) Switch 'From:' mangling to 'display-name via list-name'

      Vs. V1 this is not longer configurable as requested by Konstantin and
      handles encoding properly now (this is the place where formataddr()
      was detected to be incomplete vs. non-ascii).

The pile is also available via git:

 git://git.kernel.org/pub/scm/linux/kernel/git/tglx/remail.git testing

Thanks,

	tglx
---
 mail.py     |  243 ++++++++++++++++--------------------------------------------
 maillist.py |   75 +++++++++++++-----
 remaild.py  |    3 
 3 files changed, 124 insertions(+), 197 deletions(-)

      

   

	


More information about the Remail mailing list