Archives for: September 2009, 08

09/08/09

  12:50:05 pm, by The Dreamer   , 144 words  
Categories: General, Software

Making getmail.php work in b2evo 3.3.1

Once again the stock getmail.php didn't work after a significant upgrade in b2evolution version.

After a long and complicated battle, I have something that should work....we'll find out tomorrow.

First I had to do was add these two lines to 'inc/_core/_class5.funcs.php':

PHP

'mime_parser_class' => $inc_path.'_ext/mime_parser/mime_parser.php',
'rfc822_addresses_class' => $inc_path.'_ext/mime_parser/rfc822_addresses.php',

Should be obvious where they go....

Next problem was 'Could not parse data header!':

Changed preg_match to be:

PHP

if(!preg_match('#^(.{3}, )?(\d{1,2}) (.{3}) (\d{4}) (\d{2}):(\d{2}):(\d{2})#'$ddate$match))

Probably wouldn't have tripped me up if I had waited until September 10th to work on things further.... :>>

Then the final was that the 'html' email did not have an 'Alternative'.

Try this for size:

PHP

// mail is html
if( $parsedMIME['Type'] == 'html'){
    if (array_key_exists('Alternative',$parsedMIME)){
        foreach ( $parsedMIME['Alternative'] as $alternative ){
            if( $alternative['Type'] == 'text' ){
                echo_message'HTML alternative message part saved as ' $alternative['DataFile'], INFO);
                $strbody imap_qprintfile_get_contents$alternative['DataFile'] ) );
                break; // stop after first alternative
            }
        }
    } else {
        $strbody strip_tags(file_get_contents$parsedMIME['DataFile'] ),'<img><p><br><i><b><u><em><strong><strike><font><span><div><ul><li><a>');
    }
}
Now instead of subjecting some poor random forum to a long rambling thought, I will try to consolidate those things into this blog where they can be more easily ignored profess to be collected thoughts from my mind.

Latest Poopli Updaters -- http://lkc.me/poop

bloglovin

There are 20 years 1 month 3 days 11 hours 12 minutes and 16 seconds until the end of time.
And, it has been 4 years 11 months 25 days 2 hours 50 minutes and 40 seconds since The Doctor saved us all from the end of the World!

Search

September 2009
Mon Tue Wed Thu Fri Sat Sun
 << < Current> >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Google

Linkblog

  XML Feeds

Who's Online?

  • Guest Users: 2
This seal is issued to lawrencechen.net by StopTheHacker Inc.
powered by b2evolution free blog software

hosted by
Green Web Hosting! This site hosted by DreamHost.

monitored by
Monitored by eXternalTest
SiteUptime Web Site Monitoring Service
website uptime