The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Is there a way to automatically forward an email that has not been processed?

Bruno Fernande3
ServiceNow Employee
ServiceNow Employee

For one of my customers, a lot of users end up being deactivated incorrectly and when they send an email it does not get processed because they're not active. Is there a way to create a flow where this email would be automatically forwarded to the Service Desk so they would be able to forward themselves to ServiceNow and thus process it?

5 REPLIES 5

Michael Jones -
Giga Sage

So I've attempted to do something similar and will admit that I had mixed results for various reason, but the short answer is that there is not an existing feature that you could utilize. All of the standard inbound email processing will stop once the email address resolves to a user that is locked out. 

At a high level, a potential solution would look like the following. 

Create a BR on sys_email, after update, where type changes to received-ignored and target is empty.

 

In the script you would:
Check if the user_id resolves to a user that is locked out

(if there is no user, or it's not locked out, just return). 
Initialize a new record on sys_email
Set the type to send-ready
Set the notification type to SMTP
Set the recipients to be the email address you want to "forward" to. 
Copy the current values for subject, body, content-type and headers to the new sys_email. 
Insert. 

Basically you are trying to identify emails that were ignored due to your specific use-case and then generating an outbound email record to your desired recipients. 

 

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Hi Michael, you mean active = false instead of locked-out here, correct? Would it still work the same if the user is only inactive?

Yes, sorry, the same concept would apply just change your script to check whether the user is inactive. 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Narsing1
Mega Sage

Assuming the users deactivated incorrectly are going to be activated again at some point of time.  Having a BR on sys_user table can be taken into consideration. If so, it would be something like this.  You may also consider "Reprocessing the email" instead of again forwarding.

  • When active changes to true
  • Check the "Update"
  • Advanced Script - Observe the UI Action called "Reprocess received emails"  which creates an event to read the email and process again.  You may loop through all "received-ignored" emails and generate an event.

Thanks,

Narsing