get meta info for email msgs

This commit is contained in:
Friendika 2011-04-16 01:14:25 -07:00
parent 27cbb830a7
commit c7bcdf0c18
1 changed files with 9 additions and 2 deletions

View File

@ -12,10 +12,10 @@ function email_connect($mailbox,$username,$password) {
function email_poll($mbox,$email_addr) { function email_poll($mbox,$email_addr) {
if(! ($mbox && $email_addr)) if(! ($mbox && $email_addr))
return false; return array();;
$search = imap_search($mbox,'FROM "' . $email_addr . '"', SE_UID); $search = imap_search($mbox,'FROM "' . $email_addr . '"', SE_UID);
return $search; return (($search) ? $search : array());
} }
@ -27,6 +27,13 @@ function construct_mailbox_name($mailacct) {
} }
function email_msg_meta($mbox,$uid) {
$ret = (($mbox && $uid) ? imap_fetch_overview($mbox,$uid,FT_UID) : array(array()));
return ((count($ret)) ? $ret[0] : array());
}
function getmsg($mbox,$mid) { function getmsg($mbox,$mid) {
// input $mbox = IMAP stream, $mid = message id // input $mbox = IMAP stream, $mid = message id
// output all the following: // output all the following: