remail: Fix the from mangling

The comment in mangle_from() says that if there is not a real name then the
email address is mangled by replacing @ with _at_. The comment is great
just the implementation is not doing so.

Add the replacement functionality.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
Thomas Gleixner 2020-11-05 00:51:22 +01:00
parent 576165a654
commit e2626e1dca

View file

@ -233,6 +233,7 @@ class maillist(object):
If $ORIGINAL_FROM does not contain a name, mangle the email If $ORIGINAL_FROM does not contain a name, mangle the email
address by replacing @ with _at_ address by replacing @ with _at_
''' '''
mfrom = mfrom.replace('@','_at_')
return '%s for %s <%s>' % (self.config.name, mfrom, return '%s for %s <%s>' % (self.config.name, mfrom,
self.config.listaddrs.post) self.config.listaddrs.post)