Much appreciated. Checking for aol.com and yahoo.com here alone will not work. I have a bunch of other subscribers that have accounts with providers that are owned by Yahoo (mostly) and AOL, but whose addresses are not of this form. I would have to do this for all addresses, to be safe.
If I do this and add the bit about the Reply-To, what would the code look like?
On May 24, 2015, at 6:10 , Stephen J. Turnbull email@example.com wrote:
Allan Hansen writes:
< # Added to deal with DMARC issuej < name, addrs = parseaddr(msg.get('from')) < addrs += '.invalid'
This is known to be a bad idea, as it increases the spam score at many sites (because the author's mail domain doesn't resolve). Subscribers at such sites may have trouble receiving mail, and your list(s) may be tagged as suspicious.
I would recommend the From-munging approach:
name, addr = parseadder(msg.get('from')) if addr.endswith('aol.com') or addr.endswith('yahoo.com'): # I forget what happens if it's a bare address name = "%s (%s) via list" % (name if name else "Anonymous", addr) addr = <list-post address> del msg['from'] msg['from'] = formataddr((name, addr))
Mark (or you) probably have better code, and in some cases you may want to add the addr to the Reply-To field.
< del msg['from'] < msg['from'] = formataddr((name, addrs)) \ No newline at end of file