You are here

function _mailhandler_get_fromaddress in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 mailhandler.module \_mailhandler_get_fromaddress()

Determines 'from' address.

Determines 'from' address using either the mailbox setting or via the header.

Parameters

$header: Object message header information

$mailbox: Array mailbox settings

Return value

Array of the 'from' address and 'from' name

4 calls to _mailhandler_get_fromaddress()
MailhandlerAuthenticate::authenticate in plugins/mailhandler/authenticate/MailhandlerAuthenticate.class.php
Authenticates an incoming message.
MailhandlerAuthenticateDefault::authenticate in plugins/mailhandler/authenticate/MailhandlerAuthenticateDefault.class.php
Authenticates an incoming message.
MailhandlerAuthenticateTokenauth::authenticate in modules/mailhandler_tokenauth/plugins/mailhandler/authenticate/MailhandlerAuthenticateTokenauth.class.php
Authenticates an incoming message.
MailhandlerMultipleEmailAuthenticate::authenticate in modules/mailhandler_multiple_email/plugins/mailhandler/authenticate/MailhandlerMultipleEmailAuthenticate.class.php
Authenticates an incoming message.

File

./mailhandler.module, line 287
Retrieves email for posting as nodes and comments.

Code

function _mailhandler_get_fromaddress($header, $mailbox) {
  $fromheader = drupal_strtolower($mailbox->settings['fromheader']);
  $from = $header->{$fromheader};
  return array(
    $from[0]->mailbox . '@' . $from[0]->host,
    isset($from[0]->personal) ? $from[0]->personal : '',
  );
}