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

Thanks for the answer @Maham Tahir .
Could you please provide any official documentation available, so that I'll try to explain to my team/Stakeholders on the same.

I don't have any official link for this scenario this is something I observed and thought could be the issue by looking into your question.

Okay, no problem. Let me have a discussion with my Tech Archs in the following day. 
I'll make sure to update, if any conclusive evidence found.

Thanks

JenniferRah
Mega Sage
Mega Sage

So you expect your email to be sent to an inactive user? I guess I'm confused as to why you would want that.

@JenniferRah yeah same thoughts when I read that question then I thought maybe there could be any requirement @Anil9866 needs to send email to inactive users.