NYCPHP Meetup

NYPHP.org

[nycphp-talk] IMAP function imap_rfc822_parse_headers

Hans Zaunere hans at nyphp.org
Wed Nov 20 22:07:39 EST 2002


--- Jean B Flamand <jean at ufinity.com> wrote:
> Thanks a lot Hans, 
> 
> Now I manage to use this function , you need to replace all \
 by \\r\


Ahh, yeah, damn email standards  :)  The RFCs say only \\r\
 are allowed, but
most MTAs etc do only \
 - a real mess <rant>and RFCs don't help much!</rant>

> before sending the string to the function, but now it appears that there
> are some limitation to this function... 
> With php 2.2.3 the number of address in the field "to" is forced to a
> max of 140... If nore than 140 the function crashes badly... 
> But it works fine wit php 2.2.2 !!! 
> Gotta go in the C code of 2.2.3 to clear this up :(

Good luck.. from what I've seen, parts of this extension are a bit rough. 
Mailparse, which should be stable in 4.3 (and has been moved to PECL) looks
promising.

As I've been rewriting the mailing list software for NYPHP, I wrote a fairly
robust class and set of functions for parsing emails.  It's still a little
rough and lacks some features, but has worked well in testing.  I've attached
it, and feel free to rip what you want from it, and better yet, see where it
flops and let me know :)

Best,

Hans


> 
> -----Original Message-----
> From: Hans Zaunere [mailto:hans at nyphp.org] 
> Sent: Thursday, November 21, 2002 2:17 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] IMAP function imap_rfc822_parse_headers
> 
> 
> 
> --- Jean B Flamand <jean at ufinity.com> wrote:
> > Hi all
> >  
> > imap_rfc822_parse_headers 
> > <http://www.php.net/manual/en/function.imap-rfc822-parse-headers.php>
> > (StringHeader) return an Object with all properties of the header.
> >  
> > My Probem : I m trying to parse a normal mail header with this 
> > function. It normally returns an object , but in my case this object 
> > is empty, i tried on several headers the problem keeps repeating ! Do 
> > you know if there s any "pre" parsing to do on the string or if you 
> > had any problem with this function can you tell me what happened to 
> > you
> 
> I haven't used this function myself, but consider a couple things:
> 
> -- what kind of line termination are you using?  I think these functions
> may have had some issues with \\r\
 vs \
 vs \
\\r
> 
> -- Try a *very* simple header, ie:
> $test_header = "From: blah at hah.com\\r\
To:to at woo.com\\r\
\\r\
";
> 
> -- do other functions from this extension work?  Check that they're
> configured properly, and it can find the c-client libs.
> 
> Hans
>


=====
Hans Zaunere
New York PHP
http://nyphp.org
hans at nyphp.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pmail.inc
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20021120/8b640a68/attachment.ksh>


More information about the talk mailing list