How to Block Automatic Reply Emails from Processing in ServiceNow

RohitDhiman
Tera Contributor

Hi everyone,

We have some generic email addresses set up by a customer. Every time we update a case or send them an email, we receive an automatic reply from their side. This prevents us from marking the case as resolved, as it reopens due to the lack of an actual response.

I want to block these emails from being processed.

I tried using an inbound email action with the following script but it didn’t work as expected:

 

 
var sender = email.from.toLowerCase();
// Define blocked addresses
var blockedAddresses = [
    "blocked1@domain.com",
];
// Check if sender is in blockedAddresses
if (blockedAddresses.indexOf(sender) !== -1) {
    gs.info("[Inbound Email Action] Blocked email received from: " + sender + ". Skipping processing.");
   
    // Abort further processing of this inbound email action
    action.setAbortAction(true);
}


Could someone please guide me on how to effectively block or ignore these automatic reply emails in ServiceNow?

Thank you in advance for your help.

9 REPLIES 9

 Stop Processing field - once the inbound action conditions satisfies the conditions then it will stop processing the any further inbound actions. You have to define the condition correctly for your use case.

sundarjm
Tera Contributor

Hi @RohitDhiman ,

 

You can create the scripted email inbound action and set it to lower value and dont choose any target table.

in the script you can choose the email address you wants to block.

Thank you @sundarjm for your reply. 

SumanthDosapati
Mega Sage
Mega Sage

@RohitDhiman 

I can think of three ways :

  1. Create an email filter
  2. Use the condition field in inbound to ensure it triggers when the subject doesn't contain some keywords.
  3. https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0869547

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth

Thank you @SumanthDosapati for your reply.

I am not able to find the Email Filter option.
I also tried using Email Address Filter, but it did not work.

Regards,
Rohit Dhiman