Generic Agent vs Postmaster Filter in Znuny & OTRS

You get deeper into the automation of Znuny, OTRS or OTOBO and you will identify at a point in time that there are two features to automate your tasks.

First you have to understand at what situation are the both features working. The features are:

  • Postmaster Filter
    As the name says, in real life a postmaster it is a man, who is in charge for the post (e-mail) processing. In this case it is a service at level of fetching/receiving new mails, which is able to filter specific mails and handle them somehow differently, as all other mails.
  • Generic Agent
    A user (person) in OTRS, Znuny or OTOBO is typically named Agent. And this agents working on Service Management tasks. But a Generic Agent is a “automated” agent, which can be configured to execute steps in an automated way.

The often recommended Postmaster Filter – why is it a mostly a bad path?

Now if you want to process automation as soon as a mail reaches the Ticket-System (Znuny, OTRS, OTOBO) you shall use Postmaster Filters.
BUT
At this level you work on String and RegEx basis only! And you can only set values in the E-Mail headers, which get processed later in the next steps of the Ticket-System.
E.g. you have a E-Mail and you want to match all e-Mails which are from @amazon.com to send them into the queue Amazon underneath the queue Shopping. Now you have to define a Postmaster with following settings:

Filter Conditions

  • Search Header Field:
    From
  • for value:
    .*@amazon.com.*

Set E-Mail Headers

  • Set E-Mail Header:
    X-OTRS-Queue
  • with value:
    Shopping::Amazon

Drawbacks of Postmaster Filters

As you can see, the Postmaster Filter enhances the E-Mail headers with additional data only and a later process in the Ticket System is processing the tickets accordingly. It is a possible solution, but in our opinion an “ass-backwards” approach.

Why?
How can you test or debug this Postmaster Filter?
If you do more complicated things, you could ask Amazon to resend to you the same e-mail over and over again. Good luck and please let us know if you found a responsible person at amazon doing it for you 😉
Alternatively you dump the natively transmitted e-mail into a file and you provide this e-mail over and over to your Mailserver. You can ask Microsoft, your hoster of Office 365 to process a e-mail from Amazon in your account. Good luck, and welcome as spammer!
Alternatively if you use a POP3, IMAP or similar way, you can try to provide the e-mail to the mailboxes manually.

This are all tasks which an experienced admin could be able to do so.
But are your PowerUsers of OTRS, Znuny or OTOBO able to do this? Highly probably not, right?
And who should maintain the automation. An overloaded Admin, or your selected PowerUsers, who are directly in the business and know what processes could be easily automated?

Also what happens if you rename your Queue “Amazon” to “AmazonOrders”?
You are right, as you have provided Strings “Shopping::Amazon” your Postmaster Filter will fail as your new Queue-String is “Shopping::AmazonOrders”.
and how to fix it? You are again right fully manually for all tickets …
With the Generic Agent this case will never happen, as you work with references to Queue and not with strings. So a rename will simply and without any interaction by you be taken over in GenericAgent.

Now imagine you have done a mistake on your PostmasterFilter, but the initial test worked well.
So you published it on production, and you get a angry call from your Agents, that the tickets are somehow messed up. You can search for multiple forum posts about this fact.
We faced such issues already multiple times and the cleanup of the mess is always a big sh.. of work. Be aware you will have as an admin multiple days of anger discussions with your Agents and Power Users…

More reliable and easy to test and debug: Generic Agent

As the name says the Generic Agent shall be able to do the same steps as an human Agent. So the Generic Agent is also built like this.

Generic agents have following features and functions:

  • time based triggers
    e.g. every 10 minutes,
    which could contain 0..n tickets during execution
  • event based triggers
    e.g. on receiving a new ticket, or replying a ticket, and many many more,
    which contains exactly 1 ticket, which is processing the selected event(s)
  • combined triggers, time based and event based
  • Search criteria / Select tickets, identical to the user’s search dialog
  • Update/Add Ticket Attributes, to set new and update values
  • Add Note
  • execute custom code for more specific automations

As you can see, this automation option is build more like a human does the work and therefore also for PowerUsers to maintain it easily.
Generic Agents have also search criteria, like a human would search for tickets.

  • From:
    “*@amazon.de*”

Under Update/Add ticket attributes you can now set

  • Set new queue:
    here you can select your queue from a drop down UI element

Other benefits with Generic Agents are:

  • The most important thing, even if you rename your queues, your Generic Agent will still work properly!
  • Execute the Generic Agent and see which tickets would be chosen. So you can easily test your search criteria before you corrupt lots of tickets!
  • Limit the Generic Agents to a timeframe, or other criteria to reduce mistakes create a mess
  • You can add a note and refer to a GenericAgent processing, so your human Agents will see what happened in the note and in the history of the ticket

Drawback with Generic Agents

The major pain on Generic Agents is the lack of using logical operations. E.g. this is not possible:

  • match A except B
    you want to match all @amazon.com except billing@amazon.com
  • As of End of 2023, this is not possible nor on the agenda of Znuny, it may come with the new search core elastic search. Probably in 2025+

E.g. this features are long awaited but not implemented by Znuny since years, Hopefully this will be history with the planned integration of elasticsearch in a maybe 7.x version.
Search Here are the regEx options on string basis clear benefit for Postmaster Filters.
We have implemented a RegEx module (RegExMatcher) for Znuny & OTRS, ask us for access to it.

Verdict

Do use Postmaster Filters very very carefully and also only if you do not have another solution via Generic Agent. Also check this page for the provided modules, which are built in mind to make the world of Znuny / OTOBO PowerUsers more easier.

Do you need help with Znuny / OTRS?
We have lot of experiences with OTRS and Znuny and can help you with your issues. Get in touch with us and we will check if and how we can help you.

Leave a Comment

Do you need help with Znuny / OTRS?​

We have lot of experiences with OTRS and Znuny.
We can help you with your issues to solve them.

From giving you support up to implementing integrations to your existing systems.

Get in touch with us and we will check if and how we can help you.​