public function MailhandlerAuthenticateDefault::authenticate in Mailhandler 7.2
Same name and namespace in other branches
- 6.2 plugins/mailhandler/authenticate/MailhandlerAuthenticateDefault.class.php \MailhandlerAuthenticateDefault::authenticate()
Implements authenticate().
Overrides MailhandlerAuthenticate::authenticate
File
- plugins/
mailhandler/ authenticate/ MailhandlerAuthenticateDefault.class.php, line 15 - MailhandlerAuthenticateDefault class.
Class
- MailhandlerAuthenticateDefault
- Default authentication mechanism.
Code
public function authenticate(&$message, $mailbox) {
list($fromaddress, ) = _mailhandler_get_fromaddress($message['header'], $mailbox);
$uid = 0;
if ($from_user = user_load_by_mail($fromaddress)) {
$uid = $from_user->uid;
}
return $uid;
}