Recipient is missing in To of a Mail from Zurich Release

Anil9866
Tera Expert

Hi SN folks,

I'm observing this behavior in my recent Zurich release instance, 
Scenario: While sending email to a user in Users table, while the user is inactive. But the same is sending in non Zurich release instances
Description: I'm triggering an email via widget server side, 

gs.eventQueue("event_Name", grScReq,to,reason);
grScReq = glideRecord object of Requested items table
to  = 

            var user = new GlideRecord('sys_user');
            user.addQuery('user_name', cUser);
            user.setLimit(1);
            user.query();
            if (user.next()) {
                email = user.email + '';
            }
var origCFM = grScReq.variables.variable_Name.toString();
            if (origCFM != '') {

                origCFM = origCFM + '@exampleDomain.com';
            }
var to=[];
            to.push(email);
            to.push(origCFM);
 
Now, in my email logs, it is saying excluded recipients because user's "Active" setting is disabled:.
when origCFM is set to inactive in Users table.
 
This behavior is reflecting only in Zurich instance, in another instance it is working as expected.
 
I'll appreciate your comments or resolution for this issue.
Thanks in advance.
 
1 ACCEPTED SOLUTION

Maham Tahir
Mega Guru

Hi @Anil9866

 

Even though you are passing a raw email string (e.g., user@domain.com) in your gs.eventQueue parameters, the ServiceNow Email engine automatically looks up that email address in the sys_user table. If it finds a matching user record that is inactive, and the system is configured to ignore inactive users, it will drop the email with the "excluded recipients" error

 

You need to check/update a specific System Property that controls this behavior.

 

Note: If you are on a new release like Zurich, security settings are often hardened by default, which is why this property may be enforcing the restriction now where it wasn't before.

 

If you find my response helpful, mark it as helpful and accepted solution.

 

Regards, 

Maham Tahir.

View solution in original post

10 REPLIES 10

Hey @JenniferRahthanks for looking into the query.
Here my expectation is not sending mail to inactive users, but more focused on why it is delivering when done via Email script, why it shouldn't delivered when configured via Email notification. Hope I'm making sense.