Guest User

Untitled

a guest
Jul 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1.  
  2. if (!empty($full_message)){
  3. checkForRedirectMail($full_message);
  4. }
  5.  
  6. function checkForRedirectMail($full_message)
  7. {
  8. $structure = Mime_Helper::decode($full_message, true, true);
  9. if (isset($structure->headers['to'])) {
  10. $issue_id = Routing::getMatchingIssueIDs($structure->headers['to'], 'email');
  11. if (false != ($new_issue_id = Issue::isIssueBelongToIvincoEventum($issue_id))) {
  12. $structure->headers['to'] = "issue-".$new_issue_id."@eventum.ivinco.com";
  13. $structure->headers['delivered-to'] = "issue-".$new_issue_id."@eventum.ivinco.com";
  14. $headers = '';
  15. foreach ($structure->headers as $key => $value){
  16. $headers .= "{$key}:{$value}\n";
  17. }
  18. $headers .="\n";
  19. $body = $structure->body;
  20. mail($structure->headers['to'], $structure->headers['subject'], $body, $headers);
  21. exit;
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment