Postmaster Filtering

Moderator: crythias

Locked
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Postmaster Filtering

Post by vinay9599 »

i want to filter all those tickets which has 2 or more specific words in the body. for example - filtering all those tickets which has 'java' and 'call' in the body and moved to a particular queue.

currently only one word filtering is possible. although when i search for such tickets through search tool i am successful.

another filter which i require is filtering based on number of characters used - for example - filter all those tickets which only has HELLO written in message.

can i set up a filter those tickets which has 5 characters and has words HELLO?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filtering

Post by crythias »

vinay9599 wrote:can i set up a filter those tickets which has 5 characters and has words HELLO?
no or maybe. ^HELLO$
vinay9599 wrote:filtering all those tickets which has 'java' and 'call' in the body and moved to a particular queue.
maybe
java*call|call*java
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
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Postmaster Filtering

Post by reneeb »

vinay9599 wrote:filtering all those tickets which has 'java' and 'call' in the body and moved to a particular queue.
maybe
java*call|call*java[/quote]

This should be

Code: Select all

java.*call|call.*java
your regex means "jav" followed by 0, 1 or more "a" followed by "call" ...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filtering

Post by crythias »

:) reneeb, thanks. you're absolutely correct. * is zero or more of the preceding in perl, not just "anything".
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
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Re: Postmaster Filtering

Post by vinay9599 »

i have tried using the option provided by @reneeb but i am not successful. Do i need to make some changes?

i have just entered java.*call|call.*java in the value1 option and selected header as Body for i want to search all those tickets which has java and call written in the message body.

i am attaching the screenshot for the same as well.
You do not have the required permissions to view the files attached to this post.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Postmaster Filtering

Post by reneeb »

Theoretically it should work ;-)

-> Does any other postmaster filter overrule this filter? (You have set "stop after match" to "no")
-> Is the mail a multipart mail? If yes, are the words in the HTML part and not in the plain text part?
-> Does an other filter run before that one? Does that filter match the mail? Does that filter stop after match?

Can you provide the sourcecode of a mail that should be matched (not just the text! Download the "plain view" of the mail from OTRS) ?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Re: Postmaster Filtering

Post by vinay9599 »

Thanks @Reneeb!! This helped I am now able to create filters and designate auto responses to queue. Is it possible to create filters with more words like account.*not.*register|account.*register.*not or will i have to make all six possible combo like

account.*not.*register|account.*register.*not|register.*account.*not|register.*not.*account|not.*register.*account|not.*account.*register


Also the filter regarding 5 characters with only Hello is not working with ^HELLO$
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filtering

Post by crythias »

^[Hh][Ee][Ll][Ll][Oo]$
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
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Re: Postmaster Filtering

Post by vinay9599 »

this ^[Hh][Ee][Ll][Ll][Oo]$ also does not work.. Any other way to filter it?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filtering

Post by crythias »

^[Hh][Ee][Ll][Ll][Oo]$ is based upon this being the only word on a line, or potentially the only word in the body.
vinay9599 wrote:can i set up a filter those tickets which has 5 characters and has words HELLO?
remove the carat and the dollar sign and it'll find itself in any body.
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
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Re: Postmaster Filtering

Post by vinay9599 »

it seems there is a disconnect between us. let me explain it again:

Scenario 1 : If i enter ^[Hh][Ee][Ll][Ll][Oo]$ as a value for setting up a filter the tickets bypass the filter and reaches the default queue rather than the designated queue

Scenario 2 : If i enter [Hh][Ee][Ll][Ll][Oo] as a value for setting up a filter, it picks all those tickets which has a word HELLO and moves them to designated queue

My Requirement : If and only if HELLO is written in the ticket. The ticket should move to designated queue.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Postmaster Filtering

Post by reneeb »

Is it an email in HTML format?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Re: Postmaster Filtering

Post by vinay9599 »

Yes, it is in HTML format
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Postmaster Filtering

Post by reneeb »

Does the plain part of the mail also includes "HELLO"? The Postmaster filters configured via webfrontend are only able to see the plain text part of an email. If you need to filter the HTML part, you have to write you own Perl module...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
vinay9599
Znuny newbie
Posts: 19
Joined: 16 May 2012, 12:29
Znuny Version: 3.0.5

Re: Postmaster Filtering

Post by vinay9599 »

I am not sure which format do we get the mails in... However, the earlier filter like java.*call|call.*java worked perfectly fine on the emails received.

The users sends a mail to support@n****z.com and the OTRS tool fetches all those mails. Just like the earlier mails where the filter was working this HELLO filter is not.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Postmaster Filtering

Post by reneeb »

Please enable the "PlainView" feature in SysConfig. Then go to one of those "HELLO" mails and have a look at the "unformatted view" of the mail. Please post this view (but delete all personal data)!

The java*call thing might work when the mail is either plain text or the plain text part is really the plain text view of the HTML part... Without seeing the mails, it's impossible to find the cause for your trouble.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Postmaster Filtering

Post by crythias »

I reacted to your post where you said Hello is not working with HELLO.

Either it works searching for HELLO or it's case insensitive anyway which means the gui can't do what you want.
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
Locked