Giter Club home page Giter Club logo

dystill's Introduction

dystill
by Rob Peck <[email protected]>

dystill is a sorting, filtering MySQL-based Mail Delivery Agent written in 
Python. See INSTALL for installation instructions, and LICENSE for the code 
license agreement.

RULES EXPLAINED

Once you have the software installed and working, the next step is to add some
rules to get it to do what you want. Right now, there is no graphical front-end
to the SQL database, but writing one or adding it to an existing mail package
should be trivially easy.

The filters Table:

The main table that dystill uses is the filters table. This table consists of a 
unique identifier (filter_id), an email field representing the email address of
the recipient, a field, a value, an integer that determines whether or not a 
filter is active or not, and a comparison field that describes the type of 
comparison taking place.

The comparison types are:
 0 = Starts With
 1 = Ends With
 2 = Contains
 3 = Is (an exact equals)
 4 = Regular Expression

The fields you really need to worry about are the field and value fields. These
represent a header, and a regular expression match against the value of the 
header.

For example:

insert into filters set email='[email protected]', field='X-Spam-Flag', 
comparison=3, `value`='YES', active=1;

This will create a filter that matches on the spam flag. Using regular 
expressions, you can create complex filters or very simple ones. It's up to you.
If you filters with a user_id of 0, these are automatically applied to all 
messages. This is useful for spam filtering.

The actions Table:

The accompanying filters_actions table describes the actions that are taken when
a filter matches. This table consists of a unique ID (action_id), a filter_id 
linking back to the filters table, an action string, and an argument string.

The big two are the action and argument. Valid actions are:

 * markasread - Marks the message as read.
 * flag       - Flags a message.
 * deletes    - Deletes a message. The message is still delivered, but is marked
                for deletion.
 * prependsub - Prepends text to the subject string. The argument shoud be the
                string to prepend.
 * header     - Adds a header to the message. The argument should be a key:value
                pair.
 * forward    - Automatically queues a forward message to a specified address.
                The argument should be the address you want to forward it to. 
 * block      - Silently blocks delivery. This will tell the MTA that the 
                message was delivered, but will silently dispose of it.
 * blocknote  - Blocks delivery, but informs the sending address that delivery
                was blocked. Also called "ex-girlfriend logic."
 * copyto     - Duplicates the message, and puts a copy in a different folder.
                The argument should be the folder you want to move it to.
 * to         - Moves the message to the specified folder. The argument should
                be the address you want to move it to.
 
By the time it reaches the end of the action chain, if the message hasn't been
delivered, it is automatically added to the inbox as any normal email would be.

dystill's People

Contributors

peckrob avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.