Set Queue for ticket if Postmaster filter is failed

Moderator: crythias

Locked
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Set Queue for ticket if Postmaster filter is failed

Post by ndhvu275 »

Dear,

I'm now using Postmaster to filer incoming email. I created a Postmaster Filter in Admin page, then set
Filter Condition
From = @gmail
Set Email Headers
Queue = Raw
I tested was right. I now want to set Queue from Email is not @gmail (mean Postmaster filter is failed). I don't where I have to config.
Anyone know please show.

Thanks for your help

Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Set Queue for ticket if Postmaster filter is failed

Post by jojo »

just use the default queue for incoming mail adresses (configured per mail adress or in Core::Postmaster)
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
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: Set Queue for ticket if Postmaster filter is failed

Post by reneeb »

Edit: Use jojos solution

To create a "negative" Postmaster filter, you could use

Code: Select all

\@(?!gmail)
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
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: Set Queue for ticket if Postmaster filter is failed

Post by ndhvu275 »

Dear jojo and reneeb,

Thanks your suggestions.
@jojo: the default of incomming email, it's belong to the queue which you set in Postmater Filter or System Email Address
@reneeb: your suggestion is just a example for my case. But OTRS configuration for a company is not simple like that. Btw, I'd like to give a real case:
1. There are a list of email templates, for example an template:
Connection ID (dynamic field):
Network ID (dynamic field):
Adress (dynamic field):
And a customer is just send mail must be follow one of list template for creation a ticket. For example a boby of email would be sent:
Connection ID: ABC
Network ID: 123
Adress: 8 - Nha Trang...
2. Filter all of email incomming via list of email template. If they are right then queue was set a New, if not queue was set Reject.

Now, I have to create postmaster filter as list of email template (it's hard to check the body of email by regular expression). But I can not create a postmaster filter check a negative case for all of above.

Have you any ideas for about that. Please let me know my way now was right or wrong? It's my first time to use a postmaster to check mail

Thanks & best regards,

Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Set Queue for ticket if Postmaster filter is failed

Post by crythias »

ndhvu275 wrote: I can not create a postmaster filter check a negative case for all of above.
Then create a positive case and address it, then stop processing more rules.

Better answer: block at the email box/allowed senders.
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
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: Set Queue for ticket if Postmaster filter is failed

Post by ndhvu275 »

Dear,

I found this solution with regular expression to check the body of incoming email. Send here is an example hope is useful for others:
Create an Postmaster Filter, In the filter condition
Header 1: select Body
Value 1: (^|\n)Connection ID:.*\nNetwork ID:.*\nAddress.($|\n)
If your email template is longer (over length 100), you can open the AdminPostmasterFilter.dtl and remove Maxlength="100" of textbox of Value1. Of course you have to modify the max length of f_value (maybe 1000) in Postmaster_filter table

So, if the Connection ID is a dynamic field of your ticket, you can get its value from body of incoming email, for example
In the Set Email Headers
Header 1: select X-OTRS-DynamicField-ConnectionID
Value 1: ^Connection ID: (.*)\n

Then, I set default for rejected tickets in Core:Postmaster. But I don't know how to set sending an email to nofity for this case. Anyone know, please show me

Thanks & best regards,

Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
Locked