[rt-users] ExtractCustomFields template and dropping errant HTML tags

Lundberg, Emory emory-lundberg at uiowa.edu
Wed May 15 11:39:16 EDT 2013


I have a scrip to assign CustomFields based on a template and it often ends up collecting junk like HTML tags trailing after the data I want to match.

I think I have made my regex as specific as I can, but now I'm concerned that I went about this the wrong way.  I would love an opinion.



Emails that aren't human-generated typically have a block of data in them that includes data like:



Room:Y10A

Building:ddd
IP:172.16.2.2,fe80::250:43ff:fe00:ed31
MAC:DE:CA:FB:AD:11:97
Port:ddd-1 at 4/40



And sometimes they're handled by applications that generate them with HTML formatting, or are copy/pasted with HTML formatting, etc.



I have a CustomField called 'Building' and in my Template I have:



Building|Body|Building:*([^<]*+)\n||  



a) Is this ([^<]) necessary – or is there a way to merely ignore all HTML on incoming mail before it gets handed off to rt-mailtool that is preferred/better?


b) Is there something about my Template use that is obviously wrong?





     [✔]  Never use your HawkID's email address and password anywhere else! 

     Emory Lundberg, Security Friend, Information Security & Policy Office 
     University of Iowa, UCC, Campus Phone: 5-6174
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130515/f34bc484/attachment.htm>


More information about the rt-users mailing list