I have to allow more than one email address those can send emails to ServiceNow instance.

niveditakumari
Mega Sage

Hi, 

 

I have to allow more than one email address those can send emails to ServiceNow instance. 

I'm working on inbound action and I want to allow multiple domains hat can send emails to my ServiceNow instance and I want to create multiple email account for my ServiceNow instance. 

Can anyone please tell me how we can achieve. 

 

Regards, 

Nivedita

 

 

1 ACCEPTED SOLUTION

niveditakumari
Mega Sage

Hi All, 

 

We can achieve it by using email address filter. 

1. Create Email Address filter and add that domain name in domains field that you want to allow

and add domain name in exceptions which you don't want to allow. 

2. Create System Address filter and add this Email Address filter in that. 

3. Open POP3 Email Account and add System Address filter in that. 

Please see screenshot to achieve it : 

find_real_file.png 

 

Hope this helps to everyone. 

 

 

Regards, 

Nivedita

 

 

View solution in original post

34 REPLIES 34

I am assuming the mails in property are the ones you do not want to accept. If so, try below.

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {

var donotaccept=gs.getProperty('allow_domains'); 
if(email.origemail.indexOf(donotaccept)>-1){
//no action to be performed
}

else{
//update and perform below action
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject; 
current.rich_description = email.body_text; 
current.opened_by = gs.getUserName(); 
current.subject_person = gs.getUserName(); 
current.opened_for = gs.getUserName(); 
current.hr_service = '6628cde49f331200d9011977677fcf0b'; 
current.notify = 2;
current.contact_type = "email";

if (email.body.assign != undefined)
   current.assigned_to = email.body.assign;

if (email.importance != undefined) {
   if (email.importance.toLowerCase() == "high") {
        current.impact = 1;
        current.urgency = 1;
   }
} 
current.insert();
}

})(current, event, email, logger, classifier); 

 

 

In sys property I have provided emails that I want to accept. 

 

Regards, 

Nivedita

 

 

Then the code you shared can be used as is & should work.

niveditakumari
Mega Sage

 

When I'm sending email from email id which is not added in sys property I can see system is receiving email but it should not receive that email. 

It is not creating HR case but system is receiving email and in email log it is showing 

  Create Incident(HR) scope : did not create or update sn_hr_core_case using current

Can anyone please help me to fix this. 

 

Regards, 

Nivedita

 

 

 

Hi,

for this you add the email address of sender in the Ignore Sender in the Email Address Filter Module. Table name is: - sys_email_address_filter.