Patch #17699

Parse email with header "From" in parentheses format

Added by Stanislav German-Evtushenko over 4 years ago. Updated 4 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:4.1.0

Description

Emails header "From" can be not only in angles format, like this:

From: John Doe <john.doe@company.mail>
but also in parentheses format, like this:
From: john.doe@company.mail (John Doe)
For example sendmail from postfix does this when using switch -F.
The patch to fix this is attached.

email_from_parens_format.diff Magnifier (671 Bytes) Stanislav German-Evtushenko, 2014-08-16 23:51

email_from_parens_format_test.diff Magnifier (2.11 KB) Stanislav German-Evtushenko, 2014-08-18 12:53

17699-fix-using-mail-address-object.diff Magnifier (773 Bytes) Go MAEDA, 2019-02-16 04:38

17699-fix-using-mail-address-object-v2.diff Magnifier (843 Bytes) Go MAEDA, 2019-02-16 07:48

17699-fix-using-mail-address-object-v3.diff Magnifier (849 Bytes) Go MAEDA, 2019-02-16 08:00

17699-fix-using-mail-address-object-v4.diff Magnifier (847 Bytes) Go MAEDA, 2019-02-17 15:52

History

#1 Updated by Toshi MARUYAMA over 4 years ago

  • Category set to Email receiving

#2 Updated by Toshi MARUYAMA over 4 years ago

  • Subject changed from Parse email with header "From" in parens format to Parse email with header "From" in parentheses format
  • Description updated (diff)

#4 Updated by Go MAEDA 12 days ago

  • Target version set to Candidate for next major release

#5 Updated by Go MAEDA 6 days ago

I wrote a new patch. The code using Mail::Address is shorter and maybe more reliable (I hope) than the code using our regular expressions.

Patches to commit:

#6 Updated by Go MAEDA 6 days ago

  • Target version changed from 4.0.2 to 4.1.0

#7 Updated by Go MAEDA 6 days ago

  • File 17699-fix-using-mail-address-object-v2.diff added

Updated the patch. email.header['from'] can be nil or Mail::UnstructuredField object (does not have addrs method).

#8 Updated by Go MAEDA 6 days ago

  • File deleted (17699-fix-using-mail-address-object-v2.diff)

#10 Updated by Go MAEDA 6 days ago

Updated the patch again. from_addr.comments also can be nil.

Also available in: Atom PDF