How to retrieve fixed upper limit on message size SMTP server

Go To


I need to know the fixed upper limit on message size SMTP server. For instance, for GMAIL we have 25MB as limit for sending mail.

Can any one please help me with command that I can use. I referred to RFC 1870 for the same.

Thanks and Regards, NehaC

2012-04-04 06:51
by user1312132


You can get a guess of this by sending an EHLO message and seeing if the server responds with a SIZE:

$ nc -v 25
Connection to 25 port [tcp/smtp] succeeded!
220 ESMTP gv4si23346623qab.115
EHLO somehost at your service, [YOUR_IP]
250-SIZE 35882577

In this case, the server reported a limit of 35 MB.

2012-04-04 06:54
by A B
Thanks for your reply. But how do I get this for yahoo, AOL... For yahoo, it does not give SIZE in response.. - user1312132 2012-04-04 06:57
They did for me: 250-SIZE 41943040. Did you send EHLO yourhostname - A B 2012-04-04 07:00
These are the commands I followed: 1) openssl s_client -crlf -quiet -connect 2) EHLO InetAddress.

For Gmail.. This worked for me. - user1312132 2012-04-04 07:03

As for GMAIL: nc -v 25 -- What can be used for yahoo - user1312132 2012-04-04 07:11
You can run host to get their MX records listing their SMTP servers - A B 2012-04-04 08:58
Some SMTP servers choose not to send the SIZE extension, as it could possibly be used to facilitate DoS attacks - james.garriss 2012-07-09 19:36


SMTP HELO/EHLO response indicates maximal message size, see

SIZE The SIZE command has two purposes. The SMTP server can inform the client what is the maximum message size and the client can inform the SMTP server the (estimated) size of the e-mail message that will be sent. The client should not send an e-mail message that is larger than the size reported by the server, but normally it is no problem if the message is somewhat larger than the size informed by the client to the server. The example below shows how a server (S) and client (C) reports size to each other:

S: 250 SIZE 1000000
C: MAIL FROM:<> SIZE=500000

The client sends the SIZE command, and size information, together with the MAIL FROM command. The server sends the command and size information alone. The size is always specified in bytes.

2012-04-04 06:55
by Roman R.