0

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?

1 Answer 1

1

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.

3
  • sigh typical microsoft :D
    – BenGC
    Jul 13, 2011 at 13:34
  • 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?
    – proximus
    Jul 14, 2011 at 8:44
  • 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=...>)
    – the-wabbit
    Jul 16, 2011 at 6:37

You must log in to answer this question.

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