Block Email by Regex [SOLVED]

Moderator: crythias

Locked
davidbann
Znuny newbie
Posts: 92
Joined: 21 Jun 2010, 22:51
Znuny Version: 6.5.2
Real Name: David Bann
Location: South Africa

Block Email by Regex [SOLVED]

Post by davidbann »

Hi there,

We have a requirement where a specific customer has asked that only certain people int heir organization should be allowed to log tickets. Any other people that try tro log tickets through email should be rejected.

To do this, I have created a PostMaster filter:
Stop after match = Yes
FILTER CONDITION
Header 1: From = ^((?!.*john@customer1.com|sue@customer1.com|fred@customer1.com).)*$
Header 2: To = ^((?!.*customer1.xxx.support@domain.com|customer1.yyy.support@domain.com).)*$

SET EMAIL HEADERS
Header 1: X-OTRS-Queue = Customer::Rejected
Basically the above means that only john@customer1.com, sue@customer1.com and fred@customer1.com will be allowed to create new tickets if they send an email to customer1.xxx.support@domain.com or customer1.yyy.support@domain.com. If anyone else send an email to these addresses, then their ticket will be sent to the Rejected queue.

We have 1 email address, with multiple aliases. For example, the main address is support@domain.com and then we have a different alias for each queue and customer. (customer1.xxx.support@domain.com, customer2.xxx.support@domain.com, etc.)

This seems to work with the following exceptions:
  • If someone who should be rejected sends an email and CC's someone who IS allowed to send, then it allows the creation of the ticket. (E.g., naughtyperson@customer1.com sends an email to customer1.xxx.support@domain.com and CC's john@customer1.com). THis should reject the ticket, but it allows it.
  • If susan@customer2.com send an email to support@k5erp.com then their ticket is rejected, but it should not be.
Any advice would be appreciated!

Thanks
Last edited by davidbann on 19 May 2014, 17:58, edited 1 time in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Block Email by Regex

Post by crythias »

your version of OTRS should be updated if you're at 3.1.3... there are a lot of bug fixes that you'll want resolved.
viewtopic.php?f=60&t=6586 tells how to ignore tickets from people not in database.

There are also specific PostMasterFilters in SysConfig like noreply and abuse that may be observed for your case.

Further, you can block at your email box.
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
Locked