Block emails from domains

tpritch
Mega Contributor

Hello,

We'd like to block emails from all but a few domains. This would not be for user creation but rather to simply stop processing the email when it's received.

Here is a straight forward example: When our instance receives an email from someone@mycompany.com the system generates an incident ticket. However if the email comes from someone@LinkedIn.com (or someone@ww.gety0urgr00veback.com) our instance ignores the email.

I've poked around and found some promising leads that ended up not fulfilling the requirement 100% and haven't found a thread completely dedicated to this so I thought I'd ask.

Does anyone out here have experience with this?

Thanks.

1 ACCEPTED SOLUTION

tpritch
Mega Contributor

Hey everyone,



I received a lot of great feedback about this. It turns out that we are going in a completely different (non-SN) direction to block domains. Both black list and white list would be large.



Thanks for the help!


View solution in original post

13 REPLIES 13

Check to see if it contains a specific domain...



var idx = email.origemail.indexOf('@gmail.com');


if (idx > -1) {


  current.insert();


}


else{


}


Mike Allen
Mega Sage

You could also put something directly on sys_email, like a business rule that states before insert, if the headers don't contain the whitelisted domains, delete them.



You can even create a table for whitelisting domains, then query it and make the decision at that time.


tpritch
Mega Contributor

I like the direction this discussion is going!


tpritch
Mega Contributor

Hey everyone,



I received a lot of great feedback about this. It turns out that we are going in a completely different (non-SN) direction to block domains. Both black list and white list would be large.



Thanks for the help!