Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

2505 Posts in 648 Topics- by 1314 Members - Latest Member: Saudi Arabia

eTicket CommunitySupportTips & Tricks (Moderators: jason, Hummdis)Topic: base64 decoding fix for Windows Outlook
Pages: [1]   Go Down
Print
Author Topic: base64 decoding fix for Windows Outlook  (Read 1891 times)
0 Members and 1 Guest are viewing this topic.
Orion
New Member
*

Karma: +1/-0
Offline Offline

Posts: 12


« on: March 19, 2009, 08:51:26 AM »

I needed to be able to have users submit/reply to tickets via email using Outlook on Windows machines.  Currently, eTicket doesn't handle emails that have content-transfer-encoding set to base64.

This is an ugly hack and since I am really new to PHP, this might have some logic errors in it. 

In pipe.php change:

Code:
fclose($incoming);
$parse = new Parser($email);
if ($parse->message['html']) {
    $body = strip_tags($parse->message['html']);
} elseif ($parse->message['plain']) {
    $body = $parse->message['plain'];
} else {
    $body = $parse->plain;

to this:

Code:
fclose($incoming);
$parse = new Parser($email);
$replacables = array("\r", "\n", "\r\n", "\n\r");
if ($parse->message['html']) {
    $body = strip_tags($parse->message['html']);
    $output = str_replace($replacables,"", $body);
    if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $output)) {
      $body = base64_decode($output);
      }
} elseif ($parse->message['plain']) {
    $body = ($parse->message['plain']);
    $output = str_replace($replacables,"", $body);
    if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $output)) {
      $body = base64_decode($output);
      }
} else {
    $body = $parse->plain;
$output = str_replace($replacables,"", $body);
    if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%', $output)) {
      $body = base64_decode($output);
      }
}
Logged
PureThree
New Member
*

Karma: +0/-0
Offline Offline

Posts: 1


« Reply #1 on: May 31, 2009, 08:53:01 PM »

I think this code will be a real help for me and i really need this information thanks for sharing. ,





_________________
affordable SEO companies | thatcom


Logged
eTicket Community
   

 Logged
Pages: [1]   Go Up
Print
eTicket CommunitySupportTips & Tricks (Moderators: jason, Hummdis)Topic: base64 decoding fix for Windows Outlook
Jump to: