Demystifying Inbound Email Action Processing
Inbound action is all about how servicenow responds when an
email is received by the system. Based on the logic inbuilt in the system, email
received is categorized as new/forward/reply, and then continues
the processing.
What triggers
inbound and what’s the frequency
In every two minutes
servicenow runs a schedule job named Email
Reader. It connects to the mail server using the account specified in Email Properties. The Email Reader
downloads any incoming message that is waiting on the mail server and creates email.read events. After the instance processes the events, the inbound actions run.
Based on the logic inbuilt, it identifies whether email received is new/forward/reply.
Identification of
the Sender of the email
Servicenow identifies the user who sent the email based on
the email id of the sender. As soon as servicenow receives the email, it
matches the sender’s email id with all the user’s email id in the user table.
if there is any match found then sender is identified with that matched user
id. In case if there is no match found then system considers the sender of the email
as a guest user (Provided “Automatically create users for incoming emails from
trusted domain” property of email is unchecked else it will create a new user
and will refer to that user as a sender of the email).
Processing of inbound
email
Once email is received by the platform, first it is checked
if email is worth processing based on the below conditions:
1.
Does subject line start with text like “out of
office autoreply”?
2.
Does sender’s email id match email id of any
existing user in user table and user is logged out?
If any of the above two condition evaluates to true, then Mailbox value of the email is set to Skipped
and processing of the inbound will stop. If both above condition
evaluates to false, then processing of inbound will move further and now it
will try to categorize it as one of new/forward/reply. Below is the
Sequence of categorization:
1.
Forwarded
email – First inbound email is tried to categorize as forwarded email. If
it fails it will move to the other categorization
2.
Reply
email – If inbound fails to categorize email as forward, it tries to
categorize it as reply.
3.
New email
– If inbound email fails to categorize as forwarded or reply then it is
considered as a new email.
This sequence is fixed and cannot be changed. Let’s discuss
each categorization one by one.
Logic to identify
email as Forward:
If the subject line of the email is prefixed with
recognized/defined forward prefix and string From appear anywhere in the body of the email. In platform, forward
prefix is defined in “Identify email as
a reply by these subject prefixes” property of the email properties as
shown in the below screenshot:
Logic to identify
email as Reply:
If any of the below condition evaluates to true, then email
is marked as reply:
1.
Does email subject prefixed with Re and contains
and contains system recognized record number like INC0010061?
2. Does
email body contains a valid watermark like Ref:MSG0140490_lRhI4zra325ws7oc8NwO
3. Does email body contains In-Reply-To header, having value same as Message Id field of any other email table record as shown in below
screen shot? (We will discuss this in detail and will deep dive using Use-Case
in a separate blog)
Logic to identify email as New:
When system fails to categorize
received email as forward or reply, it is identified as New
Flow of determining the type of incoming email
Image source : Servicenow Doc (https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/notification/concept/c_InboundEmailActions.html)
Below are the email
properties where prefix identifier for reply and forward are defined
Comments
Post a Comment