The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,226 other subscribers

Common SMTP message size limits

Posted by jpluimers on 2020/04/08

After a 2018 discussion with a “zorgkantoor” (Dutch for office that arranges for special long term health care needs, successor of AWBZ) about their very low (10 megabyte) SMTP message size limit – even though they expect scanned PDF documents.

Their web-care team posed this limit as normal, so I made a list of limits in their peer group, common world-wide and well-ranked Dutch internet providers.

My plan is to check the progression of these limits over time.

Note these are the bruto message sizes including encoded attachments. Since encoding in [WayBack] MIME Base64 – Wikipedia has a overhead of at least 37% (encoded size is at least 1.37 the original size), the unencoded maximum size is less than 73% of what is listed below.

References:

2018

python ehlo-size.py zorgenzekerheid.nl achmea.nl menzis.nl vgz.nl gmail.com outlook.com protonmail.com aol.com icloud.com yahoo.com mail.com gmx.com yandex.com xs4all.nl zeelandnet.nl kpn.com telfort.nl caiway.nl onsbrabantnet.nl ziggo.nl tele2.nl solcon.nl
Maximum message size is 10485760 bytes for domain zorgenzekerheid.nl MX priority 10 SMTP server mail.zorgenzekerheid.nl.
Maximum message size is 31457280 bytes for domain zorgenzekerheid.nl MX priority 20 SMTP server mx2.infracom.nl.
Maximum message size is 31457280 bytes for domain zorgenzekerheid.nl MX priority 20 SMTP server mx3.infracom.nl.
Maximum message size is 73400320 bytes for domain achmea.nl MX priority 10 SMTP server smtpgate-nl1.achmea.nl.
Maximum message size is 73400320 bytes for domain achmea.nl MX priority 10 SMTP server smtpgate-nl2.achmea.nl.
Maximum message size is 157286400 bytes for domain menzis.nl MX priority 5 SMTP server menzis-nl.mail.protection.outlook.com.
Maximum message size is 31457280 bytes for domain vgz.nl MX priority 10 SMTP server mx1.vgz.nl.
Maximum message size is 31457280 bytes for domain vgz.nl MX priority 10 SMTP server mx2.vgz.nl.
Maximum message size is 157286400 bytes for domain gmail.com MX priority 5 SMTP server gmail-smtp-in.l.google.com.
Maximum message size is 157286400 bytes for domain gmail.com MX priority 10 SMTP server alt1.gmail-smtp-in.l.google.com.
Maximum message size is 157286400 bytes for domain gmail.com MX priority 20 SMTP server alt2.gmail-smtp-in.l.google.com.
Maximum message size is 157286400 bytes for domain gmail.com MX priority 30 SMTP server alt3.gmail-smtp-in.l.google.com.
Maximum message size is 157286400 bytes for domain gmail.com MX priority 40 SMTP server alt4.gmail-smtp-in.l.google.com.
Maximum message size is 49283072 bytes for domain outlook.com MX priority 5 SMTP server outlook-com.olc.protection.outlook.com.
Maximum message size is 36480000 bytes for domain protonmail.com MX priority 5 SMTP server mail.protonmail.ch.
Maximum message size is 36480000 bytes for domain protonmail.com MX priority 10 SMTP server mailsec.protonmail.ch.
Maximum message size is 41943040 bytes for domain aol.com MX priority 10 SMTP server mx-aol.mail.gm0.yahoodns.net.
Maximum message size is 28311552 bytes for domain icloud.com MX priority 10 SMTP server mx1.mail.icloud.com.
Maximum message size is 28311552 bytes for domain icloud.com MX priority 10 SMTP server mx2.mail.icloud.com.
Maximum message size is 28311552 bytes for domain icloud.com MX priority 10 SMTP server mx3.mail.icloud.com.
Maximum message size is 28311552 bytes for domain icloud.com MX priority 10 SMTP server mx4.mail.icloud.com.
Maximum message size is 28311552 bytes for domain icloud.com MX priority 10 SMTP server mx5.mail.icloud.com.
Maximum message size is 28311552 bytes for domain icloud.com MX priority 10 SMTP server mx6.mail.icloud.com.
Maximum message size is 41943040 bytes for domain yahoo.com MX priority 1 SMTP server mta5.am0.yahoodns.net.
Maximum message size is 41943040 bytes for domain yahoo.com MX priority 1 SMTP server mta6.am0.yahoodns.net.
Maximum message size is 41943040 bytes for domain yahoo.com MX priority 1 SMTP server mta7.am0.yahoodns.net.
Maximum message size is 157286400 bytes for domain mail.com MX priority 10 SMTP server mx00.mail.com.
Maximum message size is 157286400 bytes for domain mail.com MX priority 10 SMTP server mx01.mail.com.
Maximum message size is 157286400 bytes for domain gmx.com MX priority 10 SMTP server mx00.gmx.net.
Maximum message size is 157286400 bytes for domain gmx.com MX priority 10 SMTP server mx01.gmx.net.
Maximum message size is 42991616 bytes for domain yandex.com MX priority 10 SMTP server mx.yandex.ru.
Maximum message size is 157286400 bytes for domain xs4all.nl MX priority 100 SMTP server mx1.xs4all.nl.
Maximum message size is 157286400 bytes for domain xs4all.nl MX priority 100 SMTP server mx2.xs4all.nl.
Maximum message size is 157286400 bytes for domain xs4all.nl MX priority 100 SMTP server mx3.xs4all.nl.
Maximum message size is 157286400 bytes for domain xs4all.nl MX priority 100 SMTP server mx4.xs4all.nl.
Maximum message size is 20480000 bytes for domain zeelandnet.nl MX priority 10 SMTP server mail.zeelandnet.nl.
Maximum message size is 35000000 bytes for domain kpn.com MX priority 10 SMTP server mail1.kpnnet.org.
Maximum message size is 35000000 bytes for domain kpn.com MX priority 10 SMTP server mail2.kpnnet.org.
Maximum message size is 35000000 bytes for domain kpn.com MX priority 10 SMTP server mail3.kpnnet.org.
Maximum message size is 35000000 bytes for domain kpn.com MX priority 10 SMTP server mail4.kpnnet.org.
Undefined aximum message size for domain telfort.nl MX priority 10 SMTP server telfortmailin.kpnxchange.com.
Maximum message size is 22020096 bytes for domain caiway.nl MX priority 5 SMTP server mx1.caiw.net.
Maximum message size is 22020096 bytes for domain caiway.nl MX priority 5 SMTP server mx2.caiw.net.
Maximum message size is 22020096 bytes for domain caiway.nl MX priority 5 SMTP server mx4.caiw.net.
Maximum message size is 22020096 bytes for domain caiway.nl MX priority 10 SMTP server mx3.caiw.net.
Maximum message size is 100000000 bytes for domain onsbrabantnet.nl MX priority 10 SMTP server mxa.edutel.nl.
Maximum message size is 100000000 bytes for domain onsbrabantnet.nl MX priority 10 SMTP server mxb.edutel.nl.
Maximum message size is 31457280 bytes for domain ziggo.nl MX priority 50 SMTP server mx.tb.mail.iss.as9143.net.
Maximum message size is 31457280 bytes for domain ziggo.nl MX priority 50 SMTP server mx.mnd.mail.iss.as9143.net.
Undefined aximum message size for domain tele2.nl MX priority 10 SMTP server mx10.se.isp-net.nl.
Undefined aximum message size for domain tele2.nl MX priority 20 SMTP server mx20.se.isp-net.nl.
Error when executing EHLO command for domain solcon.nl on SMTP server mx101.solcon.nl.
[Errno 61] Connection refused
Maximum message size is 52428800 bytes for domain solcon.nl MX priority 10 SMTP server mx102.solcon.nl.
Maximum message size is 52428800 bytes for domain solcon.nl MX priority 10 SMTP server mx103.solcon.nl.
Maximum message size is 52428800 bytes for domain solcon.nl MX priority 10 SMTP server mx104.solcon.nl.

–jeroen


## Based on
## – https://erlerobotics.gitbooks.io/erle-robotics-python-gitbook-free/smtp/getting_information_from_ehlo.html
## – https://programtalk.com/python-examples/dns.resolver.query/
## Example usage:
## python ehlo-size.py google.com outlook.com
## python ehlo-size.py aol.com
## Requires:
## pip install dnspython
## On Mac OS X, do not use `brew install pip` as then you have two different Python installations
## Instead:
## sudo easy_install pip
## sudo pip install –update pip
## sudo pip install dnspython
import sys, smtplib, socket, dns.resolver
if len(sys.argv) < 2:
print "usage: %s domain…" % sys.argv[0]
sys.exit(1)
domains = sys.argv[1:]
domainsLength = len(domains)
singleDomain = domainsLength == 1
for domain in domains:
try:
## use `answers` outside and `rdata` in the loop as that is what DNS folks call it:
## – http://www.zytrax.com/books/dns/ch15/#rdata
answers = dns.resolver.query(domain, 'MX')
answers = sorted(answers) ## sorts on preference; might want this more clear using https://github.com/linkedin/iris/blob/master/src/iris/vendors/iris_smtp.py#L46 or https://developers.google.com/edu/python/sorting
for rdata in answers:
allMxForDomainFailed = True
try:
mx = rdata.exchange
priority = rdata.preference
server = mx.to_text() ## to prevent 'Name' object has no attribute 'find', see https://stackoverflow.com/questions/48071359/why-do-mxrecord-should-be-change-to-string
s = smtplib.SMTP(server)
code = s.ehlo()[0]
uses_esmtp = (200 <= code <= 299)
if not uses_esmtp:
code = s.helo()[0]
if not (200 <= code <= 299):
print "Remote server refused HELO; code:", code
sys.exit(1)
if uses_esmtp and s.has_extn('size'):
maximumMessageSize = s.esmtp_features['size']
if maximumMessageSize == '':
print("Undefined aximum message size for domain {0} MX priority {1} SMTP server {2}".format(domain, priority, server))
else:
print("Maximum message size is {0} bytes for domain {1} MX priority {2} SMTP server {3}".format(maximumMessageSize, domain, priority, server))
else:
print("No defined maximum message size for domain {0} MX priority {1} SMTP server {2}".format(domain, priority, server))
allMxForDomainFailed = False
except (socket.gaierror, socket.error, socket.herror,
smtplib.SMTPException), e:
print("Error when executing EHLO command for domain {0} on SMTP server {1}".format(domain, server))
print e
if singleDomain:
sys.exit(2)
if allMxForDomainFailed:
print("All MX for domain {0} failed.".format(domain))
sys.exit(1)
except Exception as e:
print("Error when querying MX records to obtain SMTP servers for domain {0}".format(domain))
print e
if singleDomain:
sys.exit(4)

view raw

ehlo-size.py

hosted with ❤ by GitHub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: