The autoproc package

[Tags: bsd3, library, program]

Autoproc is a utility which allows you to write an email filterer in an Haskell EDSL (embedded domain specific language); autoproc will then compile it down to a Procmail configuration file (.procmailrc). This file can then be used with Procmail to sort and filter your email before you see it.

[Skip to ReadMe]


Versions0.1, 0.1.1, 0.1.2
Change logNone available
Dependenciesbase (==4.*), directory, mtl, process, unix [details]
AuthorJason Dagit
MaintainerGwern Branwen <>
Home page
UploadedTue Jan 4 07:50:55 UTC 2011 by JasonDagit
Downloads616 total (30 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




Maintainers' corner

For package maintainers and hackage trustees

Readme for autoproc-0.1.2

= Autoproc =

Autoproc is a utility/language for email filtering.  Autoproc makes it
easy to define filtering rules.  The rules define a Haskell program,
that when executed generates a valid Procmail recipes file.  This file
can then be used with Procmail to sort and filter your email before
you see it.

You will need to have GHC or Hugs, Procmail and formail installed.

== Installation ==

To get a copy of Autoproc, use

  darcs get

If you don't have darcs do not despair, currently Autoproc is about 5
files and can be easily downloaded by pointing your web browser at the
address just given.

You can also visit Hackage, where you should be able to find a tarball of autoproc (or eventually you could install Autoproc through cabal-install).

== Customizing Autoproc ==

Autoproc runs on the XMonad model. If you aren't familiar with XMonad, the idea is that the package is constructed such that it provides a library, and then it compiles a thin executable using that library.

This is fine if the baked in configuration exactly suits your needs, but how do you have a system-wide XMonad which you can configure in a full Haskell style without some sort of Emacs-style interpreter? Well, the thin executable is tasked with looking for a xmonad.hs in a fixed location; if it exists, it gets compiled and the *new* binary gets run. And your personal xmonad.hs can do anything it wants - as all of XMonad's functionality is exposed as a library your xmonad.hs can import and modify at will. So your xmonad.hs boils down to 'main = xmonad $ myCrazyFunkyArgs'.

In Autoproc's case, what you do is create ~/.autoproc/autoproc.hs, and then set things up. (If you don't, Autoproc will use its compiled in configuration, which is surely not what you want.)

While I was testing this Xmonad-style configuration, I created an autoproc.hs that looks like this:

> import Autoproc.Configuration (defaultVariables)
> import Autoproc.Run
> import Autoproc.Rules.Dagit

> main ∷ IO ()
> main =  do print "foo bar"
>            autoprocMain defaultVariables dagitRules

('defaultVariables' provides the key-values of environmental variables, and 'dagitRules' is all the Procmail filtering rules.)

Now, this is the same environmental variables and configuration rules used by default, but there's nothing stopping me from taking defaultVariables and replacing it with

> myVariables = [("SHELL", "/bin/zsh")]

And I can run arbitrary stuff before and after the rules and variables are compiled down to text - my output will start with "foo bar", as useless a customization as that is...

== Running Autoproc ==

To run the autoproc binary and save your rules to the file recipes use the
following command:

  $ autoproc > recipes

If you are familiar with Procmail you may want to examine the file to
see that everything was generated correctly.  Once you are confident
that you would like to use this file, you can simply move it to
$HOME/.procmailrc Depending on your system you may need to do
additional configuration to get Procmail itself running.  Usually this
is done with a .forward file, or on some systems having a .procmailrc
is enough.