Problem on SMTP: 554 5.6.0 Message contains invalid header.

Home Forums The libraries hosted on the site EMailSender send email with attachments Problem on SMTP: 554 5.6.0 Message contains invalid header.

Tagged: , , ,

Viewing 19 reply threads
  • Author
    Posts
    • #9751
      Gilles Mangin-Voirin

        Hello, thanks for the great job.
        After a lot of testing I finally managed to get the code running correctly on Arduino with shield W5100. (smtp.orange.fr)
        The mails are sent correctly.
        I received the email on my ztu.gmail.com mailbox but when trying to receive it on an xyz@wanadoo.fr address I received an email on my sending mailbox:
        host back1g-mail01-041.me-wanadoo.n<wbr />et [10.232.119.68] said: 554 5.6.0 Message contains invalid header.

        After a lot of research (not very successful) I found this:
        1) It is absolutely necessary to put an empty line between the subject and the body of the message!

        Anyone know how to do this?

        2) Put the recipient first …

        Or in any case solve my problem of shipping email to an orange.fr address
        Thank you

      • #9754
        Renzo Mischianti
        Keymaster

          Hi Gilles,
          I try to do a fix and i write here when ready.
          Bye Renzo

          • #10227
            Gilles

              Hello, if you need an email address: mischianti@orange.fr (or other) to test, tell me.

              I would create one for you and send it to you by whatever means you want with the password for this messaging!

          • #10228
            Renzo Mischianti
            Keymaster

              Hi Gilles,
              if you can do a mail for me I try this or tomorrow evening to do the change.
              Send me the password to info@mischianti.org .
              Bye Renzo

            • #10259
              Gilles

                I just sent you an orange email address with password for you.
                on the mail: info@mischianti.org

                Thanks again

              • #10266
                Renzo Mischianti
                Keymaster

                  Hi Gilles,
                  I check and try, I think the problem is the from IP.

                  If I try to send with GMail verso Orange It work correctly, but if i try from Orange to Orange It go to SPAM

                  
                  
                  X-me-spamcause : (125)(1000)gggruggvucftvghtrhhoucdtuddrgeduledrleekgdeijecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfogfdpggftiffpkfdpqfgfvfdpffgvsghughdqvfhmphfhihhlvgenuceurghilhhouhhtmecugedttdenucfjvggruggvrhcuvghrrhhorhculdehtddmnefpohcuuggrthgvuchfihgvlhguucdlgeelmdenogfqfgfvqdetgedtkedqtddvqdhtvghrucdluddmnegotffhvedqqdfjughrqdfuuhhsphgvtghtqdhlohifucdlhedmnegotffhvedqqdfjughrqdfuuhhsphgvtghtucdlvddtmdenucfjughrpefhvffugggttgfgsehtjedtredttdejnecuhfhrohhmpeeorhgvnhiiohdrmhhishgthhhirghnthhisehorhgrnhhgvgdrfhhrqeenucggtffrrghtthgvrhhnpeekvdegffeuieekhfdvueeitdetvedugfejveeivddvledvvedtgffgvdefhfelleenucfkphepvdduvddrvdduiedrvdduuddrudekvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehmihhstghhihgrnhhtihempdhinhgvthepvdduvddrvdduiedrvdduuddrudekvddpmhgrihhlfhhrohhmpehrvghniihordhmihhstghhihgrnhhtihesohhrrghnghgvrdhfrhdprhgtphhtthhopehrvghniihordhmihhstghhihgrnhhtihesghhmrghilhdrtghomhdprhgtphhtthhopehrvghniihordhmihhstghhihgrnhhtihesohhrrghnghgvrd
                  
                  

                   

                  with error 125 (that it is greater than 100) at this link say that error > 100

                  There is an additional header called “X-ME-spam cause”. If the value in this first bracket is higher than 100, then Vade Secure has flagged your mail as spam.

                  And in the detail of message

                  Received : from opme11dod06nd1.rouen.francetelecom.fr ([10.79.5.102]) by opme11dob14nd1.rouen.francetelecom.fr with LMTP id MNDOK8P9PGDoWwAASTXmBw ; Mon, 01 Mar 2021 15:44:19 +0100,from opme11ppr01nd1.rouen.francetelecom.fr ([10.79.5.102]) by opme11dod06nd1.rouen.francetelecom.fr with LMTP id iIG2K8P9PGD+RQAAhj82FQ ; Mon, 01 Mar 2021 15:44:19 +0100,from mwinf5d03 ([10.79.5.102]) by opme11ppr01nd1.rouen.francetelecom.fr with LMTP id eOj5DsP9PGAYHAAAKPHnNg (envelope-from <renzo.mischianti@orange.fr>) for <renzo.mischianti@orange.fr>; Mon, 01 Mar 2021 15:44:19 +0100,from mischianti: ([212.216.211.182]) by mwinf5d03 with ME id b2kC2400L3wge1w032kDW4; Mon, 01 Mar 2021 15:44:19 +0100
                  

                  And you can check https://www.spamhaus.org/query/ip/212.216.211.182 that the FROM IP is market as spam.

                  So the result is that orange.fr with his service Vade Secure block orange.fr SMTP emails. You can try to write to your company to fix this wrong categorization.

                  Bye Renzo

                • #10292
                  Gilles

                    Hello, I still looked at the error message generated by the sending orange mailbox. He doesn’t talk about spam at all …
                    here is the message in question:
                    This is the mail system at host mwinf5d58.orange.fr.
                    I’m sorry to have to inform you that your message could not
                    be delivered to one or more recipients.

                    The mail system

                    <r.m@wanadoo.fr>: host back1g-mail01-01.me-wanadoo.net [10.232.119.68] said: 554
                    5.6.0 Message contains invalid header

                    I still looked in my spam I did not find anything!
                    On the orange mailboxes there is an unwanted folder there is nothing in it! …
                    What do you think?

                  • #10293
                    Gilles

                      I looked at this address:
                      https://www.spamhaus.org/query/ip/212.216.211.182 but I think this may be blocking the sending of your emails because you are in Italy …
                      That’s what I thought I understood from this link!
                      Me having a French IP address with Orange server there must not be this treatment in SPAM (well I think)

                    • #10294
                      Gilles

                        So you may not be able to test from Italy …

                        If you think you’ve found something else I can test if you send me the tests to do … on Arduino Mega with shield W5100

                        Thank You

                        PS: I will try to take stock with my Internet Service Provider (Orange) to find out if I can write from Italy with an orange email address.
                        If I can find someone competent (which I highly doubt) I will see you follow their response.

                      • #10312
                        Gilles

                          Hi, currently on my personal PC to read and send my mails I am using windows live mails version 2012 (Build 16.4.3564-1216)
                          I have looked at the server settings on my various emails (to see what is working well).
                          I use your program to create the sending of emails:

                          Send emails with attachments (v2.x library): Arduino Ethernet – 1


                          I receive the error code 554 with or without an attachment.

                          Mail sender of the arduino mega w5100 (xx@wanadoo.fr) the one who receives the error messages:
                          outgoing mail smtp.wanadoo.fr SMTP 25 no SSL
                          incoming mail pop.wanadoo.fr pop3 110 no SSL

                          1st receiver email (yy@gmail.com) the one that works in reception:
                          outgoing mail smtp.gmail.com SMTP 465 yes SSL
                          incoming mail imap.gmail.com IMAP 993 yes SSL
                          2nd receiver email (the one who does not receive) (zz@orange.fr):
                          outgoing mail smtp.orange.fr SMTP 25 no SSL
                          incoming mail pop.orange.fr pop3 995 yes SSL
                          I will try to change the sending and receiving messages in my program to see what happens and I tell you!

                        • #10353
                          Gilles

                            With my gmail address in emission I can not send an mail the serial monitor gives me:
                            9: 45: 59.650 -> piecejointe: 0
                            09: 45: 59.684 -> multiple recipients and attached files
                            09: 45: 59.718 -> Insecure client: 0
                            09: 46: 09.864 -> Status of sending WITHOUT attachment 1st time!
                            09: 46: 09.898 -> Status of the shipment:
                            09: 46: 09.932 -> 0
                            09: 46: 09.932 -> resp Code: 1
                            09: 46: 09.932 -> Description: SMTP Response TIMEOUT!

                            with these settings in the Arduino:
                            uint16_t SMTP_PORT = 465;
                            const char * smtp_server = “smtp.gmail.com”;
                            const char * email_login = “my mail@gmail.com”;
                            const char * email_from = “my mail@gmail.com”;
                            const char * name_from = “Gilles”;
                            const char * email_password = “Password”;

                            Same error message if I put port 465 on smtp.orange.fr or smtp.wanadoo.fr! (the secure port is not accepted …)

                            Unless you have to change another parameter of your library to accept secure outgoing connections …
                            I also tried to send emails from an orange address (instead of wanadoo) but I can also only send to gmail.com …
                            I just created a sendgrid account but can’t get it to work at the moment …
                            I put the following sketch:
                            EMailSender emailSend(“apikey”, “The key generated by sendgridZGKhOA.wjFCzdsmh3FRRDl4qa4Y1P7_dpZBjr1uJ4br2_Ilz_Q”, “Gi…m..-v..@orange.Fr”, “smtp.sendgrid.net”, 25 );

                             

                            I get the following code again on the serial monitor:

                            12: 05: 41.055 -> resp Code: 2
                            12: 05: 41.055 -> Description: Cannot connect to mail server

                            …..

                          • #10357
                            Gilles

                              OK, thanks
                              Would a w5500 shield support a secure connection?
                              Instead of a W5100 shield …

                               

                              I will look at the topic on Sendgrid although I managed to create an account, to obtain an api key it does not work maybe I would find the solution in the topic!
                              Bye

                              • #10360
                                Renzo Mischianti
                                Keymaster

                                  I don’t have w5500, i’m going to order one of that to do some test.

                                  Theorically it can support secure connection, but i think some test is needed.

                                   

                                  Bye Renzo

                              • #10358
                                Gilles

                                  I am going through the tutorials.
                                  We agree, is it your library that converts “apikey” and the password( “SG.FINTOFINTOFINTO.FINTOFINTO” to base 64?

                                  No need to already put it in base 64 in the Arduino sketch?

                                  In

                                  EMailSender emailSend(“apikey”, “SG.FINTOFINTOFINTO.FINTOFINTO”, “sender.mischianti@gmail.com”, “smtp.sendgrid.net”, 25 )

                                  Thank

                                  • #10361
                                    Renzo Mischianti
                                    Keymaster

                                      Yes the library convert in base 64, but the code you posted use smtp from orange not sendgrid.

                                      Bye Renzo

                                  • #10376
                                    Gilles

                                      I made other tests.
                                      I manage to receive emails from the Arduino on gmail, laposte.net and my work email …
                                      but not orange or wanadoo messaging!
                                      For each mailbox for which it works in the header of the mail, the Return-Path: <sender email address @ wanadoo.fr> is well filled, whereas when we have Return-Path: <> it does not work … I don’t know if this can help you …

                                      • #10379
                                        Renzo Mischianti
                                        Keymaster

                                          Hi,

                                          Return-Path: <>  is set by MAIL FROM: parameter, but is set by the SMTP server.

                                          It’s strange that is empty.

                                          Bye Renzo

                                      • #10377
                                        Gilles

                                          At the level of Sendgrid I cannot verify the integration since the mails do not work!

                                          Otherwise I tried to put username: “apikey” or the “name of my key” (ex: “test”) but nothing seems to work.

                                          I delete all the keys then recreate a single one named apikey (like that more dote on the name to put …)

                                          Do you really have to check the key by TELNET before it can work?

                                          I installed telnet on my windows but I don’t know much about it and the Sendgrid topics (https://sendgrid.com/docs/for-developers/sending-email/getting-started-smtp/) on this test seems wrong, just to connect me they say:
                                          smtp.sendgrid.net 25
                                          but you have to open smtp.sendgrid.net 25 (but it does not work: 421 cannot connect to SMTP server 54.228.39.88 (54.228.39.88:25) conect error 10060)
                                          You have to do smtp.sendgrid.net 587 to connect ..

                                          Do you really have to keep going for this to work?
                                          Thank you

                                        • #10391
                                          Gilles

                                            I just re pinged smtp.sengrid.net:
                                            sending a ‘ping’ request to smtp.sendgrid.net [52.57.139.126] server with 32 bytes
                                            request deadline exceeded.
                                            request deadline exceeded.
                                            request deadline exceeded.
                                            request deadline exceeded.
                                            Ping statistics for 52.57.139.126:
                                            packets: sent 4, received 0, lost = 4 (100%)

                                            • #10434
                                              Renzo Mischianti
                                              Keymaster

                                                Hi Gilles,

                                                you can try 252525, or 587 port for unencrypted connection, if you can’t use this ports mean that in your network these ports are blocked and you can’t use that.

                                                Bye Renzo

                                            • #10435
                                              Gilles

                                                With telnet I can connect to the sendgrid server with port 2525 and 587.
                                                I just made a test with port 2525 on my arduino sketch and it almost works I receive the mail on my gmail mailbox but once again not on orange or wanadoo mail …

                                                Weird also that port 25 is blocked …

                                                Do you think you can still find how to make it work directly with the Smtp.orange.fr server or at least authorize the reception of mail on an orange mailbox?
                                                thank you

                                                • #10437
                                                  Renzo Mischianti
                                                  Keymaster

                                                    Hi Gilles,

                                                    I send email without problem from GMail with esp8266 to orange.fr account, the problem is that Orange block the other provider.

                                                    So you must contact your  provider and try to unlock sendgrid, or they must suggest you an unencrypted service like send grid.

                                                    Bye Renzo

                                                • #10439
                                                  Gilles

                                                    I have already contacted my internet provider (Orange) I spent more than an hour with them without success …
                                                    They tell me that it comes from my sending program since I can send and receive from my orange boxes without problem except with the Arduino …

                                                     

                                                    • #10440
                                                      Renzo Mischianti
                                                      Keymaster

                                                        When you give me the account I try to send email with EMailSender and an esp8266, and It work correclty

                                                         

                                                        the library It’s ok, the problem is the provider.

                                                        Bye Renzo

                                                    • #10441
                                                      Gilles

                                                        I just gave it a try from my laposte.net mailbox (which I created for the occasion).
                                                        I managed to send the email from the arduino to my couriers: laposte.net, orange.fr, wanadoo.fr and gmail.com
                                                        Laposte.net uses the unsecured port 587.

                                                        So from my laposte.net mailbox it works great!

                                                        I suddenly tried with port 587 on orange that doesn’t change anything!
                                                        I am receiving on gmail.com and laposte.net but not on orange or wanadoo.
                                                        I still have the error message in the outbox 🙁 wanadoo.fr)
                                                        host back2p-mail02-02.me-wanadoo.net [10.223.128.72] said: 554
                                                        5.6.0 Message contains invalid header

                                                      • #10796
                                                        Gilles

                                                          I ordered on 03/04/21 a W5500 shield from Keystudio.
                                                          https://fr.aliexpress.com/item/33048122605.html?spm=a2g0s.9042311.0.0.3da26c37fyGbxf
                                                          Do you sometimes have a sketch to check if it works in SSL communication mode?

                                                          I also watched this tutorial:

                                                          Wiznet W5500 and ioShield-A What’s old is new again!

                                                          It says in this:
                                                          “The packet RAM on the W5500 has been made available as general storage for the host MCU. Both Tx and Rx RAM is available for use as required. This means that it is possible to augment the RAM on an Arduino Uno by 16kBytes”
                                                          Does this mean that if we associate a W5500 shield on an Arduino Uno we go from 2 k of dynamic memory to 16 kilo?
                                                          I plugged the shield on a Uno without seeing any difference … Did I understand correctly?
                                                          Thank you

                                                          • #11000
                                                            Renzo Mischianti
                                                            Keymaster

                                                              Hi Gilles,
                                                              yes you don’t see any difference because I think you must use SSClient for secure connection, and I must add secure support to the library.
                                                              I don’t have a w5500 shield, if I find one I try to add support.

                                                              You can try to add https://github.com/OPEnSLab-OSU/SSLClient to the library and instantiate the SecureClient with this.

                                                              Bye Renzo

                                                          • #10923
                                                            Gilles

                                                              Hi, I received a W5500 Ethernet shield from key studio:
                                                              https://fr.aliexpress.com/item/33048122605.html?spm=a2g0s.9042311.0.0.27426c37YP7DsC
                                                              Do you have a sketch to test sending email in SSL with this shield?

                                                              In addition I read at this address:

                                                              Wiznet W5500 and ioShield-A What’s old is new again!


                                                              this about the W5500:
                                                              The packet RAM on the W5500 has been made available as general storage for the host MCU. Both Tx and Rx RAM is available for use as required. This means that it is possible to augment the RAM on an Arduino Uno by 16kBytes (8kB Tx and 8kB Rx) which is 8x more than the ATmega328p has in total, and still maintain the same sized buffers available in the W5100, for example.

                                                              I did not understand correctly because I had believed that this shield increased the RAM by 16 K from 2 k to 16k but the Arduino IDE tells me that I still only have 2 k ….
                                                              Thank you

                                                          Viewing 19 reply threads
                                                          • You must be logged in to reply to this topic.
                                                          Exit mobile version