PHWinfo banniere

ACCUEIL ANNUAIRE ARTICLES COMPARATIF HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Go Back   PHWinfo > Forums Hébergement > Forum Panels et Logiciels d'hébergement > comp.mail.sendmail > sendmail maximum line length
FAQ Members List Search Today's Posts Mark Forums Read
comp.mail.sendmail Configuring and using the BSD sendmail agent.

sendmail maximum line length

Reply
 
Thread Tools
Old 11/07/08, 22:32   #1
Nathalie
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default sendmail maximum line length

I'm trying so send an e-mail with PHP and sendmail. The problem is that some
lines in my email have more than 2040 characters. This lines are split by
sendmail and ! character is inserted. Do you know if we can increase this
limit of 2040 characters ? What maximum line length can be handle by
sendmail ?

Thanks per advance for your answers.


  Reply With Quote
Old 11/08/08, 00:11   #2
Per Hedeland
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: sendmail maximum line length

In article <4914c1f2$0$891$ba4acef3@news.orange.fr> "Nathalie"
<voisin.nat@wanadoo.fr> writes:
>I'm trying so send an e-mail with PHP and sendmail. The problem is that some
>lines in my email have more than 2040 characters. This lines are split by
>sendmail and ! character is inserted. Do you know if we can increase this
>limit of 2040 characters ? What maximum line length can be handle by
>sendmail ?


Sendmail can and does handle any length, it's just that since the
standards forbid lines longer than 998 characters, it has to handle such
non-compliant lines by folding them, or the next-hop MTA might reject
the message, or truncate the lines instead of handling them, or crash...

The proper fix for your problem is to send messages that follow the
standards, which are designed for *text*, which never has such long
lines. If your message content isn't text, you should use a proper MIME
transport encoding, e.g. quoted-printable, which will fold your lines in
a way that can be undone by the recipient MUA (or some other program at
the recipient end).

It *is* also possible to raise the "folding limit", via the L= parameter
in the mailer definition, but this is a bad idea for the above reasons.
The "standard" esmtp mailer has L=990 to ensure standards compliance, it
is just the "relay" mailer that has L=2040, on the assumption that it
will be sedning to another instance of sendmail or an equally line-
length-tolerant MUA (it is used e.g. for mail forwarded to a
SMART_HOST).

--Per Hedeland
per@hedeland.org
  Reply With Quote
Old 11/08/08, 23:07   #3
Nathalie
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: sendmail maximum line length


"Per Hedeland" <per@hedeland.org> a écrit dans le message de news:
gf2lf0$31l$1@hedeland.org...
> In article <4914c1f2$0$891$ba4acef3@news.orange.fr> "Nathalie"
> <voisin.nat@wanadoo.fr> writes:
>>I'm trying so send an e-mail with PHP and sendmail. The problem is that
>>some
>>lines in my email have more than 2040 characters. This lines are split by
>>sendmail and ! character is inserted. Do you know if we can increase this
>>limit of 2040 characters ? What maximum line length can be handle by
>>sendmail ?

>
> Sendmail can and does handle any length, it's just that since the
> standards forbid lines longer than 998 characters, it has to handle such
> non-compliant lines by folding them, or the next-hop MTA might reject
> the message, or truncate the lines instead of handling them, or crash...
>
> The proper fix for your problem is to send messages that follow the
> standards, which are designed for *text*, which never has such long
> lines. If your message content isn't text, you should use a proper MIME
> transport encoding, e.g. quoted-printable, which will fold your lines in
> a way that can be undone by the recipient MUA (or some other program at
> the recipient end).
>
> It *is* also possible to raise the "folding limit", via the L= parameter
> in the mailer definition, but this is a bad idea for the above reasons.
> The "standard" esmtp mailer has L=990 to ensure standards compliance, it
> is just the "relay" mailer that has L=2040, on the assumption that it
> will be sedning to another instance of sendmail or an equally line-
> length-tolerant MUA (it is used e.g. for mail forwarded to a
> SMART_HOST).
>
> --Per Hedeland
> per@hedeland.org



So the RFC 2821 and 5321 define a maximum line length :
The maximum total length of a text line including the <CRLF> is 1000
octets (not counting the leading dot duplicated for transparency).
This number may be increased by the use of SMTP Service Extensions.

Tell if i'm right :
all MTAs must handle this maximum
some MTA can handle a greater maximum

Is there other maximum line lenght guaranteed by all MTA ?


  Reply With Quote
Old 11/19/08, 18:22   #4
Grant Taylor
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: sendmail maximum line length

On 11/19/08 12:05, taylorcw@gmail.com wrote:
> I'm running into this issue as well. I'm using perl for example to
> span a message to sendmail, how would you encode the message so that
> it meets the RFC standards?


You will need to enhance / alter your Perl code to output correctly
formatted (from RFC (2)822's point of view) email messages to pipe them
in to Sendmail. Or optionally you could write (what I call) a ""shim
program that sits in between your Perl code and Sendmail to do the
formatting for you.

Either way, this is an issue with the Perl code and not Sendmail. Other
Perl related news groups / mailing lists would be a better place to ask.
Or if you would like, you can email me directly off news group and
I'll give you some pointers from the code that I've hacked together.



Grant. . . .

  Reply With Quote
Old 11/19/08, 18:40   #5
Ralf Döblitz
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: sendmail maximum line length

taylorcw@gmail.com wrote:
>
> I'm running into this issue as well. I'm using perl for example to
> span a message to sendmail, how would you encode the message so that
> it meets the RFC standards ?


Use MIME::Lite and set the transfer-encoding to quoted-printable.

Ralf
--
Ralf Döblitz * Schapenstraße 6 * 38104 Braunschweig * Germany
Phone: +49-531-2361223 Fax: +49-531-2361224 mailto:doeblitz@doeblitz.net
Homepage: http://www.escape.de/users/selene/
Mit UTF-8 kann man gleichzeitig äöüßÄÖÜæœłø‱¼½¾¤¹²³¢€£¥¶ §¬÷×±©®™¡¿ verwenden…
  Reply With Quote
Old 11/20/08, 13:48   #6
bb
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: sendmail maximum line length

On 2008-11-19 19:05, taylorcw@gmail.com wrote:
> I'm running into this issue as well. I'm using perl for example to
> span a message to sendmail, how would you encode the message so that
> it meets the RFC standards ?
>
> Thanks


For RFC 1855 , just include some text you reply to
and write your reply under it. :-)

/bb
  Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 09:24.


Powered by vBulletin® ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
PHWinfo is a website Education Without Frontiers
Ad Management by RedTyger
All rights reserved
Page generated in 0.31262 seconds with 7 queries