Joey Smith:
> On Fri, Aug 21, 2009 at 04:55:31PM +0100, Chris Smith wrote:
> > 
> > I've encountered difficulties utilising the mail() function properly
> > under a NIX environments while conforming to RFC 2822. There two
> > specific issues, one is a code problem the other a documentation
> > issue they are intertwined so I thought best run it by here and see
> > that people understand the issue before I head to the bug tracker.
> > 
> > As you are no doubt aware mail() operates using the system sendmail
> > interface under NIX environments, and under Windows it either utilises a
> > sendmail binary or more commonly the SMTP feature. The problem stems
> > from confusion and inappropriate application of the SMTP standards to
> > the sendmail interface.
> > 
> > Under a NIX environment the sendmail interface operates taking an e-mail
> > message constructed using the system line ending, LF. I've confirmed
> > this applies to the Postfix sendmail interface [1], and could ask other
> > vendors.
> 
> 1) Maybe you could go back to Wietse and ask him to justify the
> seemingly contradictory assertions that "text is expected to be
> in native UNIX stream-LF format" [1] but "Postfix receives local
> submissions in (LF or CRLF) format" [2]  and "Postfix looks at 
> the first input line [to determine what format you are using]" [3]?
> It's hard to know what to tell PHP developers when we get mixed
> messages from someone like Wietse...

The Postfix sendmail command prefers input in native UNIX stream-lf
format. Postfix will jump some hoops for software that wants to
use the non-native CRLF format. It uses a switch (going from using
LF to using CRLF) and therefore it won't accept mixed line endings.

> 4) I don't write/maintain an MTA, but it seems like you're conflating
> SMTP and the "local pipe to a sendmail binary" conversation where it

If you want email to survive the limitations of SMTP, then you need
to submit the email message in a format that is compatible with
the limitations of SMTP. It is not the job of MTAs to automagically
fold and unfold long lines.

> Note: I just fed exim a 12000 character long subject from PHP and exim
> wrapped it before sending it to the other end of the SMTP conversation.
> Are you saying that Postfix does not do this?

I would expect that a user agent (such as /usr/bin/mail, Mutt etc.)
would do the header folding, not the MTA. In fact, am not aware of
any RFC that requires MTAs to wrap long message headers, but I am
willing to be corrected by someone who can refer me to the document.

        Wietse

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to