| @@ 439-458 (lines=20) @@ | ||
| 436 | * |
|
| 437 | * @return mixed|null|string |
|
| 438 | */ |
|
| 439 | protected function _getReversePath(Swift_Mime_Message $message) |
|
| 440 | { |
|
| 441 | $return = $message->getReturnPath(); |
|
| 442 | $sender = $message->getSender(); |
|
| 443 | $from = $message->getFrom(); |
|
| 444 | $path = null; |
|
| 445 | ||
| 446 | if (!empty($return)) { |
|
| 447 | $path = $return; |
|
| 448 | } elseif (!empty($sender)) { |
|
| 449 | // don't use array_keys |
|
| 450 | reset($sender); // reset Pointer to first pos |
|
| 451 | $path = key($sender); // get key |
|
| 452 | } elseif (!empty($from)) { |
|
| 453 | reset($from); // reset Pointer to first pos |
|
| 454 | $path = key($from); // get key |
|
| 455 | } |
|
| 456 | ||
| 457 | return $path; |
|
| 458 | } |
|
| 459 | ||
| 460 | /** |
|
| 461 | * Throw a TransportException, first sending it to any listeners. |
|
| @@ 293-310 (lines=18) @@ | ||
| 290 | * |
|
| 291 | * @return mixed|null|string |
|
| 292 | */ |
|
| 293 | private function _getReversePath(Swift_Mime_Message $message) |
|
| 294 | { |
|
| 295 | $return = $message->getReturnPath(); |
|
| 296 | $sender = $message->getSender(); |
|
| 297 | $from = $message->getFrom(); |
|
| 298 | $path = null; |
|
| 299 | if (!empty($return)) { |
|
| 300 | $path = $return; |
|
| 301 | } elseif (!empty($sender)) { |
|
| 302 | $keys = array_keys($sender); |
|
| 303 | $path = array_shift($keys); |
|
| 304 | } elseif (!empty($from)) { |
|
| 305 | $keys = array_keys($from); |
|
| 306 | $path = array_shift($keys); |
|
| 307 | } |
|
| 308 | ||
| 309 | return $path; |
|
| 310 | } |
|
| 311 | ||
| 312 | /** |
|
| 313 | * Return php mail extra params to use for invoker->mail. |
|