Incoming mail is processed through inactive user instead of active one

jussisaukkonen
Tera Contributor

Hello,

I have a problem with inbound actions. This is the case: multiple users have same email address and one of the users is locked out or inactive. When an email is sent from this email address, the system randomly maps the email address to one of the users in the system. If the user is locked out or inactive, then all the inbound actions are skipped. I would like the system to map the email address to active user rather than inactive one. I know that the user's email address should be unique in ServiceNow but these users are coming from AD and I can't do much about it.

I tried to create before business rule in the 'sys_email' table and change the user but this has no affect to the user through which the inbound actions are run. Only solution I can think of is to change the inactive user to active in the before business rule but this doesn't seem a sustainable solution.

This behavior occurred when we updated the instance to the Berlin release. Therefore I would like to know what options do I have? Is there a property that controls this behavior or can I somehow control the user mapping of the email?

All help is appreciated!

1 ACCEPTED SOLUTION

michael_baker
Tera Guru

The solution we implemented was to create a before business rule on the Email table that runs when the type is "received", the mapped user is inactive, and the mapped user's email is not blank. If this condition is met we query the User table to find if an active user exists with the same email address and then set the email's mapped user to this active user.

Name: Check for Inactive User
Table: Email [sys_email]
When: before
Insert: true
Condition: current.type == 'received' && current.user_id.active == false && current.user_id.email != ''
Script:



var grUser = new GlideRecord ('sys_user');
grUser.addQuery('email', current.user_id.email);
grUser.addActiveQuery();
grUser.orderBy('sys_created_on');
grUser.query();
if (grUser.next()) {
current.user = grUser.sys_id;
current.user_id = grUser.sys_id;
}


Hope this helps!


View solution in original post

12 REPLIES 12

Hi Michael,

I tried your above solution, but its not working.
I am working on MSP instance and its on Calgary Release.

Any Help would be much appreciated.

Best Regards,
Namrata Jain.


CapaJC
ServiceNow Employee
ServiceNow Employee

I've seen a fix for this checked in for the next release (Dublin). I do not know if it will be backported to a future Berlin or Calgary patch.


richard_selby
Kilo Guru

Worked for us too.