Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Email Filter

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
= RGTE: An email filter

RGTE is a small, opinionated email filter which processes and filters incoming email into Maildirs.

== License

RGTE is copyright 2008 Scott Barron.  It is licensed under the MIT license.  See the included MIT-LICENSE file for details.

== Installation

$ [sudo] gem install --source rgte

One of these days I'll register a Rubyforge project for the gem, but that's such a pain.

And don't forget that trailing slash - otherwise it doesn't go.

== Usage

Set up whatever processes your incoming mail to pipe through rgte.  Examples:

Using .forward:

  $ cat ~/.forward
  "|exec /usr/local/bin/rgte"

Using procmail:

  $ cat ~/.procmail
  | /usr/local/bin/rgte

Using fetchmail:

  $ cat ~/.fetchmailrc
  poll protocol imap:
    user "" there has password "blah" ssl
    is "foo" here and wants mda "/usr/local/bin/rgte"

Write your filters in ~/.rgte
  # Set up some configuration
  config :maildir_root => '/home/scott/Maildir', :maildir_backup => '/home/scott/Mail-backup'

  # Keep a copy of every email in :maildir_backup

  # sets up an alias, :me, containing my addresses
  group :me, '', ''

  # Mark every message that's From the :me alias as read

  # Pipe the mail through spamprobe, file it into @spam if it's a hit and halt processing
  pipe('/usr/bin/spamprobe train', /^SPAM/, '@spam').halt

  # Put every message From this address into archive and mark it read
  from('', 'archive').read

  # Email lists - list is a shorthand that matches To, Cc, and From
  list '',                        'lists/hbd'
  list '',                 'lists/rubycore'
  list '',          'lists/dtrace'

== Contact

Send questions or feedback to Scott Barron (

Something went wrong with that request. Please try again.