Pegasus Mail & Mercury

Welcome to the Community for Pegasus Mail and
The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
Welcome to Pegasus Mail & Mercury Sign in | Join | Help
in
Home Blogs Forums Downloads Pegasus Mail Overview Mercury Overview Wiki

Mail filtering add on

Last post 11-15-2018, 18:52 by Brian Fluet. 4 replies.
Sort Posts: Previous Next
  •  09-13-2018, 12:26

    • Tym is not online. Last active: 15 Nov 2018, 18:07 Tym
    • Top 500 Contributor
    • Joined on 09-13-2018
    • Preston, UK
    • Member
    • Points 200

    Mail filtering add on

    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

     


    Tym
    Filed under: ,
  •  09-13-2018, 20:12

    • PaulW is not online. Last active: 08 Dec 2018, 10:43 PaulW
    • Top 10 Contributor
    • Joined on 05-08-2007
    • UK
    • SuperStar
    • Points 18,225

    Re: Mail filtering add on

    Interesting, and thanks for sharing it.

    They always say that no two folks' spam is the same and I find that not much gets through my Mercury with a similar setup.  The main difference is that I use Clamwall with extra signatures from Sanesecurity.com, and that leaves little for a well-trained Spamhalter to do.

    It's useful to have a log and the ability to forward spam mails as you do - just in case of false positives. 

  •  09-14-2018, 3:20

    • Brian Fluet is not online. Last active: 12-09-2018, 18:45 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 22,730

    Re: Mail filtering add on

    I'm use Clamwall with extra SaneSecurity signatures as well in conjunction with POPFile instead of Spamhalter.

    All spam tagged messages are filtered to a Spam mailbox for review.  The rare false positives get fowarded to the appropriate user from there.

  •  11-15-2018, 18:07

    • Tym is not online. Last active: 15 Nov 2018, 18:07 Tym
    • Top 500 Contributor
    • Joined on 09-13-2018
    • Preston, UK
    • Member
    • Points 200

    Re: Mail filtering add on

    I've just had a look at Sanesecurity.com and to be honest, it's confused me! 

    I'd appreciate any guidance on how you set this up please as the spam email issue is rather annoying...


    Tym
  •  11-15-2018, 18:52

    • Brian Fluet is not online. Last active: 12-09-2018, 18:45 Brian Fluet
    • Top 10 Contributor
    • Joined on 12-24-2014
    • North Carolina, USA
    • SuperStar
    • Points 22,730

    Re: Mail filtering add on

    SaneSecurity signatures are not for spam control.  They are additional antivirus/antimalware signatures that can utilized by ClamAV.

    Spam control is is done using the built-in Spamhalter or a third party app like POPFile.  Both utilize bayesian filtering through which incoming mail passes.  Both add a header on which you can filter.  Both must be trained. 

    I can't recommend one over the other because I've only used POPFile but my sense is that both are equally effective.  SpamHalter is built-in so is the logical one to utilize.  Support is available on this forum.

    Edit:  Correction... Support is available on the Mercury Community Support forum

    Also, There is a guide to SpamHalter available here:  http://www.vandenbogaerde.net/pegasusmail/pf_sh_index.html.  It is based on the Pegasus Mail helpfile but is applicable to Mercury in most respects.

View as RSS news feed in XML

Contact | Advertise | Host provider: PraktIT | Terms of Use | Privacy Statement
Copyright © 2007-2011 David Harris / Peter Strömblad. | Pegasus Mail Home Page