User Tools

Site Tools


email:imapfilter

imapfilter config file (~/.imapfilter/config.lua); some items deleted for privacy reasons:

---------------
--  Options  --
---------------
 
options.timeout = 120
options.subscribe = true
 
----------------
--  Accounts  --
----------------
 
account1 = IMAP {
    server = 'exchange.host',
    username = 'user_name',
    password = 'password_here',
    ssl = 'ssl3',
}
 
-- Get a list of the available mailboxes and folders
mailboxes, folders = account1:list_all()
 
-- Get a list of the subscribed mailboxes and folders
mailboxes, folders = account1:list_subscribed()
 
-----------------
--  Mailboxes  --
-----------------
 
-- Get the status of a mailbox
account1.INBOX:check_status()
 
-- Get all the messages in the mailbox.
results = account1.INBOX:select_all()
 
-- Get newly arrived, unread messages
results = account1.INBOX:is_new()
 
-- LISTSERVS
 
results = account1.INBOX:contain_to('list_name@list_server')
results:move_messages(account1.Lists)
 
-- Courses (Emails from Canvas)
 
results = account1.INBOX:contain_subject('Course Number')
results:move_messages(account1.Course-Number)
 
-- Promotional Emails
 
results = account1.INBOX:contain_subject('Some Predictable Subject Text')
results:move_messages(account1.Lists)
 
-- SPAM 
results = account1.INBOX:contain_from('some dumb thing')
results:delete_messages()
email/imapfilter.txt · Last modified: 2015/12/09 14:15 by seanburns