[dev] Re: [cvs] commit: horde/lib MIME.php horde/lib/MIME Message.php Part.php

Michael M Slusarz slusarz at bigworm.colorado.edu
Fri Jul 18 13:34:16 PDT 2003


Quoting Jan Schneider <jan at horde.org>:

| Zitat von Michael M Slusarz <slusarz at bigworm.colorado.edu>:
|
| > slusarz     2003/07/18 13:11:11 PDT
| >
| >   Modified files:
| >     lib                  MIME.php
| >     lib/MIME             Message.php Part.php
| >   Log:
| >   Revert (partially) Jan's commit.  We will continue to have
| > wrapHeaders() do
| >   RFC 2822 breaking by default.  But, as I've tried to make clear in
| > MIME_Part,
| >   we do *NOT* internally store data with CRLF, only LF.  Thus, mixing
| and
| >   matching linebreaks will cause havoc with mailers (the PHP Mail PEAR
| > classes
| >   automatically convert from LF to CRLF).
| >   Instead, add option to wrapHeaders() to allow for user-defined CRLF
| >   determination; this allows us to use the current EOL value in
| MIME_Part
| >   consistently.
| >   Jan, whatever problem you were having pre-commit, let me know.  All I
| > know is
| >   that the "\n" only wrapping seemed to be working fine for everyone
| else
| > for ~5
| >   months, and once you changed to "\r\n" things started to break all
| over
| > the
| >   place. :(
|
| The problem occurs if you save a draft containing wrapped headers (mostly
| Received: headers) while using a Cyrus server that *requires* linebreaks
| being CRLF as per RFC 2822.
| In this case the headers won't pass the PEAR:Mail of course.

OK. In that case we can do what we do when stripping attachments.  From
imp/lib/Message.php (line 331):

        /* We need to make sure we add "\r\n" after every line for
           imap_append() - some servers require it (e.g. Cyrus). */
        $message->setEOL(MIME_PART_RFC_EOL);

So we should do this anyway _anytime_ before passing into imap_append(),
since it doesn't seem to negatively affect any other IMAP server (i.e.
Courier doesn't care if it is either "\n" or "\r\n", so might as well feed
it "\r\n").

michael

______________________________________________
Michael Slusarz [slusarz at bigworm.colorado.edu]
The University of Colorado at Boulder


More information about the dev mailing list