2

I need to ask a fiscal document through sending an e‑mail to[email protected].

In order to get it received, I need to attach a lot of documents. So when I sent the e‑mail from Gmail, I got an error from dgfip.finances.gouv.fr stating attachment size of my message is too large.
This means the attachment size limit of dgfip.finances.gouv.fr is lower than on Gmail.

So how much do I need to shrink my message size? Normally, one would do something like this (which by the way works for this server):

telnet aspmx.l.google.com. 25
Connection to aspmx.l.google.com. 25 port [tcp/smtp] succeeded!
220 mx.google.com ESMTP gv4si23346623qab.115
EHLO somehost
250-mx.google.com at your service, [YOUR_IP]
250-SIZE 35882577 bytes

However, it seems in my case mail.dgfip.finances.gouv.fr only allows connection from a safe list of smtp servers in order to filter spam :

telnet mail.dgfip.finances.gouv.fr 25
Trying 145.242.11.31...
telnet: Unable to connect to remote host: Connection timed out

So how I can know for example if the maximum message size is 200Kb or or 10Mb without taking the risk of sending successfully a message where documents quality would be too low whereas I could send a larger e-mail?

2
  • What are you connecting from? If you're trying this from your home, there's a good chance your ISP is blocking the connection. Commented Nov 18, 2018 at 23:59
  • @user20574 my ɪꜱᴘ doesn’t blocks the connection for Google. I fail to see why it would be blocked for the ᴅɢꜰɪᴘ. Commented Nov 19, 2018 at 21:42

4 Answers 4

7

Odd... I checked the email address with DNS Stuff's Mail Service Test Center tool and it showed the server was valid and accepted connections on port 25. I had no issue using the telnet command in your question, it appears the maximum email size is ~20MB:

~$ telnet mail.dgfip.finances.gouv.fr 25  
Trying 145.242.11.31...  
Connected to mail.dgfip.finances.gouv.fr.  
Escape character is '^]'.  
220 mail.dgfip.finances.gouv.fr ESMTP Service Ready  
EHLO dude.com  
250-mail.dgfip.finances.gouv.fr  
250-PIPELINING  
250-SIZE 20480000  
250-VRFY  
250-ETRN  
250-ENHANCEDSTATUSCODES  
250-8BITMIME  
250 DSN  

Although, if this did NOT work, then your only option would be contact the recipient and ask. Or alternatively, just continue to decrease the total email size by 5MB increments until it is successful, but common restriction these days seem to be 5MB, 10MB, 20MB, 50MB, and occasionally 100MB, although it could be anywhere from 50KB to larger than you could send.

10
  • 1
    Yes it does answer the question. I have already upvoted it. :) Commented Nov 18, 2018 at 17:53
  • 4
    @KamilMaciorowski Remember that the SIZE parameter is not the maximum size of the attachments, but the maximum total size of the email message... In some cases that may be important.
    – acejavelin
    Commented Nov 18, 2018 at 17:56
  • 1
    @acejavelin: The most important difference is the +34% overhead from Base64-encoding a binary attachment. Commented Nov 18, 2018 at 21:04
  • 3
    @user2284570: Just because you cannot connect to the server doesn't mean everyone else can't. I've had 100% success from six different locations so far. Maybe it's not whitelisting clients, but blacklisting you specifically? Commented Nov 18, 2018 at 21:06
  • 1
    @user2284570: Well, Google App Engine itself blocks all SMTP. Meanwhile I have access to several servers which don't have such blocks... Commented Nov 18, 2018 at 21:31
2

The question was kinda resolved in acejavelin's answer, but I just wanted to clarify that, sometimes, the ISP blocks connections to port 25 outbound, to limit spam from infected residential computers. If you are in France, as the host suggest, I know that free (an ISP) does that by default, but you can disable that on your customer panel.

The other major ISPs probably does it too, but I don't currently have the knowledge.

You should try to connect to some random mail server to see if it works.
You can also use telnet and http://portquiz.net/ to see blocked outbound ports, if any.

2
0

Ok. By reducing the size a little, I got the real maximum size through receiving this e‑mail (Subject : courriel trop volumineux et non remis au destinataire DGFiP) which this time don’t come from Google but the target ꜱᴍᴛᴘ server.
This means the first message was so large the server couldn’t even reply.

Le courriel à destination de [email protected] dépassait la taille maximale autorisée (5662310 octets) et n'a pas été transmis au destinataire DGFiP. La taille du message était de 19335584 octets. Merci de réduire la taille de vos messages.

Which means after shrinking the message to the proper size, I received :

Nous vous informons que votre demande a été prise en compte et qu'il vous sera répondu dans les meilleurs délais. Pensez à consulter le site www.impots.gouv.fr, vous y trouverez les réponses aux questions les plus fréquentes, régulièrement actualisées. Cet accusé réception est généré automatiquement, merci de ne pas y répondre.

-1

There is an online tool to check the message limit of an e-mail domain:

https://www.hochschule-trier.de/rzht/it-dienste-infos/maximale-e-mail-groesse-ermitteln/

For mail.dgfip.finances.gouv.fr the lookup returns 19.53 MB.

As @grawity comments, don't forget the 34% overhead from Base64-encoding an attachment. Thus: 19.53 ÷ 1.34 = 14.57 MB can be sent as the maximum attachment size.

2
  • As stated previously, the maximal e‑mail size is 5662310 bytes which is 3 times below what you found. Your tool doesn’t works. Commented Oct 11, 2019 at 15:58
  • The tool returns approximately the same answer as acejavelin telnet answer, and that is the size that the mail server can handle, as you asked in the title. That 1 specific mailbox on that server applies an eve smaller limit, can happen. Updating your question (title), will help to not receive answers that you apparently don't want
    – Pro Backup
    Commented Oct 11, 2019 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .