Evochallenge

Freedom from spam...

He who would give up freedom for security deserves neither

 
 

Manual Installation

Download the needed files from SourceForge.  Untar and unzip the evochallenge tar file.  Inside the evochallenge directory, you'll find four perl scripts: evochallenge.pl, evo-whitelist.pl, evo-strip-vcf.pl and evo-smtp-client.pl.  Copy these to /usr/bin.

Then, add a new filter to Evolution to execute the evochallenge.pl script.  Under the edit menu, select "Message Filters".  Then, add a new filter.  Where it says "Sender" followed by "Contains", change "Sender" to "Pipe to Program".  In the text box after that, put "/usr/bin/evochallenge.pl".  For an action, I created a "Holding" folder, and had e-mails where evochallenge.pl returns non-0 moved there.  My filter looks like:

Evochallenge rule

Next, create a .whitelist file in your home directory.  It should look like:

    # The maximum number of days we hold mail.
    #max-age 30.0
    # If you want to truely verify that a real person is trying to contact you,
    # uncomment the question and awnser fields, and make up your own.
    # The user will have to reply with an e-mail containing the answer
    # to get white-listed.
    #question What color is the sky on a clear day?
    #answer blue
    # This example allows mail from bill@billrocks.org through.
    #from bill@billrocks.org
    # This example allows mail sent to sourforge.net lists to get through.
    #to .sourceforge.net

    # Set these options in order for your mail to be forwarded to you
    # when authorised.  You must at least set the SMTP host.
    smtp-host <your SMTP host>      #Host name or address of the SMTP server.
    #smtp-port 25                   #Port where the SMTP server is listening.
    #smtp-hello-host EHLO           #String to use in the EHLO/HELO command.
    #smtp-disable-ehlo              #Don't use ESMTP EHLO command, only HELO.
    #smtp-force-ehlo                #Use EHLO even if server doesn't say ESMTP.
    #smtp-disable-starttls          #Don't use encryption even if the remote
                                #host offers it.
    #smtp-enable-auth               #Enable all methods of SMTP authentication.
    #smtp-auth-login                #Enable only AUTH LOGIN method.
    #smtp-auth-plain                #Enable only AUTH PLAIN method.
    #smtp-auth-cram-md5             #Enable only AUTH CRAM-MD5 method.
    #smtp-user <username>           #Username for SMTP authentication.
    #smtp-pass <password>           #Corresponding password.

You must set the smtp-host to the name of your SMTP server.  If your SMTP server requires authentication, uncomment smtp-user and smtp-pass, and set <username> and <password> to the username and password your SMTP host expects.  Chances are that your sever uses plain text passwords, so try uncommenting smtp-auth-plain.

Evochallenge also includes an outgoing mail filter script called "evo-whitelist.pl".  If you create an outgoing mail filter that pipes to this command, it will automatically add outgoing e-mail recipients to the whitelist.  Be sure to select "Outgoing" filters in the filter dialog box.  It's at the top:

Outgoing filters

Then, build the outgoing white list filter.  Mine looks like:

Whitelist rule

Once all this is working, you're in good shape, and people will start being challenged before they can send e-mail to you.

That's all that's required to start using Evochallenge.  Enjoy killing spam!

The Whitelist

If you're like me, you already have a ton of contacts in your address book, and you'd like them to automatically be white-listed.  To add contacts from your address book to your whitelist, go to your contact list, and do a "File/Save Address Book As VCard".  This will create a list.vcf text file that has your e-mails listed in it.  The perl script "evo-strip-vcf.pl" can be used to help extract the e-mails from this file.  To use it, save your list.vcf file, and type:

    evo-strip-vcf.pl < list.vcf | sort -u >> ~/.whitelist

You should maintain your .whitelist file carefully to allow your real contacts through.  By default, Evochallenge will create a .whitelist file in your home directory that looks like:

    # You must specify your e-mail address here.
    my-email bill@viasic.com
    # The maximum number of days we hold mail.
    max-age 30.0
    # This example allows mail from bill@billrocks.org through.
    #from bill@billrocks.org
    # This example allows mail sent to sourforge.net lists to get through.
    #to .sourceforge.net

    # Set these options in order for your mail to be forwarded to you
    # when authorised.  You must at least set the SMTP host.
    smtp-host mail.bellsouth.net             #Host name or address of the SMTP server.
    #smtp-port 25                   #Port where the SMTP server is listening.
    #smtp-hello-host EHLO           #String to use in the EHLO/HELO command.
    #smtp-disable-ehlo              #Don't use ESMTP EHLO command, only HELO.
    #smtp-force-ehlo                #Use EHLO even if server doesn't say ESMTP.
    #smtp-disable-starttls          #Don't use encryption even if the remote
                                #host offers it.
    #smtp-enable-auth               #Enable all methods of SMTP authentication.
    #smtp-auth-login                #Enable only AUTH LOGIN method.
    #smtp-auth-plain                #Enable only AUTH PLAIN method.
    #smtp-auth-cram-md5             #Enable only AUTH CRAM-MD5 method.
    #smtp-user <username>           #Username for SMTP authentication.
    #smtp-pass <password>           #Corresponding password.

Make sure to specify your own e-mail address with the 'my-email' declaration. This tells Evochallenge where to forward held mail, and is used in the challenge e-mails.  Also be sure to set your smtp-host, and if required, your smtp user and password.

If the "TO:" or "FROM:" lines in an e-mail are matched by a "to" or "from" declaration, they will be allowed.  Otherwise, a challenge e-mail is sent to the sender.  If he replies, his e-mail will be added to the .whitelist file, and future e-mails will come right through.  Otherwise, the filter will move his e-mails to your "Holding" directory (or whatever you called it).  The patterns listed in "to" and "from" declarations match if they are are found as a substring in an e-mail address, and matching is case insensitive.  So, "from @billrocks.org" matches anyone from billrocks.org, and "IBM.com" matches tom@ibm.com, but also fred@i_am_not_ibm.com.

By default, Evochallenge holds mail in ~/.heldmail for 30 days while waiting for authorization.  After that, the e-mails are deleted.  If you want to change the default, use the max-age declaration.

Reducing Junk in Your Holding Folder

Evolution has a pretty good spam filter built into it.  With Evochallenge installed, you may noticed that you get a lot more spam in your Holding folder than you ever got in your Inbox.  That's because the Evochallenge filter runs before Evolution's junk test.  If you occasionally scan your Holding folder, you may want less spam there.

The following "Junk" filter should be listed at the very top of your filter list.  That way, junk gets deleted, and never has a change to match any of your e-mail filters.

Junk rule

Be sure to set "If any criteria are met".  The first test runs Evolution's built-in junk test.  The second test executes evo-bounce.pl, which tries to determine if the e-mail is a bounced response to a challenge.  Challenges to most spammers simply does bounce, so there's no point filling up your Holding folder with bounce messages.  The "Delete" action marks the message for deletion, so it will be moved to your Trash folder.  The "Stop Processing" action is required to keep the Challenge-response message filter from overriding and having mail moved to Holding.

Be sure to list the Junk test first.  Here's an image of my own filter list.  Note that I moved "Junk" to the top using the "Up" button repeatedly.

Filter list


SourceForge.net Logo

 

Download

Sourceforge.net

Forum

Billrocks.org

Dumb Ideas

Copyleft 2006 All rights approved.