Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Multiple Reply Separator Tags // OR // Remove Email addresses from Email Body

Hi all

I'm looking to completely anonymise osTicket emails, so we have no visibility of the email addresses from the GUI.
I've managed to yoink out all of the osTicket fields which display the email/name/any identifying features, however...

I want to get rid of anything that looks like an email address in the body of the incoming email. For example, replied to headers:

Message text here lalalalalalalaa...


-----Original Message-----
To: joebloggs@gmail.com
From: osticket@mysite.com
Time: 01-01-1970 00:00:00
Subject: Arrrghhhh!



How would I go about modifying the script so it gets rid of the *@*.* parts of the email?
Or, alternatively, strip out anything after ----Original Message---- or multiple variations of the Reply Separator Tag that it already strips out from Incoming emails?

Does anyone have a script which allows for multiple Reply Separator Tags?

I'll love you forever if you can find a solution to my headache! 


Adam

p.s. This is a fantastic bit of software. We use it for running a charity and it has saved us no end of effort. You guys are fantastic!

Comments

  • Thanks for the kind words Adam! :)
    Sadly I don't have an answer for your actual question, but hopefully someone else might.
  • Hey. I sort of solved my own issue... I think!

    In class.mailfetch.php, I changed this:

            }else{
                $message=$var['message'];
                //Strip quoted reply...TODO: figure out how mail clients do it without special tag..
                if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()) && strpos($var['message'],$tag))
                    list($message)=split($tag,$var['message']);
                $msgid=$ticket->postMessage($message,'Email',$var['mid'],$var['header']);
            }


    To this:

            }else{
                $message=$var['message'];
                $extraSeparator = "-----Original Message-----";
                //Strip quoted reply...TODO: figure out how mail clients do it without special tag..
                if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()) && strpos($var['message'],$tag))
                    $message_replaced=str_replace($extraSeparator,$tag,$var['message']);
                    list($message)=split($tag,$message_replaced);
                $msgid=$ticket->postMessage($message,'Email',$var['mid'],$var['header']);
            }

    For those less techy: I changed the script so it 'finds and replaces' instances of a second separator with the original Reply Separator Tag (defined in the osTicket GUI). I wanted to cut off '-----Original Message-----' too as it was revealing headers on Microsoft-based email clients. 

    Hope that helps someone in the future! :)

    <3 you guys

Sign In or Register to comment.