SortMyMails


SortMyMails is a small ruby script, which sorts mails via IMAP, acting as a client. It's therefore not only portable, but also completely server agnostic.

Usage:                          ruby1.8 ./sortmemails configfile [verbose]
For Help and Config-Syntax:     ruby1.8 ./sortmemails help

Configfile Syntax:

host: %host%
ssl: %true/false%
port: %port%
auth: %login/md5/plain%
user: %user%
inbox: %inbox%
password: %password%
interval: %interval%
sort: %imap search commands%||||%folder%


IMAP Search-Commands

Example: "SUBJECT hello NOT NEW"
Keywords: BEFORE BODY CC FROM NEW NOT OR ON SINCE SUBJECT TO

Your config could look like this. The format should be pretty self-explanatory.

host: mail.johnsmail.com
user: john
password: asd123
ssl: true
auth: plain
inbox: INBOX
interval: 30
sort: TO spam@bullshitdomain.de||||Spam
sort: SUBJECT *****SPAM*****||||Spam
sort: TEXT bugtraq.list-id.securityfocus.com||||Listen.SecurityFocus.Bugtraq
sort: TEXT ruby-talk||||Ruby

Download SortMyMails here or check out the svn-repository.

svn co http://svn.skrrl.org/svn/sortmemails.paulasmuth.de/