Re: [exim] Exim Filters Bypass

Top Page
Delete this message
Reply to this message
Author: Usama Tariq
Date:  
To: Mike Brudenell
CC: Exim Users
Subject: Re: [exim] Exim Filters Bypass
Hi Mike,

Thanks for your reply, Actually i want to exempt the specific domain or
email id on which subject filter not implemented. So i got a below solution
for that.

`````````````````````````````````````````````
logfile /var/log/filter.log 0644
if
($received_protocol is "local"
or $received_protocol is "smtp"
or $received_protocol is "smtps"
or $received_protocol is "esmtp"
or $received_protocol is "esmtpa"
or $received_protocol is "esmtps"
or $received_protocol is "esmtpsa")
and ($message_headers does not contain "xyz@???")
and ($message_headers does not contain "websouls@???")
and ("$h_subject:" contains "swiss")
or ("$h_subject:" contains "sales")
or ("$h_subject:" contains "marketing")
or ("$h_subject:" contains "promotions")
then
logwrite "$tod_full $message_id from $sender_address contained **SPAM**
$message_body to $h_to keywords"
fail text "Your mail is not welcome."
seen finish
endif







With Best Regards,


[image: photo]
*Usama Tariq | NetOps Engineer*
Websouls
p:92.423.523.8871-73 | m:92.321.4077991 | e:usama@??? | w:
http://websouls.com/ | a: Office # 22, 2nd Office Floor, IT Tower,
Behind Hafeez Center, 73-E-1, Hali Road, Gulberg III, Lahore
<http://www.facebook.com/WebSouls>


On Fri, Mar 17, 2017 at 2:33 PM, Mike Brudenell <mike.brudenell@???>
wrote:

> Hi, Usama -
>
> It's not clear what you're asking, so a very general answer…
>
> You can find the documentation for the Exim Filter Specification at
>
> http://www.exim.org/exim-html-current/doc/html/spec_html/filter.html
>
>
> Section 3.4 says that "A complete list of the available variables is given
> in the Exim documentation" so you can presumably use any of the variables
> in conditions. You can get the domain of the sender and/or recipient out of
> these, and the Message-ID, for your tests.
>
> Later in the specification there are examples of using "and" and "or" to
> combine conditions.
>
> Finally, you might want to consider using "matches" instead of "is" or
> "contains" to combine some of your expressions using regular expressions.
> For example, the following (which are *untested*):
>
> $received_protocol matches "^(?i)smtps?|esmtp(?:s(?:a)?)?$"
>
> or
>
> $h_subject matches "(?i)swiss|sales|marketing|promotions"
>
>
> Cheers,
> Mike B-)
>
> On 16 March 2017 at 07:33, Usama Tariq <usama@???> wrote:
>
>> Dear Concern,
>>
>> Is it possible to bypass any specific domain or email id from global exim
>> filter:
>>
>> #cat /usr/local/cpanel/etc/exim/sysfilter/options/cpanel_exim_sys
>> tem_filter
>>
>> if
>> ($received_protocol is "local"
>> or $received_protocol is "smtp"
>> or $received_protocol is "smtps"
>> or $received_protocol is "esmtp"
>> or $received_protocol is "esmtpa"
>> or $received_protocol is "esmtps"
>> or $received_protocol is "esmtpsa")
>> and ("$h_subject:" contains "swiss")
>> or ("$h_subject:" contains "sales")
>> or ("$h_subject:" contains "marketing")
>> or ("$h_subject:" contains "promotions")
>> then
>> logwrite "$tod_full $message_id from $sender_address contained **SPAM**
>> $h_subject to $h_to keywords"
>> seen finish
>> endif
>>
>>
>> With Best Regards,
>>
>>
>> [image: photo]
>> *Usama Tariq | NetOps Engineer*
>> Websouls
>> p:92.423.523.8871-73 | m:92.321.4077991 | e:usama@??? | w:
>> http://websouls.com/ | a: Office # 22, 2nd Office Floor, IT Tower,
>> Behind Hafeez Center, 73-E-1, Hali Road, Gulberg III, Lahore
>> <http://www.facebook.com/WebSouls>
>> --
>> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
>> ## Exim details at http://www.exim.org/
>> ## Please use the Wiki with this list - http://wiki.exim.org/
>>
>
>
>
> --
> Systems Administrator & Change Manager
> IT Services, University of York, Heslington, York YO10 5DD, UK
> Tel: +44-(0)1904-323811 <+44%201904%20323811>
>
> Web: www.york.ac.uk/it-services
> Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm
>