Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!empty($full_message)){
- checkForRedirectMail($full_message);
- }
- function checkForRedirectMail($full_message)
- {
- $structure = Mime_Helper::decode($full_message, true, true);
- if (isset($structure->headers['to'])) {
- $issue_id = Routing::getMatchingIssueIDs($structure->headers['to'], 'email');
- if (false != ($new_issue_id = Issue::isIssueBelongToIvincoEventum($issue_id))) {
- $structure->headers['to'] = "issue-".$new_issue_id."@eventum.ivinco.com";
- $structure->headers['delivered-to'] = "issue-".$new_issue_id."@eventum.ivinco.com";
- $headers = '';
- foreach ($structure->headers as $key => $value){
- $headers .= "{$key}:{$value}\n";
- }
- $headers .="\n";
- $body = $structure->body;
- mail($structure->headers['to'], $structure->headers['subject'], $body, $headers);
- exit;
- }
- }
- }
Add Comment
Please, Sign In to add comment