[SOLVED]Postmaster Filters - Keyword Case Sensitivity

Moderator: crythias

Locked
kool_kid
Znuny newbie
Posts: 86
Joined: 13 Feb 2011, 13:51
Znuny Version: 3

[SOLVED]Postmaster Filters - Keyword Case Sensitivity

Post by kool_kid »

Hi,

I have some post master filters already created and are working good. I have noticed that the keywords I add in the filter are case sensitive. Test, TEST, test and TeSt are all different keywords for postmaster filter. Is there a way to disable this case sensitivity?

EDIT: I'm using version 3.0.5

Regards
Kk
Last edited by kool_kid on 23 Jun 2011, 07:30, edited 1 time in total.
OTRS 3.1.10
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filters - Keyword Case Sensitivity

Post by crythias »

[Tt][Ee][Ss][Tt] is one way to adjust for that...
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
kool_kid
Znuny newbie
Posts: 86
Joined: 13 Feb 2011, 13:51
Znuny Version: 3

Re: Postmaster Filters - Keyword Case Sensitivity

Post by kool_kid »

Appreciate your response.

Is there a way to turn off case sensitivity completely?
OTRS 3.1.10
kool_kid
Znuny newbie
Posts: 86
Joined: 13 Feb 2011, 13:51
Znuny Version: 3

Re: Postmaster Filters - Keyword Case Sensitivity

Post by kool_kid »

Right now I have 5-6 keywords that I search for in the subject field of incoming emails, if the keyword is found then the ticket is moved to particular queue. below is the example

Filter Condition
Header 1: Subject
value 1: ([printer] | [server*] | [network***] | [internet] | [computer*] | [laptop*])

Set Email Header
Header 1: X-OTRS-Queue
Value 1: IT-Queue

When I try this filter it works good for 2 or more words together like "Server Down" or "Computer freezes always" but it doesnt work if the subject field is having only one word like "Internet" or "LAPTOPS" etc.

Am I entering the keywords in wrong format? When i try using "||" operator instead of "|" operator in the above filter then all incoming emails goes to IT-Queue although the keywords are not matched.

Let me know where im going wrong with these filters.
OTRS 3.1.10
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filters - Keyword Case Sensitivity

Post by crythias »

brackets are used for characters within the brackets: [printer] could theoretical match p or r or pint. parentheses match whole words.
http://regexpal.com/
(printer|server|network|internet|computer|laptop)\w*
the \w means "word character" and the * means "0 or more of the previous". So, find printer or server or network or ... and also any word character (like "s", or not, or a lot of them, like serverssss or server1).

Kernel/System/PostMaster/Filter/MatchDBSource.pm about line 121:

Code: Select all

            # match string
            elsif ( $Param{GetParam}->{$_} && $Param{GetParam}->{$_} =~ /$Match{$_}/i ) 
that /i seems (as far as I can tell) to mean the item is case insensitive, although I'd probably consider maybe using lc as well or instead:

Code: Select all

            # match string
            elsif ( $Param{GetParam}->{$_} && lc($Param{GetParam}->{$_}) =~ lc($Match{$_}) ) 
http://forums.devshed.com/perl-programm ... 17894.html
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
kool_kid
Znuny newbie
Posts: 86
Joined: 13 Feb 2011, 13:51
Znuny Version: 3

Re: Postmaster Filters - Keyword Case Sensitivity

Post by kool_kid »

Thanks. I always appreciate your help.

The format you gave me works like a charm. Request you to add this Regex tutorial help or some guide on the otrs's Postmaster Filter webpage.

Thanks once again. This issue has been pestering me a lot.
OTRS 3.1.10
Locked