Hi peeps,
After a long time of using an Excuse of a mail server, I've reverted to Mercury, and it feels good to be back! Running 4.80 as a service (bought license)...
The only "problem" I have, like most people I suppose, is that of spam. I've got Spamhalter ticked, configured MercuryS to use Spamhaus, abuseat, spamcop etc and also added transaction filters for certain words in the MercuryS exceptions.
It's probably me not setting things up correctly, but these don't seem to cut the mustard.
So... I've written a little program that does what I need and it is triggered as a Policy on each mail that comes in.
We have a filter.rules file which specifies words to test each line for and the weight achieved when *all* are matched. For example, this is a simple rules file:
#weight, list of words separated by commas
100,subject:,flight,simulator
-1000,from:,@mydomain.com
*All* of the words have to appear for the weighting to be applied, so if "flight" and "simulator" are in the body, and not the subject, this won't trigger. Similarly if it is sent from @mydomain.com the weighting is reduced so the rule doesn't trigger
This program allows other lines within the email text to be tested not just the ones provided for in the transaction filter.
It is used like this:
Create a new policy
Type of task is "Run a program and examine the return code"
Command line is
mercuryfilter ~A TotalWeight AppendLog
for example:
mercuryfilter ~A 100 true
This will cause the program to trigger a policy failure if the total weighting of the all the rule triggers is equal to or greater than 100. It also creates a log file which can either be replaced by each new email or appended by each one. If you want to keep a log of all the emails passed through, set the AppendLog flag to true. There's a different log file for each day.
I also have step 4 set to forward the emails that fail to me, just so I can check...
If you want to have a try, it can be downloaded at http://www.ictis.net./downloads/MercuryFiltersInstaller.msi
Use with caution - no warranty is provided or implied! :-) It seems to do what I need it to here...
The program installs to the c:\mercury by default and needs DotNet 4.5.2 to be installed.
Hopefully I've not reinvented the wheel, but I'd appreciate any comments - especially if it's useful to someone else!
Tym
<p>Hi peeps,</p><p>&nbsp;After a long time of using an Excuse of a mail server, I've reverted to Mercury, and it feels good to be back!<span style="font-size: 10pt;">&nbsp;Running 4.80 as a service (bought license)...</span></p><p>The only "problem" I have, like most people I suppose, is that of spam.&nbsp; I've got Spamhalter ticked, configured MercuryS to use Spamhaus, abuseat, spamcop etc and also added transaction filters for certain words in the MercuryS exceptions.</p><p><span style="font-size: 10pt;">It's probably me not setting things up correctly, but these don't seem to cut the mustard.</span></p><p>So... I've written a little program that does what I need and it is triggered as a Policy on each mail that comes in.</p><p>&nbsp;We have a filter.rules file which specifies words to test each line for and the weight achieved when *all* are matched. For example, this is a simple rules file:</p><p><span style="white-space:pre"> </span>#weight, list of words separated by commas</p><p><span style="white-space:pre"> </span>100,subject:,flight,simulator</p><p><span style="white-space:pre"> </span>-1000,from:,@mydomain.com</p><p>&nbsp;*All* of the words have to appear for the weighting to be applied, so if "<span style="font-size: 13.3333px;">flight" and "simulator"&nbsp;</span>are in the body, and not the subject, this won't trigger. Similarly if it is sent from @mydomain.com the weighting is reduced so the rule doesn't trigger</p><p>This program allows other lines within the email text to be tested not just the ones provided for in the transaction filter.</p><p><span style="font-size: 10pt;">It is used like this:</span></p><p><span style="white-space:pre"> </span>Create a new policy</p><p><span style="white-space:pre"> </span>&nbsp;Type of task is "Run a program and examine the return code"</p><p><span style="font-size: 10pt;"><span style="white-space:pre"> </span>Command line is</span></p><p><span style="white-space:pre"> </span>mercuryfilter ~A TotalWeight AppendLog</p><p>&nbsp;<span style="font-size: 10pt; white-space: pre;"> </span><span style="font-size: 10pt;">for example:</span></p><p><span style="white-space:pre"> </span>mercuryfilter ~A 100 true</p><p><span style="font-size: 10pt;">This will&nbsp; cause the program to trigger a policy failure if the total weighting of the all the rule triggers is equal to or greater than 100. It also creates a log file which can either be replaced by each new email or appended by each one. If you want to keep a log of all the emails passed through, set the AppendLog flag to true. There's a different log file for each day.</span></p><p>I also have step 4 set to forward the emails that fail to me, just so I can check...&nbsp;</p><p>&nbsp;<span style="font-size: 10pt;">If you want to have a try, it can be downloaded at http://www.ictis.net./downloads/MercuryFiltersInstaller.msi</span></p><p>&nbsp;<span style="font-size: 10pt;">Use with caution - no warranty is provided or implied! :-) It seems to do what I need it to here...</span></p><p>&nbsp;<span style="font-size: 10pt;">The program installs to the c:\mercury by default and needs DotNet 4.5.2 to be installed.</span></p><p>&nbsp;Hopefully I've not reinvented the wheel, but I'd appreciate any comments - especially if it's useful to someone else!</p><p>&nbsp;</p><p>Tym</p><p>&nbsp;</p>