You are here

public function MailhandlerAuthenticateDefault::authenticate in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 plugins/mailhandler/authenticate/MailhandlerAuthenticateDefault.class.php \MailhandlerAuthenticateDefault::authenticate()

Authenticates an incoming message.

Parameters

$item: Array containing message headers, body, and mailbox information.

Overrides MailhandlerAuthenticate::authenticate

File

plugins/mailhandler/authenticate/MailhandlerAuthenticateDefault.class.php, line 9
MailhandlerAuthenticateDefault class.

Class

MailhandlerAuthenticateDefault
@file MailhandlerAuthenticateDefault class.

Code

public function authenticate(&$message, $mailbox) {
  list($fromaddress, $fromname) = _mailhandler_get_fromaddress($message['header'], $mailbox);
  $uid = 0;
  if ($from_user = user_load(array(
    'mail' => $fromaddress,
  ))) {
    $uid = $from_user->uid;
  }
  return $uid;
}