t2bot / matrix-email-bot

A bot that posts messages to rooms when an email is received.
Apache License 2.0
43 stars 9 forks source link

Some emails coming through with headers in content, leading to parse failures #41

Open turt2live opened 7 years ago

turt2live commented 7 years ago

Emails and names redacted for privacy.

[ Fragment {
    _content: '',
    _isHidden: true,
    _isSignature: false,
    _isQuoted: false },
  Fragment {
    _content: 'From: Tom <tom@redacted>\nSubject: Re: [LIST] Subject line\nDate: Tue, 11 Jul 2017 21:43:36 GMT\nTo: Mailing List <list@redacted>\n\nwut\n',
    _isHidden: true,
    _isSignature: false,
    _isQuoted: true },
  Fragment {
    _content: 'On Tue, Jul 11, 2017 at 11:43 PM, Tom <tom@redacted> wrote:\n\n> always be knolling!\n>\n> On Tue, Jul 11, 2017 at 11:40 PM, Fred <\n> list@redacted> wrote:\n>\n>> _______________________________________________\n>> LIST mailing list\n>> list@redacted\n>> https://link/to/list\n>>\n>>\n>> ---------- Forwarded message ----------\n>> From: Fred <list@elsewhere>\n>> To: Mailing List <list@redacted>\n>> Cc:\n>> Bcc:\n>> Date: Tue, 11 Jul 2017 23:41:52 +0200\n>> Subject: Subject line\n>>\n>> We had some e-mail issues lately, mostly due to misconfiguration.\n>>\n>> If any list email lands in your spam folder, please report it.\n>>\n>> Thanks.\n>>\n>>\n>',
    _isHidden: true,
    _isSignature: false,
    _isQuoted: true },
  Fragment {
    _content: '',
    _isHidden: true,
    _isSignature: false,
    _isQuoted: false },
  Fragment {
    _content: '_______________________________________________\n LIST mailing list\nlist@redacted\nhttps://link/to/list\n',
    _isHidden: true,
    _isSignature: true,
    _isQuoted: false } ]

Here's what the email bot got: image

Full .eml available in private location.

turt2live commented 7 years ago

TravisR: We have configured mailman to wrap the sender's e-mail into a new one as a message/RFC822 attachement. A TravisR: That was the only way to pass valid DKIM and DMARC signatures and not end up as spam with gmail.