diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-05-28 10:37:33 +0200 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-05-28 10:37:33 +0200 |
commit | 770d1bb7a368cdaba8e7340b54fd4b13ffea66b8 (patch) | |
tree | e47786d170dacd9ca59569a8ff8e558e5d8b610c /include/email.php | |
parent | 5e01432c6f15714370f3fd4f07eaf35615052955 (diff) | |
parent | 69f014d02b0d53ac2b42cbebe3d30418a2d0f612 (diff) | |
download | volse-hubzilla-770d1bb7a368cdaba8e7340b54fd4b13ffea66b8.tar.gz volse-hubzilla-770d1bb7a368cdaba8e7340b54fd4b13ffea66b8.tar.bz2 volse-hubzilla-770d1bb7a368cdaba8e7340b54fd4b13ffea66b8.zip |
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'include/email.php')
-rw-r--r-- | include/email.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/include/email.php b/include/email.php index 7e0351e94..1f485e430 100644 --- a/include/email.php +++ b/include/email.php @@ -12,20 +12,27 @@ function email_connect($mailbox,$username,$password) { function email_poll($mbox,$email_addr) { if(! ($mbox && $email_addr)) - return array();; + return array(); - $search = imap_search($mbox,'FROM "' . $email_addr . '"', SE_UID); + $search1 = imap_search($mbox,'FROM "' . $email_addr . '"', SE_UID); + if(! $search1) + $search1 = array(); $search2 = imap_search($mbox,'TO "' . $email_addr . '"', SE_UID); + if(! $search2) + $search2 = array(); - if($search && $search2) - $res = array_merge($search,$search2); - elseif($search) - $res = $search; - else - $res = $search2; + $search3 = imap_search($mbox,'CC "' . $email_addr . '"', SE_UID); + if(! $search3) + $search3 = array(); - return (($res) ? $res : array()); + $search4 = imap_search($mbox,'BCC "' . $email_addr . '"', SE_UID); + if(! $search4) + $search4 = array(); + + $res = array_unique(array_merge($search1,$search2,$search3,$search4)); + + return $res; } |