Update imapfilter rules
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
490d7acff8
commit
3a38eae21d
1 changed files with 2 additions and 67 deletions
|
@ -6,20 +6,10 @@ function main()
|
|||
ssl = 'tls1',
|
||||
}
|
||||
|
||||
local victor = IMAP {
|
||||
server = 'imap.gmail.com',
|
||||
username = 'victorascroft@gmail.com',
|
||||
password = get_pwd_victor(),
|
||||
ssl = 'tls1',
|
||||
}
|
||||
|
||||
-- Make sure the account is configured properly
|
||||
sanchayan.INBOX:check_status()
|
||||
-- sanchayan['[Gmail]/Trash']:check_status()
|
||||
-- sanchayan['[Gmail]/Spam']:check_status()
|
||||
victor.INBOX:check_status()
|
||||
-- victor['[Gmail]/Trash']:check_status()
|
||||
-- victor['[Gmail]/Spam']:check_status()
|
||||
|
||||
-- Get all mail from INBOX
|
||||
mails = sanchayan.INBOX:select_all()
|
||||
|
@ -27,18 +17,12 @@ function main()
|
|||
-- Move mailing lists from INBOX to correct folders
|
||||
move_mailing_lists(sanchayan, mails)
|
||||
|
||||
mails = victor.INBOX:select_all()
|
||||
move_mailing_lists(victor, mails)
|
||||
|
||||
-- Get all mail from Sent Mail
|
||||
mails = sanchayan.Sent:select_all()
|
||||
|
||||
-- Move mailing lists from Sent mail to correct folders
|
||||
move_mailing_lists(sanchayan, mails)
|
||||
|
||||
mails = victor.Sent:select_all()
|
||||
move_mailing_lists(victor, mails)
|
||||
|
||||
-- Get all mail from trash
|
||||
mails = sanchayan['[Gmail]/Trash']:select_all()
|
||||
imap_trash = sanchayan['Trash']:select_all()
|
||||
|
@ -47,49 +31,17 @@ function main()
|
|||
move_to_gmail_trash(sanchayan, imap_trash, '[Gmail]/Trash')
|
||||
delete_from_trash(sanchayan, mails)
|
||||
|
||||
mails = victor['[Gmail]/Trash']:select_all()
|
||||
imap_trash = victor['Trash']:select_all()
|
||||
|
||||
-- Move mailing lists from trash to correct folders
|
||||
move_to_gmail_trash(victor, imap_trash, '[Gmail]/Trash')
|
||||
delete_from_trash(victor, mails)
|
||||
|
||||
-- Get all mail from spam
|
||||
mails = sanchayan['[Gmail]/Spam']:select_all()
|
||||
|
||||
-- Move mailing lists from spam to correct folders
|
||||
move_mailing_lists(sanchayan, mails)
|
||||
|
||||
mails = victor['[Gmail]/Spam']:select_all()
|
||||
move_mailing_lists(victor, mails)
|
||||
|
||||
end
|
||||
|
||||
function move_mailing_lists(account, mails)
|
||||
-- Stefan Agner
|
||||
move_if_to_contains(account, mails, "stefan@agner.ch", "Stefan")
|
||||
move_if_from_contains(account, mails, "stefan@agner.ch","Stefan")
|
||||
move_if_cc_contains(account, mails, "stefan@agner.ch","Stefan")
|
||||
move_if_to_contains(account, mails, "stefan.agner@toradex.com", "Stefan")
|
||||
move_if_from_contains(account, mails, "stefan.agner@toradex.com","Stefan")
|
||||
move_if_cc_contains(account, mails, "stefan.agner@toradex.com","Stefan")
|
||||
|
||||
--Barebox
|
||||
move_if_to_contains(account, mails, "barebox@lists.infradead.org", "Barebox")
|
||||
move_if_from_contains(account, mails, "barebox@lists.infradead.org","Barebox")
|
||||
move_if_cc_contains(account, mails, "barebox@lists.infradead.org", "Barebox")
|
||||
|
||||
--Buildroot
|
||||
move_if_to_contains(account, mails, "buildroot@busybox.net", "Buildroot")
|
||||
move_if_from_contains(account, mails, "buildroot@busybox.net","Buildroot")
|
||||
move_if_cc_contains(account, mails, "buildroot@busybox.net", "Buildroot")
|
||||
move_if_to_contains(account, mails, "buildroot@buildroot.org", "Buildroot")
|
||||
move_if_from_contains(account, mails, "buildroot@buildroot.org","Buildroot")
|
||||
move_if_cc_contains(account, mails, "buildroot@buildroot.org", "Buildroot")
|
||||
move_if_to_contains(account, mails, "buildroot@uclibc.org", "Buildroot")
|
||||
move_if_from_contains(account, mails, "buildroot@uclibc.org","Buildroot")
|
||||
move_if_cc_contains(account, mails, "buildroot@uclibc.org", "Buildroot")
|
||||
|
||||
move_if_from_contains(account, mails, "gstreamer-devel@lists.freedesktop.org", "gstreamer")
|
||||
move_if_from_contains(account, mails, "gstreamer-embedded@lists.freedesktop.org", "gstreamer")
|
||||
|
||||
-- Linux Kernel
|
||||
move_if_to_contains(account, mails, "lists.infradead.org", "Linux Kernel")
|
||||
|
@ -108,15 +60,6 @@ function move_mailing_lists(account, mails)
|
|||
move_if_from_contains(account, mails, "monster.com","Jobs")
|
||||
move_if_from_contains(account, mails, "naukri.com","Jobs")
|
||||
|
||||
-- OE
|
||||
move_if_to_contains(account, mails, "openembedded-devel@lists.openembedded.org","Openembedded")
|
||||
move_if_from_contains(account, mails, "openembedded-devel@lists.openembedded.org","Openembedded")
|
||||
move_if_cc_contains(account, mails, "openembedded-devel@lists.openembedded.org","Openembedded")
|
||||
|
||||
-- Kernel Newbies
|
||||
move_if_to_contains(account, mails, "kernelnewbies@kernelnewbies.org", "kernel newbies")
|
||||
move_if_from_contains(account, mails, "kernelnewbies@kernelnewbies.org","kernel newbies")
|
||||
move_if_cc_contains(account, mails, "kernelnewbies@kernelnewbies.org","kernel newbies")
|
||||
end
|
||||
|
||||
function move_if_subject_contains(account, mails, subject, mailbox)
|
||||
|
@ -167,14 +110,6 @@ function get_imap_password(file)
|
|||
return str;
|
||||
end
|
||||
|
||||
function get_pwd_victor()
|
||||
local cmd = "gpg2 --use-agent --quiet --batch --decrypt ~/.victor.gpg"
|
||||
local fd = io.popen(cmd, 'r')
|
||||
pass = fd:read("*a")
|
||||
fd:close()
|
||||
return pass;
|
||||
end
|
||||
|
||||
function get_pwd_sanchayan()
|
||||
local cmd = "gpg2 --use-agent --quiet --batch --decrypt ~/.sanchayan.gpg"
|
||||
local fd = io.popen(cmd, 'r')
|
||||
|
|
Loading…
Reference in a new issue