PostMaster Filter parts of body with wildcard

Moderator: crythias

Post Reply
zhakal
Znuny newbie
Posts: 47
Joined: 30 Jul 2011, 20:06
Znuny Version: 3.0.11

PostMaster Filter parts of body with wildcard

Post by zhakal »

Hi,

I need to filter the parts of a email body and set the found variable as customer.
My try at the regex is: EMAIL (([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}))

Example:

ABC aaabbbcccc
BBB test@test.com
CCC aaabbbcccddd
EMAIL otrs@otrs.org
DDD aaaabbbbb

Postmaster filter so far:
Match => {
From => 'test@test.com',
Body => 'EMAIL (([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}))'

},
Set => {
'X-OTRS-CustomerUser' =>[***],
},

What i want to do is fetch otrs@otrs.org from the EMAIL line and set the email only as CustomerUser.
Hence it needs to ignore the BBB line and only fetch from EMAIL.
OTRS 3.0.11 , RHLE 5.6 & CentOS 6
MSSQL 2008 R2 , Windows 2008 R2
zhakal
Znuny newbie
Posts: 47
Joined: 30 Jul 2011, 20:06
Znuny Version: 3.0.11

Re: PostMaster Filter parts of body with wildcard

Post by zhakal »

This seems to be a bit better but still doesn't put the result in the CustomerUser field:
(?<=EMAIL )(([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}))
OTRS 3.0.11 , RHLE 5.6 & CentOS 6
MSSQL 2008 R2 , Windows 2008 R2
zhakal
Znuny newbie
Posts: 47
Joined: 30 Jul 2011, 20:06
Znuny Version: 3.0.11

Re: PostMaster Filter parts of body with wildcard

Post by zhakal »

It finds the correct line, but can't set a variable through:
'X-OTRS-CustomerUser' =>[***],

If i make it set aaa.aa@test.com statically it works.
So how to get the line it finds and use that in the CustomerUser field?
OTRS 3.0.11 , RHLE 5.6 & CentOS 6
MSSQL 2008 R2 , Windows 2008 R2
rey90
Znuny newbie
Posts: 70
Joined: 16 Aug 2012, 15:56
Znuny Version: 4.0.10

Re: PostMaster Filter parts of body with wildcard

Post by rey90 »

do you have any solution for this? i have nearly the same problem
Produktiv: OTRS: 4.0.10
Testing": OTRS: 5
OS: Debian 7
Apache2/MySQL 5
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: PostMaster Filter parts of body with wildcard

Post by crythias »

Agents/Responsible shouldn't reply to tickets through email.
viewtopic.php?f=60&t=11247
(Available as an add-on for Subscription Customers)
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
Post Reply