scanner / as_email_service

A Django app and smtp relay service for working with 3rd party email services and asimap
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bad forwarding -- too many "References" headers #133

Open scanner opened 5 months ago

scanner commented 5 months ago

When forwarding we need to have only one References header.

as google said:

smtp;550 5.7.1 This message is not RFC 5322 compliant. There are multiple References headers. To reduce the amount of spam sent to Gmail, this message has been blocked. For more information, go to https://support.google.com/mail/?p=RfcMessageNonCompliant and review RFC 5322 specifications. f3-20020a256a03000000b00dc21f1382b1si6986606ybc.672 - gsmtp

in this message:

References: <qrUYRrEzS8Cv8jve07Uvwg@geopod-ismtpd-36>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
X-PM-MTA-Pool: transactional-2
References: <c8bd4235-7152-414b-a77d-2c97345c58d5@mtasv.net>

Check to see if we can use "Original-References"

scanner commented 5 months ago

Note: References is a list of message-id's that is appended to whenever a message is replied to. Since we are forwarding we need to either add to this field, or remove it from the original since postmark is adding it.

scanner commented 5 months ago

https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6.4

Though listed as optional in the table in [section 3.6](https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6), every message
   SHOULD have a "Message-ID:" field.  Furthermore, reply messages
   SHOULD have "In-Reply-To:" and "References:" fields as appropriate
   and as described below.

   The "Message-ID:" field contains a single unique message identifier.
   The "References:" and "In-Reply-To:" fields each contain one or more
   unique message identifiers, optionally separated by CFWS.