Skip to content

Commit 4049b31

Browse files
committed
Added normalization of the email addresses returned by ietf.nomcom.utils.parse_email, in order to not treat feedback from the same person as coming from different sources due to email name+address variations.
- Legacy-Id: 15731
1 parent e4af908 commit 4049b31

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ietf/nomcom/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import re
55
import tempfile
66

7+
from email import message_from_string
78
from email.header import decode_header
89
from email.iterators import typed_subpart_iterator
9-
from email import message_from_string
10+
from email.utils import parseaddr
1011

1112
from django.conf import settings
1213
from django.contrib.sites.models import Site
@@ -447,7 +448,8 @@ def parse_email(text):
447448

448449
body = get_body(msg)
449450
subject = getheader(msg['Subject'])
450-
return msg['From'], subject, body
451+
__, addr = parseaddr(msg['From'])
452+
return addr.lower(), subject, body
451453

452454

453455
def create_feedback_email(nomcom, msg):

0 commit comments

Comments
 (0)