eTicket Community
September 02, 2010, 02:40:05 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to engage your customers? eTicket  will soon be incorporated into Help Center Live!, the Live Chat leader!
 
   Home   Help Search Login Register  
Quick Register
Choose username  Email                 
Verify password    Choose password 
I agree to Registration Agreement
Pages: [1]   Go Down
  Print  
Author Topic: base64 decoding fix for Windows Outlook  (Read 2867 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: (php)
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: (php)
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);
      }
}
« Last Edit: April 07, 2010, 05:07:15 AM by Hummdis » 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  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Windows Installation Installation Help & Software Support tyampoo 1 1041 Last post May 05, 2009, 11:39:38 AM
by jasonrobinson
Windows install working :) General Discussion richc 1 782 Last post March 01, 2010, 03:25:17 AM
by Hummdis

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 2.702 seconds with 24 queries.

Google visited last this page Yesterday at 04:22:53 PM