/**
  * Implements authenticate().
  */
 public function authenticate(&$message, $mailbox)
 {
     list($fromaddress, ) = _mailhandler_get_fromaddress($message['header'], $mailbox);
     $uid = 0;
     if ($address = multiple_email_find_address($fromaddress)) {
         $uid = $address->uid;
     }
     return $uid;
 }
 public function authenticate(&$message, $mailbox)
 {
     list($fromaddress, $fromname) = _mailhandler_get_fromaddress($message['header'], $mailbox);
     $uid = 0;
     if ($from_user = array_shift(user_load_multiple(array(), array('mail' => $fromaddress)))) {
         $uid = $from_user->uid;
     }
     return $uid;
 }
 public function authenticate(&$message, $mailbox)
 {
     list($fromaddress, $fromname) = _mailhandler_get_fromaddress($message['header'], $mailbox);
     $uid = 0;
     if ($from_user = user_load_by_mail($fromaddress)) {
         $uid = $from_user->uid;
     }
     return $uid;
 }
 public function authenticate(&$message, $mailbox)
 {
     list($fromaddress, $fromname) = _mailhandler_get_fromaddress($message['header'], $mailbox);
     $uid = 0;
     // If user with given email address exists and their token is in the toaddress, allow.
     if (($from_user = array_shift(user_load_multiple(array(), array('mail' => $fromaddress)))) && strpos($header->to[0]->mailbox, tokenauth_get_token($from_user->uid)) !== FALSE) {
         $uid = $from_user->uid;
     }
     return $uid;
 }
 public function authenticate(&$message, $mailbox)
 {
     list($fromaddress, $fromname) = _mailhandler_get_fromaddress($message['header'], $mailbox);
     if ($address = multiple_email_find_address($fromaddress)) {
         $message['authenticated_uid'] = $address->uid;
     } else {
         // Authentication failed. Try as anonymous.
         $message['authenticated_uid'] = 0;
     }
 }
 /**
  * Authenticates an incoming message.
  *
  * @param $item
  *   Array containing message headers, body, and mailbox information.
  */
 public function authenticate(&$message, $mailbox)
 {
     list($fromaddress, $fromname) = _mailhandler_get_fromaddress($message['header'], $mailbox);
     $uid = 0;
     return $uid;
 }