parsing raw email in php
        Posted  
        
            by Uberfuzzy
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Uberfuzzy
        
        
        
        Published on 2008-08-15T23:50:17Z
        Indexed on 
            2010/04/11
            8:43 UTC
        
        
        Read the original article
        Hit count: 374
        
i'm looking for good/working/simple to use php code for parsing raw email into parts.
i've written a couple of brute force solutions, but everytime, one small change/header/space/something comes along and my whole parser fails and the project falls apart.
and before i get pointed at PEAR/PECL, i need actual code. my host has some screwy config or something, i can never seem to get the .so's to build right. if i do get the .so made, some difference in path/environment/php.ini doesnt always make it available (apache vs cron vs cli)
oh, and one last thing, i'm parsing the raw email text, NOT pop3, and NOT imap. its being piped into the php script via a .qmail email redirect.
i'm not expecting SOF to write it for me, i'm looking for some tips/starting points on doing it "right". this is one of those "wheel" problems that i know has already been solved.
© Stack Overflow or respective owner