Closed ccjmne closed 4 years ago
Great fix @ccjmne!
@arithmetric Thank you for the original code!
The forwarder kept giving me the error: 'sendRawEmail() returned error.', InvalidParameterValue: Empty header names are illegal.
until I applied these changes.
Awesome! I'm glad it worked for you 😄
Thanks for this contribution @ccjmne!
Fixes #86.
As described in the RFC 5322 – Internet Message Format,
from:Betsy <betsy@example.com>
should be accepted and understood.Basically, fields don't have to look like
From: ccjmne@gmail.com
, they could very well be:from:ccjmne@gmail.com
(note the non-capitalized field header and the absence of a whitespace immediately following the colon:
).I ensured this would work for the relevant fields, and slightly modified the
test/assets/message.txt
file to reproduce the uncommon "lowercase header, colon, no-space, body" field pattern.Also, according to that same RFC, the "carriage return/line feed" pair should always appear together. In other words,
\r?\n
should really be:\r\n
; but I figure it's safe being too lenient there so I'll leave these unchanged.