Dears,
I had some requirements about filter the incoming emails via the email template. I'd like to give an example like this:
The body of incoming email
Name: me
Address: blah, blah
Product: ABC
...
Service list in OTRS using for Products list
ABC
DEF
XYZ
The requirement is get the value of Product in the body of incoming email (is ABC in this case), then compare with services list. If it is not existed in list, then reject email, otherwise create a ticket and service is assigned ABC
For this requirement, my boss told let do by configuration if possible, but now I'm still not know how to config. It should be changed some code I think. Please help me, give me some suggestions.
Thanks a lot,
Vu Nguyen
Customize Postmaster Filter
Moderator: crythias
-
- 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:
Customize Postmaster Filter
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
MySQL database
External customer backend with MySQL, MSSQL
Customization
Re: Customize Postmaster Filter
Hi,
I would do it the following:
I would do it the following:
- - First, I would have two queues: one for the tickets that correctly pass the test [e.g. _Raw_] and one for those that do not pass the test [e.g. _Junk_]
- In mail account, I would set Dispatching by selected queue and queue: Junk
- In Postmaster Filter, I would create the following:- - Stop after match: Yes
- Filter Condition->Header 1: Body
- Filter Condition->Value 1: Product: (\w+)
- Set Email Headers->Header 1: X-OTRS-Service:
- Set Email Headers->Value 1: [***]
- Set Email Headers->Header 2:X-OTRS-Queue
- Set Email Headers->Value 2:Raw
- - Stop after match: Yes
- - all your tickets in Junk queue are those with no product,
- all your tickets in Raw queue have a product.
OTRS 5.0.15 on CentOSLinux with MariaDB database connected to an Active Directory for Agents and Customers.
-
- 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: Customize Postmaster Filter
Hi juanman80,
Thank your solution. It's very nice, but my problem was here:
P/s: you set the Value 1: [***], it's auto lookup from (\w*), am I right? So if I want to filter more field in Body (for example to get value of Adress), how can I config
Thanks & best regards,
Vu Nguyen
Thank your solution. It's very nice, but my problem was here:
The requirement, the value of Product (\w+) must be check existed in Service list or not? if not the ticket of email must be in the Junk queue.Filter Condition->Value 1: Product: (\w+)
P/s: you set the Value 1: [***], it's auto lookup from (\w*), am I right? So if I want to filter more field in Body (for example to get value of Adress), how can I config
Thanks & best regards,
Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
MySQL database
External customer backend with MySQL, MSSQL
Customization
Re: Customize Postmaster Filter
Hi Vu,
I'm afraid that that's all my know-how without programming a custom postmail filter. If you want to try, you can see some working filter in
Yes, [***] will store the result of the last matched () in the regexp... if you put several parentheses, I'm afraid it will only store the last pair
Kind regards,
Juan Clavero
I'm afraid that that's all my know-how without programming a custom postmail filter. If you want to try, you can see some working filter in
Code: Select all
$OTRS_HOME/Kernel/System/PostMaster/Filter/
Kind regards,
Juan Clavero
OTRS 5.0.15 on CentOSLinux with MariaDB database connected to an Active Directory for Agents and Customers.
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Customize Postmaster Filter
If you have an email template, you should include any x-otrs headers
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
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
-
- 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: Customize Postmaster Filter
Thanks all,
For this case, I customized NewTicket.pm file in System/Postmaster/, customer is so happy with that.
Vu Nguyen
For this case, I customized NewTicket.pm file in System/Postmaster/, customer is so happy with that.
Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
MySQL database
External customer backend with MySQL, MSSQL
Customization