I need to ask a fiscal document through sending an e‑mail tosie.nantes-sud@dgfip.finances.gouv.fr.

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?

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

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.

  • 1
    Yes it does answer the question. I have already upvoted it. :) – Kamil Maciorowski Nov 18 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 Nov 18 at 17:56
  • 1
    @acejavelin: The most important difference is the +34% overhead from Base64-encoding a binary attachment. – grawity Nov 18 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? – grawity Nov 18 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... – grawity Nov 18 at 21:31

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.

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 sie.nantes-sud@dgfip.finances.gouv.fr 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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.