I am running Ubuntu 18.04 and OTRS 16.0.16 with mariadb 10
Is it possible using the ADMIN | Postmaster Filter screen to set a value for a field based on another fields information
Example an email comes in and has a subject something like: Storied 56783 information
I want to take the numbers in that subject line and store them into a dynamic field in the set email headers section so when the ticket is created I have the series of numbers in their own field. I know I can use a simple regex such as ^Storied [0-9]{5} in the filter condition for the subject to see if an email message matches this condition. But can I somehow grab that section of the subject with some regex and store it as a value in a different field on the ticket using the Postmaster Filter screen?
[SOLVED] Help setting a postmaster filter for a field based on an email header value
Moderator: crythias
-
- Znuny newbie
- Posts: 24
- Joined: 28 Feb 2019, 10:50
- Znuny Version: 6.0.16
- Real Name: Jeffrey Taavettilan-Davis
- Company: USNR
[SOLVED] Help setting a postmaster filter for a field based on an email header value
Last edited by JDavis on 21 Aug 2020, 19:59, edited 1 time in total.
-
- Administrator
- Posts: 4251
- Joined: 18 Dec 2007, 12:23
- Znuny Version: Znuny and Znuny LTS
- Real Name: Roy Kaldung
- Company: Znuny
- Contact:
Re: Help setting a postmaster filter for a field based on an email header value
Hi,
You just need to group the fields you like to use to seet another on. Example
For Subject: Storied 56783 information use this regex Storied\s*(\d{5})\s*
The match grouped with ( and ) can be used with [***] to set a field, e.g. a dynamic field.
- Roy
You just need to group the fields you like to use to seet another on. Example
For Subject: Storied 56783 information use this regex Storied\s*(\d{5})\s*
The match grouped with ( and ) can be used with [***] to set a field, e.g. a dynamic field.
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
-
- Znuny newbie
- Posts: 24
- Joined: 28 Feb 2019, 10:50
- Znuny Version: 6.0.16
- Real Name: Jeffrey Taavettilan-Davis
- Company: USNR
Re: Help setting a postmaster filter for a field based on an email header value
Well I am not the best with regex so I am not quite understanding.
The regex you suggested definitely works to grab this email but I just do not know what to actually enter to obtain the subject information and parse it again for the dynamic field value I want to populate. How do I use the regex and be able to grab the Subject information and parse it to fill the value for the dynamic field.
The regex you suggested definitely works to grab this email but I just do not know what to actually enter to obtain the subject information and parse it again for the dynamic field value I want to populate. How do I use the regex and be able to grab the Subject information and parse it to fill the value for the dynamic field.
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 4251
- Joined: 18 Dec 2007, 12:23
- Znuny Version: Znuny and Znuny LTS
- Real Name: Roy Kaldung
- Company: Znuny
- Contact:
Re: Help setting a postmaster filter for a field based on an email header value
Hi,
It looks like this:
- Roy
It looks like this:
- Roy
You do not have the required permissions to view the files attached to this post.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
-
- Znuny newbie
- Posts: 24
- Joined: 28 Feb 2019, 10:50
- Znuny Version: 6.0.16
- Real Name: Jeffrey Taavettilan-Davis
- Company: USNR
[SOLVED] Re: Help setting a postmaster filter for a field based on an email header value
Thank you for the help. I would never have figured that out even looking at the docs and seeing that note it did not make any sense to me.
I did have to make one change so that output had less information. Getting this to work is a huge deal for my scenario.
Storied\s*(\d{5})\s*
The above regex in my example outputted Storied 56783
(?:Storied)\s*(\d{5})\s*
I changed it to the above so the output is 56783
I did have to make one change so that output had less information. Getting this to work is a huge deal for my scenario.
Storied\s*(\d{5})\s*
The above regex in my example outputted Storied 56783
(?:Storied)\s*(\d{5})\s*
I changed it to the above so the output is 56783