PostMaster Filter

Moderator: crythias

Post Reply
tnieman
Znuny advanced
Posts: 103
Joined: 14 Nov 2012, 21:59
Znuny Version: 3.1.6
Real Name: Tom Nieman
Company: WorkForce Software

PostMaster Filter

Post by tnieman »

I found this in the OTRS Documentation for Postmaster Filter
In Table 5.4 from http://doc.otrs.org/3.0/en/html/adminar ... ilter.html

Name: X-OTRS-State:
Possible values: new, open, closed successful, closed unsuccessful, ...
Description: Sets the next state of the ticket.
X-OTRS-State is an available choice in the Filter Condition section. Using it in the Filter Condition will Set the value????? That doesn't sound right.

What I want to accomplish is ignore "out of office" emails when the ticket is closed, so those emails don't reopen tickets, but allow them in if the ticket is open.

Is this possible??

Tom
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: PostMaster Filter

Post by crythias »

X-OTRS-Ignore = 1
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
tnieman
Znuny advanced
Posts: 103
Joined: 14 Nov 2012, 21:59
Znuny Version: 3.1.6
Real Name: Tom Nieman
Company: WorkForce Software

Re: PostMaster Filter

Post by tnieman »

Thanks, I have added the filter, but it's not stopping emails.

Stop After Match is set to No

Filter Condition: Header 1 = Body ([Oo][Oo][Oo]|[Oo][Uu][Tt]\s[Oo][Ff]\s[Tt][Hh][Ee]\s[Oo][Ff][Ff][Ii][Cc][Ee])
Filter Condition: Header 2 = Subject ([Oo][Oo][Oo]|[Aa][Uu][Tt][Oo][Mm][Aa][Tt][Ii][Cc]\s[Rr][Ee][Pp][Ll][Yy])
Filter Condition: Header 3 = X-OTRS-STATE closed

Set Email Headers: Header 1 = X-OTRS-IGNORE 1

So what I think I have coded is looking in Body for "ooo" or "out of the office" (any capitalization) AND looking in Subject for "ooo" or "automatic reply" (any capitalization) AND X-OTRS-STATE = "closed"

If this equates to true - ignore the ticket.

Automatic replies are still getting in and opening closed tickets. What am I doing wrong? I have tested the REGEX's on a web site and they seem to work properly.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: PostMaster Filter

Post by crythias »

1) Filter conditions are AND
2) X-OTRS-STATE closed will probably never match (closed sucessfully, perhaps) and ... if you want it to work, you're looking for OOO in body and subject and the ticket being closed.
3) probably the OOO are consistently provided (case and content) so you may not need to look for this as thoroughly as you wish.

Also, check queue for closed ticket followups reject.
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 Filter

Post by reneeb »

+) I would write the conditions this way:

Code: Select all

(?i:ooo|out\s+of\s+office)
. The (?i:) makes the match case-insensitive
+) You check X-OTRS-STATE "closed" checks if the mail has a header field "X-OTRS-STATE" with value "closed". It does *NOT* check if the ticket is closed.
+) The value for X-OTRS-Ignore has to be "yes" or "true", not "1"
+) The DB Postmaster filters are run before a check is performed if the mail is a follow up to an existing ticket
+) Unfortunately there is no chance to run a postmaster filter after that check is done and before the followup/new ticket is created

=> You would have to create your own PostMaster filter module (with Perl) where you have to check for the related ticket and the state of that ticket yourself
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
tnieman
Znuny advanced
Posts: 103
Joined: 14 Nov 2012, 21:59
Znuny Version: 3.1.6
Real Name: Tom Nieman
Company: WorkForce Software

Re: PostMaster Filter

Post by tnieman »

thanks - that is much easier to read.


Tom
Post Reply