Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- maildaemon.php 2008-09-18 12:11:19.000000000 +0900
- +++ maildaemon.php.new 2008-09-18 12:36:11.000000000 +0900
- @@ -29,6 +29,7 @@
- require_once(INSTALLDIR . '/lib/common.php');
- require_once(INSTALLDIR . '/lib/mail.php');
- +require_once('Mail/RFC822.php');
- require_once('Mail/mimeDecode.php');
- # FIXME: we use both Mail_mimeDecode and mailparse
- @@ -73,12 +74,12 @@
- }
- function user_from($from_hdr) {
- - $froms = mailparse_rfc822_parse_addresses($from_hdr);
- - if (!$froms) {
- + $froms = Mail_RFC822::parseAddressList($from_hdr);
- + if (PEAR::isError($froms)) {
- return NULL;
- }
- $from = $froms[0];
- - $addr = common_canonical_email($from['address']);
- + $addr = common_canonical_email($from->mailbox . '@' . $from->host);
- $user = User::staticGet('email', $addr);
- if (!$user) {
- $user = User::staticGet('smsemail', $addr);
- @@ -88,9 +89,9 @@
- function user_match_to($user, $to_hdr) {
- $incoming = $user->incomingemail;
- - $tos = mailparse_rfc822_parse_addresses($to_hdr);
- + $tos = Mail_RFC822::parseAddressList($to_hdr);
- foreach ($tos as $to) {
- - if (strcasecmp($incoming, $to['address']) == 0) {
- + if (strcasecmp($incoming, $to->mailbox . '@' . $to->host) == 0) {
- return true;
- }
- }
Add Comment
Please, Sign In to add comment