Servers rejecting mails with "500 Line limit exceeded"

8,390

RFC 821 states the maximum line lengths for SMTP transmissions:

        command line

           The maximum total length of a command line including the
           command word and the <CRLF> is 512 characters.

        reply line

           The maximum total length of a reply line including the
           reply code and the <CRLF> is 512 characters.

        text line

           The maximum total length of a text line including the
           <CRLF> is 1000 characters (but not counting the leading
           dot duplicated for transparency).

I think your messages exceed one of the aforementioned limits - Exchange seems not to bother, but other servers will.

Share:
8,390

Related videos on Youtube

proximus
Author by

proximus

math, complexity, software engineering, e-commerce, trading, cuisine, globetrotting, calmness, courtesy, contentment

Updated on September 18, 2022

Comments

  • proximus
    proximus over 1 year

    I am dispatching a few mails (mainly order confirmations) from a webshop using a php mail class. The mails are sent via a local Exchange/SMTP server.

    In the majority of cases this works fine and customers receive HTML mails with PDF attachments. But in some cases customers complain about not receiving any mails at all.

    MS Exchange informs about mails rejected by several servers - all with the same error message:

    500 Line limit exceeded

    Does the problem derive from my mails / mail class or is it a server setting? What can I do to avoid it?

  • BenGC
    BenGC almost 13 years
    sigh typical microsoft :D
  • proximus
    proximus almost 13 years
    I suppose it exceeds the text line limit. We did a little further investigation and I am wondering that it bothers just one single mailserver provider and its configuration... Do I have to split my text body on Script-side in case of character amounts per line > 500 by \n (line-breaks), which would evoke problems concerning tags in HTML mails or is it a provider's problem which has to be solved?
  • the-wabbit
    the-wabbit almost 13 years
    As the limit is defined in the RFC, it is not the provider's problem. Yes, you should split your overlong lines. It should not create any problems with tags as long as you are not splitting within the tag itself (like <a \n href=...>)