Giter Club home page Giter Club logo

plugin-fwd-rewriter's Introduction

osTicket - Ticket Rewriter Plugin

Enables rewriting of email messages before a new ticket is created.

To install

  • Download master zip and extract into /include/plugins/rewriter
  • Then Install and enable as per normal osTicket Plugins

To configure

Visit the Admin-panel, select Manage => Plugins, choose the Ticket Rewriter plugin

Caveats:

  • Only works on Emails!
  • Assumes English.. Sorry, I don't speak enough of even one foreign language to write regex for them. Let me know if you've any ideas!
  • If you require user login, it won't rewrite a ticket to a non-existent user. Only tested with Registration disabled!
  • Assumes osTicket v1.10+ The API changes a bit between versions..

Admin Options

Email Forwarding rewriter configuration:

Ensures that the original sender of a message is preserved in the ticket metadata, and allows replies to go back to them.

  • Admin options allow you to specify which domains are allowed to be rewritten (ie, enter your company domain).
  • Admin option to parse/rewrite messages from Drupal Contact forms
  • Admin option to enable logging of actions into the osTicket admin logs

I suggest at least your "domain name", otherwise the forwarding detector will ignore all forwarded mail.

To start, you should probably enable logging. You can disable when you're done testing. (While code is prerelease, DEBUG has been left on, so you can see many log entries in your webserver logs, simply change that to FALSE in class.RewriterPlugin.php to stop them).

Delete Attachments:

  • A single checkbox that removes all attachments for inbound emails.
  • A textbox to enter "Department" names, or id's. Enter one here, and any attachments emailed to that department get's purged. Note, ATTACHMENTS.. still allows inline images, but all files are purged. If you want to purge everything, you can turn it off, or use the admin console to specify what files are attachable, or, simply check the box that removes all of them.

Drupal Contact Parser

If you use Drupal on any external websites, and don't use an API to talk to osTickets (ie, the Contact form simply emails your ticket system), you can use the Drupal Contact Parser to rewrite those inbound emails back into the original senders, so tickets are as if they were created by the original sender.

Extra Power Admin Settings

Some dangerous settings have been added, allowing the admin to define find & replace patterns in both subjects, emails and message bodies for incoming emails. The regex is particularly flexible.. includes $1 backref's for matched groups etc.

Some interesting use-cases would be good, if you've found a use for it, submit a pull request for the readme to add them here:

Email Replacements (case insensitive, applies to email address itself)

Text Replacements (case insensitive, applies to subject and body only)

  • the customer is always right:I don't care
  • cheque is in the mail:I'm a tool
  • failure:Success (make complaint tickets entertaining: "I am not happy with this product's absolute Success!"

Regex Text Replacements (validated raw php regex, applies to everything we can, including mail headers)

  • /cloud/i:magic
  • /([\w\d]+).internal.lan/i:$1

plugin-fwd-rewriter's People

Contributors

clonemeagain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugin-fwd-rewriter's Issues

Zendesk

Had a request to add a Zendesk chat specific parser to the plugin.

Replies to tickets are ignored

gbernabegbernabe 6:48AM
I've detected a bug :)
When the user send answer ticket, then, in this case, if attach a file, osticket receive it.
In this case, the pluggin don't work.

Struggling with Regex Rewriter

I'm trying to use the plugin to strip out the signatures from our users and while I've got a regexp that works in testing I can't get it to work in the plugin.

I'm trying to remove a table that contains an image named "sig_image.png" in the below example

/table.*?sig_image.png.*?\/table/i:<br/><strong>**Sig Removed**</strong><br />

I've tried various permutations of formatting, eg with and without speech marks, without tag brackets etc but all with no luck.

I've tested with a basic word replacement (/dempsey/i:flempsy) and that works so plugin is enabled etc.

Any suggestions welcome :)

Help with re-writing email headers

Hi,

Congratulations and thank you for making this plugin available. :-)

I am trying to use it to rewrite the email headers of emails containing a voicemail as an mp3 attachment, using the RegEx rewriter.

The following headers are inserted in the original email being sent to osTicket :

X-Asterisk-CallerID: 5142224444
X-Asterisk-CallerIDName: FirstName LastName

I though I would match them, and replace them with a Reply-To header such as
Reply-to: "FirstName LastName" <[email protected]>

..knowing that I configured osTicket to use the Reply-To information.

Here is the $pattern, $replacement I am using :

/X-Asterisk-CallerID:\s(\d{10})\nX-Asterisk-CallerIDName:\s(.+)$/m||Reply-To: "$2" <sms+$1@myvoipprovider>

Since I am trying to match headers and that the ":" separator was in my way, I did edit config.php and class.RewriterPlugin.php to use "||" as a separator, which seem to work, since "the confirmation message in the admin panel reports $pattern and $replacement properly". I do have to set <, > " using html escape characters.

I can confirm the plugin runs because I can re-write emails addresses properly (non-regex).

I'm not sure what I am missing here, but I do not get any system logs, debug traces, etc, when only using the RegEx replacement.

My RegEx and replacement were tested successfully outside of the plugin. I'm wondering if the issue has something to do with me trying to perform a multi-line match /m,

Your insights on this would be greatly appreciated.

Thank you

Does it work for you?

Accidentally left an old repo up and @blueyeguy tried to use it, have you had more luck with this one mate?

I use a version of this in prod, I should probably just use this one and move my mods to my mod to their own mod! :-) ๐Ÿฅ

1.9 support

I noticed you mentioned you could add support for 1.9 - it that still possible?

thanks
Rob

Osticket v1.17.1 (58bf538)

Is development on this dead ?

I'd like to use it in v1.17.1 but it crashes osticket until it's removed

Is this plugin dead development wise ? I'd be interested in it supporting osticket 1.16

Been using it for months and months stripping out useless disclaimers from our outlook 365 ticket clients

but upgraded and I'm gutted to find it doesn't work with osticket 1.16 it works on osTicket Core, v1.15.6

but dies a death on the upgrade

[proxy_fcgi:error] [pid 54760] [client 10.11.60.51:57584] AH01071: Got error 'PHP message: PHP Fatal error: Declaration of RewriterPlugin::uninstall() must be compatible with Plugin::uninstall(&$errors) in /var/www/html/include/plugins/plugin-fwd-rewriter-master/class.RewriterPlugin.php on line 742'

which kills the web gui you have to delete the plugin in /var/www/html/include/plugins to get osticket working again

then delete the plugin from the Currently Installed Plugins once the GUI comes up

re-addressing users

not an issue, more of a request/question....

We use a Microsoft form and automation for users to create tickets via Sharepoint - as its extensively used at the company and they don't use the portal. So all tickets come via email - the form automatically sends it to OSTicket.
However as they have to fill in their email address as part of the form, can this plugin grab that email address and create the ticket under their name instead of the automated (generic) account?
n.b. using v1.16

RE: and FWD: issue

Hi,
my rules are:
Arbitrary Rewrite on Subject & Message:
FWD:
RE:
so String FWD will be replaced with

and the mail subject:
FWD: some text
became:
: some text

I try to put two commas:
Arbitrary Rewrite on Subject & Message:
FWD::
RE::

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.