Myaccount = IMAP {
server = 'mail.me.com',
username = 'your.name@me.com',
password = 'yourpassword',
ssl = 'tls1'
}
folders = {'folder1', 'folder2', 'folder3'}
for k,folder in pairs(folders) do
foldername = 'Mailinglists/' .. folder
results = myaccount[foldername]:is_older(90)
myaccount[foldername]:delete_messages(results)
end
My mailing lists are hosted under a sub-folder called "Mailinglists", as you can notice in the config file above. You can tweak this to your liking. It might also be useful to set different expiration dates. It's easy to augment the lua script to do so.
Thanks. That sounds just like the tweak I need.
ReplyDelete