From ca78783f58e3492782d32cd324789a14b5c3aa6f Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Thu, 12 Aug 2021 21:59:20 -0400 Subject: [PATCH] Added imapfilter_config.lua (redacted) --- imapfilter_config.lua | 75 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 imapfilter_config.lua diff --git a/imapfilter_config.lua b/imapfilter_config.lua new file mode 100644 index 0000000..0ae0cd0 --- /dev/null +++ b/imapfilter_config.lua @@ -0,0 +1,75 @@ +--------------- +-- Options -- +--------------- + +options.timeout = 120 +options.subscribe = true + + +---------------- +-- Accounts -- +---------------- + +-- Connects to "imap1.mail.server", as user "user1" with "secret1" as +-- password. +--account1 = IMAP { +-- server = 'imap1.mail.server', +-- username = 'user1', +-- password = 'secret1', +--} + +-- Another account which connects to the mail server using the SSLv3 +-- protocol. +mygmail = IMAP { + server = 'imap.gmail.com', + username = 'redacted', + password = 'redacted', + ssl = 'tls12', +} + +-- 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() + +-- Create a mailbox +--account1:create_mailbox('Friends') + +-- Subscribe a mailbox +--account1:subscribe_mailbox('Friends') + + +----------------- +-- Mailboxes -- +----------------- + +-- Get the status of a mailbox +mygmail.INBOX:check_status() + + +print(os.date("%Y-%m-%d %H:%M:%S Logwatch")) +results = mygmail.INBOX:contain_subject('Logwatch for') +results:mark_flagged() +print(os.date("%Y-%m-%d %H:%M:%S Logwatch")) + +print(os.date("%Y-%m-%d %H:%M:%S Facebook")) +results = (mygmail.INBOX:contain_from('facebookmail.com')) +results:move_messages(mygmail.archive) +print(os.date("%Y-%m-%d %H:%M:%S Facebook")) + +print(os.date("%Y-%m-%d %H:%M:%S Groupon")) +results = (mygmail.INBOX:contain_from('noreply@r.groupon.com')) +results:move_messages(mygmail.archive) +print(os.date("%Y-%m-%d %H:%M:%S Groupon")) + +print(os.date("%Y-%m-%d %H:%M:%S Mobile Saenger")) +results = (mygmail.INBOX:contain_subject('Saenger')) +results:move_messages(mygmail.archive) +print(os.date("%Y-%m-%d %H:%M:%S Mobile Saenger")) + +print(os.date("%Y-%m-%d %H:%M:%S Etsy")) +results = (mygmail.INBOX:contain_from('Etsy')) +results:move_messages(mygmail.archive) +print(os.date("%Y-%m-%d %H:%M:%S Etsy")) +