External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Discussion forum for Enterprise Edition.
Post Reply
tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Fri Apr 22, 2016 3:20 pm

Please help me in below script with multiple external domains like gmail, hotmail, yahoo mail etc.... Filter delete emails when person hit to my specific group.


Working proper with Gmail to my Domain Group email address (MailEnable Version 6.84)

FilterResult=0
If CriteriaMet([ME_FROM],"*@gmail.com") And _
CriteriaMet([ME_TOorCC],"GroupName@mydomain.com") Then
FilterResult=1
End If

Action : Delete Emails

I tried to add more external email addresses as below but not succeed :?

FilterResult=0
If CriteriaMet([ME_FROM],"*@gmail.com") And CriteriaMet([ME_FROM],"*@hotmail.com") And CriteriaMet([ME_FROM],"*@yahoo.com") And CriteriaMet([ME_FROM],"*@live.com") And CriteriaMet([ME_FROM],"*@outlook.com") And _
CriteriaMet([ME_TOorCC],"GroupName@mydomain.com) Then
FilterResult=1
End If

I will be very thankful to you if you help me in it.
Last edited by tanveer.hussain on Mon Apr 25, 2016 11:37 am, edited 2 times in total.

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Mon Apr 25, 2016 7:25 am

Expert Opinion required

MailEnable-Ian
Site Admin
Posts: 8951
Joined: Mon Mar 22, 2004 4:44 am
Location: Melbourne, Victoria, Australia

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by MailEnable-Ian » Tue Apr 26, 2016 1:33 am

Hi,

Try this script:

Code: Select all

FilterResult=0
If CriteriaMet([ME_FROM],"<REFERENCE><FILE>domains.txt</FILE><PATH>C:\Program Files (x86)\Mail nable\Config\Filters\Patterns</PATH><REFERENCE>") AND _
CriteriaMet([ME_TOorCC],"GroupName@mydomain.com") Then 
FilterResult=1
End If
You will need to create the text file "domains.txt" within the path specified on the criteria and add each domain embraced by wildcards.

Example:

Code: Select all

*@gmail.com*
*@yahoo.com*
Regards,

Ian Margarone
MailEnable Support

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Fri Apr 29, 2016 6:13 am

Thanks IAN for your response. I will check and let you know if it works. :)

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Tue May 10, 2016 7:41 am

IAN thanks for your script but is not working. :(

MailEnable-Ian
Site Admin
Posts: 8951
Joined: Mon Mar 22, 2004 4:44 am
Location: Melbourne, Victoria, Australia

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by MailEnable-Ian » Tue May 10, 2016 11:33 pm

Hi,

Can you provide more detail in regards to it not working?
Regards,

Ian Margarone
MailEnable Support

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Thu May 12, 2016 11:28 am

IAN,
I checked it with my test domain. i created multiple domains with given your script.

e.g. (Local Domains Test)
i restrict to group test_group@abc.com and i blocked abc1.com and abc2.com with file you mentioned in script with location but emails are receiving on said group :( . i strictly followed your instruction.

I yet not checked in my production server because of reliability or any malfunctioning in real environment.

Brett Rowbotham
Posts: 525
Joined: Mon Nov 03, 2003 7:48 am
Location: Cape Town

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by Brett Rowbotham » Fri May 13, 2016 4:14 am

Try this (based on your original script):

Code: Select all

FilterResult=0 
If (CriteriaMet([ME_FROM],"*@gmail.com") OR CriteriaMet([ME_FROM],"*@hotmail.com") OR CriteriaMet([ME_FROM],"*@yahoo.com") OR CriteriaMet([ME_FROM],"*@live.com") OR CriteriaMet([ME_FROM],"*@outlook.com")) AND _ 
CriteriaMet([ME_TOorCC],"GroupName@mydomain.com) Then 
FilterResult=1 
End If
Cheers,
Brett

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Sat May 14, 2016 12:57 pm

Thanks Brett,
I will check it and update you.

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Mon May 16, 2016 11:32 am

Bret above given script working but it blocks genuine traffic too :(. My requirement is to block traffic to specific group defined in script but if i approach to specific person on that domain it also blocking the traffic.

Need to block traffic on group@emaildomain.com but person can send email to any person on the same domain. if hit the group traffic should be blocked.

please help.

Brett Rowbotham
Posts: 525
Joined: Mon Nov 03, 2003 7:48 am
Location: Cape Town

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by Brett Rowbotham » Mon May 16, 2016 11:46 am

Post the actual text of your current script filter so we can check for any possible errors.

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Fri May 20, 2016 10:45 am

here i pasted the script which i am running

FilterResult=0
If CriteriaMet([ME_FROM],"*@a.com") OR CriteriaMet([ME_FROM],"*@b.com") OR CriteriaMet([ME_FROM],"*@xyz.com") AND _
CriteriaMet([ME_TOorCC],"group@abc.com") Then
FilterResult=1
End If

Brett Rowbotham
Posts: 525
Joined: Mon Nov 03, 2003 7:48 am
Location: Cape Town

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by Brett Rowbotham » Fri May 20, 2016 10:58 am

The OR section should be bracketed:

If (CriteriaMet([ME_FROM],"*@a.com") OR CriteriaMet([ME_FROM],"*@b.com") OR CriteriaMet([ME_FROM],"*@xyz.com")) AND _

You want the filter to trigger if any of the domains match (first condition) and the to/cc address is your group (second condition). The brackets are required to fully create the first condition.

Cheers,
Brett

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Sat May 21, 2016 9:58 am

Thanks Brett,
The Script is now working and deleting email who targets "group@abc.com" i have checked. but need to clarify one thing which is important. I observe that if anyone from else domain "@a.com" emailing to "domain abc.com" group and also a individual person of the same domain

It is working fine but i got the situation that if anyone send email to group and any person on the same domain in one email but it is also blocked by filter. is it possible to release block group but not block individual person in single email.

thanks

tanveer.hussain
Posts: 71
Joined: Mon Jan 18, 2016 8:10 am

Re: External Email (Gmail, Hotmail, Yahoo Mail) to My Domain Group Filter (Help Required)

Post by tanveer.hussain » Tue May 31, 2016 11:35 am

Waiting for respond.

Post Reply