views:

52

answers:

2

does anyone know if there's a class out there that parses courier mailboxes (ie: courier imap mail server)? returning lists, and parsing individual messages?

this is not a protocol issue, i'm not interested in connecting to a remote mail-server. rather, i'm interested in manipulating the local mail-server via filesystem.

In particular, the mails are kept in files, but those do not contain the "from" email address, i am completely puzzled by this and more issues. Does anybody have any experience with this?

+1  A: 

Maybe the Zend_Mail component of Zend Framework might help, here ?

(If it's like several other components of ZF, it might be do-able to "extract" it from the framework, to use it as some standalone component)

Quoting a portion of this page : Reading Mail Messages :

Zend_Mail can read mail messages from several local or remote mail storages.

And there is table of features :

Feature                Mbox     Maildir  Pop3     IMAP
Storage type           local    local    remote   remote
Fetch message          Yes      Yes      Yes      Yes
Fetch MIME-part        emulated emulated emulated emulated
Folders                Yes      Yes      No       Yes
Create message/folder  No       todo     No       todo
Flags                  No       Yes      No       Yes
Quota                  No       Yes      No       No

So it seems Zend_Mail is able to do at least some manipulations on "local" mail -- including reading them (Not sure whether Courrier uses Mbox or Maildir, but as both are supported...).

Pascal MARTIN
thanks for you effort (+1), but after some testing, zend appears to do little more than give me access to a file i already have access to :) and then add some mess you need to basically parse ourself.
Nir Gavish
Ergh :-( too bad :-( *(but good to know ! Thanks for your comment ! )*
Pascal MARTIN
well, to be more specific (and to open the door to being corrected) - zend felt like it's "too loose" - leaving the programmer with the tasks of converting character encoding, handling parts (in multipart) etc. i may have dug deeper if it wasn't the zend framework, but it seemed to echo the general philosophy of the framework, so i gave up.
Nir Gavish
A: 

after some searching, this class: http://www.phpclasses.org/browse/package/3169.html#download does a pretty decent job at parsing the raw mail message, thank you guys for helping out.

Nir Gavish