Hello, when i send a newsletter, some mail has not been delivered.
The error is:
SMTP error from remote mail server after end of data:
host example.com [xx.xx.xx.xx]:
500 Line too long

I think the problem is in simplenews that include site css in html message in the same line. My theme have many css, and all in one line is too long!

Maybe, simplenews use a cached css... It's possibile to use the css without cache?

Regards.

Comments

Breakerandi’s picture

subscribe, I got the same problem.. I don't know, perhaps its an Mime Mail issue?

rstauss’s picture

Same problem here but not (only) with Simplenews. I guess its Mime Mail, too, because it happens also with Notify.

sutharsan’s picture

Project: Simplenews » Mime Mail
Version: 6.x-1.0-rc6 » 6.x-1.x-dev

If it is a problem with included CSS, it is not Simplenews. Another possibility is too long URL's, please check.
Always test with the latest dev release of simplenews and mime mail.

Moving to Mime Mail as it seems to be CSS related.

miro_dietiker’s picture

Status: Active » Closed (duplicate)

This might be a problem with one of your involved files like CSS.

But it might also be due to the CSS pseudo-compression in term of being removed.
#448670: Spaces and Line Breaks are removed from CSS definitions

Marking it duplicate since correcting the CSS fixed exactly that for me.

sutharsan’s picture

Note that '500 Line too long' can also occur when the email contains a very long URL. One solution is to encode the email content using base64_encode() (the flip side is that the email size increases 33%).

Anonymous’s picture

Status: Closed (duplicate) » Needs work

I encountered the same problem with the "Nemesis ESMTP" server used and developed by Schlund & Partner (1&1).

I'm not sure if this is a problem with Mime Mail, with Drupal itself or with PHP but I just wasted two days trying to find out what's wrong. Here are my findings.

When sending long E-Mails in HTML format such as newsletters produced by the Simplenews module, the 1&1 mail servers refuse to accept the mail.

I narrowed it down to a problem with the linebreak format. The problem is that the message body is sent with Linux style linebreaks (LF) and Nemesis ESMTP doesn't seem to support that. It ignores the linebreaks and throws a "500 line limit exceeded" error as the message body obviously contains too many characters per line.

I implemented an alternative mail engine in one of my modules that replaces LF with CRLF before sending the message and that fixed the problem.

The Drupal website that is affected by this problem is running on Windows, using hMail as the MTA of choice. This problem did not occur on a similar Drupal website on a Linux system. It seems the Linux MTA used there automatically replaces LF with CRLF before forwarding the message to the remote server.

I verified this by sending newsletters from both websites to different mail addresses. The mails produced by the Windows system use LF, the mails produced by the Linux system use CRLF. The mails using CRLF pass without problems. The mails using only LF are rejected.

sgabe’s picture

Status: Needs work » Closed (duplicate)

@Chi-Yu: I think what you described here is more like a Drupal core issue, since drupal_wrap_mail() deliberately converts CRLF into LF and IMHO this issue is still a duplicate of #448670: Spaces and Line Breaks are removed from CSS definitions what caused such problems like this one.

function drupal_wrap_mail($text, $indent = '') {
  // Convert CRLF into LF.
  $text = str_replace("\r", '', $text);
  ...
Anonymous’s picture

The issues might be related but they are not the same.

#448670: Spaces and Line Breaks are removed from CSS definitions describes a problem with CSS definitions and content which is in fact longer than the allowed maximum line length.

What I'm describing here is a case where the content is inside this limit but the mail server will still issue the "500 line limit exceeded" error.

You can have a linebreak after every single word. If the message body is long enough, the mail server will still reject the message as it simply doesn't understand LF and treats the message body as a single line.

Please explain how this is a duplicate?

sgabe’s picture

@Chi-Yu: I think you have misunderstood my post: This issue here with number 436474 is a duplicate. What you experience is another one and not related to this one, because this problem was fixed with #448670: Spaces and Line Breaks are removed from CSS definitions. As I mentioned above I think what you described is not even a Mime Mail issue irrespectively of the error message. See my previous post about drupal_wrap_mail().