# sfMailMimeDecodePlugin The sfMailMimeDecodePlugin provides a wrapper to the PEAR Mail_mimeDecode class [http://pear.php.net/package/Mail_mimeDecode] ## Overview The plugin provides a class to deal with the decoding and interpreting of MIME messages and mbox files. This format is used in UNIX systems and Mozilla Thunderbird to store messages of a mailbox From from@domain.com Wed Dec 5 11:16:41 2007 Return-Path: <returnpath@domain.com> Received: from server.domain.com (serverinternal.domain.com [10.0.0.1]) by server.domain.com (8.14.1/8.12.10) with ESMTP id XXXXXXXXXXXX for <to@domain.com>; Wed, 5 Dec 2007 11:16:41 +0100 Received: from received1@domain.com machine1.domain.com [10.0.0.1]) by server.domain.com (8.14.1/8.13.1) with ESMTP id XXXXXXXXXXXX for <to@domain.com>; Wed, 5 Dec 2007 11:16:41 +0100 Date: Wed, 5 Dec 2007 11:16:41 +0100 From: from@domain.com Message-Id: <XXXXXXXXXXXXXXXXXXXX@to.domain.com> To: to@domain.com Subject: [subject] Status: RO This is the body ## Installation * Uncompress the archive cd /path/to/your/symfony/project/plugins/ tar -xzf /path/to/sfMailMimeDecodePlugin-1.0.0.tgz * As usual, clear the cache symfony cc ## Usage <?php $mbox = file_get_contents('mbox_file'); $mail = new sfMailMimeDecode($mbox); echo $mail->getSubject(); // [subject] echo $mail->getFrom(); // from@domain.com echo $mail->getTo(); // to@domain.com echo $mail->getBody(); // This is the body echo $mail->getDate(); // Wed, 5 Dec 2007 11:16:41 +0100 echo $mail->getAttachments() // Array() ## Credits Class initially developped by [Richard Heyes] and the [http://pear.php.net/package/Mail_mimeDecode PEAR group](http://pear.php.net/package/Mail_mimeDecode) ## TODO * write tests for Thunderbird messages * write examples on how to handle attached files