Feature #17699

Parse author's name enclosed in parentheses in the From field when creating a user account from an email

Added by Stanislav German-Evtushenko over 5 years ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Email receiving
Target version:4.1.0
Resolution:

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

Associated revisions

Revision 17914
Added by Go MAEDA 9 months ago

Parse author's name enclosed in parentheses in the From field when creating a user account from an email (#17699).

Patch by Go MAEDA.

Revision 17915
Added by Go MAEDA 9 months ago

Test for r17914 (#17699).

Revision 17916
Added by Go MAEDA 9 months ago

Missing fixture (#17699).

History

#1 Updated by Toshi MARUYAMA over 5 years ago

  • Category set to Email receiving

#2 Updated by Toshi MARUYAMA over 5 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 10 months ago

  • Target version set to Candidate for next major release

#5 Updated by Go MAEDA 10 months 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 10 months ago

  • Target version changed from 4.0.2 to 4.1.0

#7 Updated by Go MAEDA 10 months 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 10 months ago

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

#10 Updated by Go MAEDA 10 months ago

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

#12 Updated by Go MAEDA 9 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch.

#13 Updated by Go MAEDA 9 months ago

  • Subject changed from Parse email with header "From" in parentheses format to Parse author's name enclosed in parentheses in the From field when creating a user account from an email

#14 Updated by Go MAEDA 9 months ago

  • Tracker changed from Patch to Feature

Also available in: Atom PDF