| @@ 398-417 (lines=20) @@ | ||
| 395 | * |
|
| 396 | * @return mixed|null|string |
|
| 397 | */ |
|
| 398 | protected function _getReversePath(Swift_Mime_Message $message) |
|
| 399 | { |
|
| 400 | $return = $message->getReturnPath(); |
|
| 401 | $sender = $message->getSender(); |
|
| 402 | $from = $message->getFrom(); |
|
| 403 | $path = null; |
|
| 404 | ||
| 405 | if (!empty($return)) { |
|
| 406 | $path = $return; |
|
| 407 | } elseif (!empty($sender)) { |
|
| 408 | // don't use array_keys |
|
| 409 | reset($sender); // reset Pointer to first pos |
|
| 410 | $path = key($sender); // get key |
|
| 411 | } elseif (!empty($from)) { |
|
| 412 | reset($from); // reset Pointer to first pos |
|
| 413 | $path = key($from); // get key |
|
| 414 | } |
|
| 415 | ||
| 416 | return $path; |
|
| 417 | } |
|
| 418 | ||
| 419 | /** |
|
| 420 | * Throw a TransportException, first sending it to any listeners. |
|
| @@ 267-284 (lines=18) @@ | ||
| 264 | * |
|
| 265 | * @return mixed|null|string |
|
| 266 | */ |
|
| 267 | private function _getReversePath(Swift_Mime_Message $message) |
|
| 268 | { |
|
| 269 | $return = $message->getReturnPath(); |
|
| 270 | $sender = $message->getSender(); |
|
| 271 | $from = $message->getFrom(); |
|
| 272 | $path = null; |
|
| 273 | if (!empty($return)) { |
|
| 274 | $path = $return; |
|
| 275 | } elseif (!empty($sender)) { |
|
| 276 | $keys = array_keys($sender); |
|
| 277 | $path = array_shift($keys); |
|
| 278 | } elseif (!empty($from)) { |
|
| 279 | $keys = array_keys($from); |
|
| 280 | $path = array_shift($keys); |
|
| 281 | } |
|
| 282 | ||
| 283 | return $path; |
|
| 284 | } |
|
| 285 | ||
| 286 | /** |
|
| 287 | * Return php mail extra params to use for invoker->mail. |
|