May 4th 2010

Rotating email into your inbox using imapfilter

UPDATE: You may be interested in my IMAP email toolbox instead.

I'm not a fan of "life hacks", but I have the adopted the following automated processing of my email inbox: if I don't want to deal with a message today, I move it to (eg.) Mail.DELAYED.4 and it will reappear in my inbox automatically in 4 days.

It is inspired by Inbox Zero, tickler files and the Debian DELAYED queue.

My implementation uses imapfilter. You'll need to tweak the move_messages syntax for lenny's version; the following works fine in squeeze and sid:

mbox = IMAP {
    server = '',
    username = 'username',
    password = 'password',
    ssl = 'ssl3'

num = 14
dst = 'INBOX'
prefix = 'Mail.DELAYED.'

for x = 1, num do
    mbox[prefix .. x]:select_all():move_messages(
        mbox[x == 1 and dst or prefix .. (x - 1)]

The messages are moved when I'm (hopefully) asleep:

# m h dom mon dow command
  0 6 *   *   *   imapfilter -c /path/to/delayed.lua >/dev/null

You can subscribe to new posts via email or RSS.