gen-smtp / gen_smtp

The extensible Erlang SMTP client and server library.
Other
684 stars 265 forks source link

Subjects with newlines lack spaces #317

Open taobojlen opened 2 years ago

taobojlen commented 2 years ago

I use gen_smtp to receive incoming emails. I use :mimemail.decode/1 to parse them, and I've noticed an issue in emails where the subject spans multiple lines in the incoming email.

Here's an example:

From: "Sender" <sender@example.com>
To: "Recipient" <recipient@example.com>
Subject: An email with newlines
 in the subject
Content-Type: text/plain; charset="utf-8"

Plain text email goes here!

If you try to decode this, you'll get a subject of An email with newlinesin the subject in the result.