"Additional post processing checks to ensure mailbox is valid."
parts = address.split('@')
- # check if local part is less than 128 octets, the actual
- # limit is 64 octets but we double the size here because
+ # check if local part is less than 256 octets, the actual
+ # limit is 64 octets but we quadruple the size here because
# unsubscribe links are frequently longer
lpart = parts[0]
- if len(lpart) > 128:
+ if len(lpart) > 256:
return False
# check if the domain is less than 255 octets
# test length limits
run_mailbox_test(''.join(['a'*128, '@b']), ''.join(['a'*128, '@b']))
- run_mailbox_test(''.join(['a'*129, '@b']), None)
+ run_mailbox_test(''.join(['a'*257, '@b']), None)
# because qtext and quoted-pair are longer than 64 bytes (limit on local-part)
# we use a sample in testing, every other for qtext and every fifth for quoted-pair
first.last@sub.do,com
first\@last@iana.org
first.last
-123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789@iana.org
+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912345678912@iana.org
.first.last@iana.org
first.last.@iana.org
first..last@iana.org