You are here

function mailhandler_get_fromaddress in Mailhandler 5

Same name and namespace in other branches
  1. 6 mailhandler.module \mailhandler_get_fromaddress()
  2. 7 mailhandler.module \mailhandler_get_fromaddress()

If available, use the mail header specified in mailbox config. otherwise use From: header

3 calls to mailhandler_get_fromaddress()
mailhandler_authenticate in ./mailhandler.module
Determine who is the author of the upcoming node.
mailhandler_comment_submit in ./mailhandler.module
Create the comment.
mailhandler_node_submit in ./mailhandler.module

File

./mailhandler.module, line 429

Code

function mailhandler_get_fromaddress($header, $mailbox) {
  if (($fromheader = strtolower($mailbox['fromheader'])) && isset($header->{$fromheader})) {
    $from = $header->{$fromheader};
  }
  else {
    $from = $header->from;
  }
  return array(
    $from[0]->mailbox . '@' . $from[0]->host,
    $from[0]->personal,
  );
}