Is there a way to ignore certain users on inbound email processing?

seberly
Giga Expert

We have separate admin IDs in our instances, but they have the same email address as their regular account.

Example:

1) The itil account "seberly" has an email of seberly[at]armstrong[dot]com

2) The admin account "seberly-admin" has an email of seberly[at]armstrong[dot]com

The problem is when I send an email to instance@service-now.com, the system associates that email with my seberly-admin instead of seberly.   I am wondering if there's a way to ignore a group of users (in this case the admins) when associating emails with users.   I understand that we could probably do perform some scripting magic to remedy, but I'm looking to solve the problem before the inbound email actions get processed.

NOTE: I am NOT looking to ignore a sender (email property).   I am looking to exclude users from being associated with an email.

Thanks,

Scott

1 ACCEPTED SOLUTION

Played around with this and Julian's suggestion of a business rule on the sys_email is the only way to accomplish this unfortunately.   As soon as the inbound emails are processed, server side Java is executed matching the from email address to a user record, only looking at active users.   Since this is done server side, there is not a way for you to change this, but you can create a before insert business rule on sys_email to accomplish this:


find_real_file.png


Pay attention to the order I set above.   There is an out of the box business rule with an order of 1100 that runs before insert that sets the mailbox to Inbox so it is important that we run this after that.



Then on the advanced tab, create a script to find the correct user.   You can use the sys_email's user_id reference field to dot walk and get the email address so you can query for other users with that same email.   Once you have the right user then you will need to update both the user (string field storing the sys_id) and user_id (reference field to user record) fields on this sys_email record.



I hope this helps!


View solution in original post

11 REPLIES 11

Kalaiarasan Pus
Giga Sage

Not sure if I understand this correctly. But do you want your admins not receive any mails at all ? If that is the case disabling the notification field on the user record will stop the mails from being sent


Kalaiarasan,



Thanks for your response.   No, I'm looking to exclude them from being associated with an inbound email.   If that field does both, great, but my preference would be for admins to still be able to receive emails.



Thanks,


Scott


we import our users from LDAP


we use a combination of


importing only from specific OU's which eliminates all our global admins.


looking at their UPN as the admin accounts as they are typically @ad.xxxx.xxx whereas our user accounts are typically @<compamy>.com etc


we also look and if the username contains -admin, starts with a # (test account) or has _svc (service account) we ignore them



Annoyingly, for some 3rd party partners who use our Instance and are under our admin OU, so the import has to do some checking on the OU structure to all those users to import correctly.



works pretty well for us.


Julian,



I actually need these admin accounts.   These are local admin accounts for ServiceNow administrators (separate of their ITIL account).   We have similar process for weeding our AD admin accounts as well.



During SN's processing of an email received by the instance (sent to <instancename>@service-now.com), that email gets associated with a user if possible.   It looks like the email address is what it's matching on.   So, in my instance I have the two accounts in my original description.   They both have the same email address.   When I send an email from seberly[at]armstrong[dot].com the email in SN gets associated with seberly-admin instead of seberly which is a problem because I don't want my admin account commenting on incidents that I am working on.   I want my ITIL account commenting instead.



Hope that helps,


Scott