{"id":95,"date":"2011-01-09T19:22:00","date_gmt":"2011-01-09T19:22:00","guid":{"rendered":"https:\/\/www.root42.de\/blog\/?p=95"},"modified":"2011-01-09T19:22:00","modified_gmt":"2011-01-09T19:22:00","slug":"pimping-mobileme-1-expiration-dates-on-folders","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=95","title":{"rendered":"Pimping MobileMe #1: Expiration dates on folders"},"content":{"rendered":"<p>Well, <a href=\"http:\/\/me.com\/\">MobileMe<\/a> does not yet support the expiration of mails in folders. Especially for mailing lists, I want this feature. After let&#8217;s say 90 days the mails should be automatically deleted. I do not need to store mailing list contents for longer. So I took the nice tool <a href=\"http:\/\/imapfilter.hellug.gr\/\">imapfilter<\/a> and wrote a config file that expires old mails from a selection of folders. I installed a cronjob on my web server that now automatically calls imapfilter every night. The config file (~\/.imapfilter\/config.lua) looks like this:<\/p>\n<p><span style=\"font-family: 'Courier New', Courier, monospace;\">Myaccount = IMAP {<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; server = &#8216;mail.me.com&#8217;,<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; username = &#8216;your.name@me.com&#8217;,<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; password = &#8216;yourpassword&#8217;,<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; ssl = &#8216;tls1&#8217;<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">}<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\"><br \/><\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">folders = {&#8216;folder1&#8217;, &#8216;folder2&#8217;, &#8216;folder3&#8217;}<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\"><br \/><\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">for k,folder in pairs(folders) do<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; foldername = &#8216;Mailinglists\/&#8217; .. folder<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; results = myaccount[foldername]:is_older(90)<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">&nbsp;&nbsp; myaccount[foldername]:delete_messages(results)<\/span><br \/><span style=\"font-family: 'Courier New', Courier, monospace;\">end<\/span><\/p>\n<div><\/div>\n<div>My mailing lists are hosted under a sub-folder called &#8220;Mailinglists&#8221;, 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&#8217;s easy to augment the lua script to do so.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Well, MobileMe does not yet support the expiration of mails in folders. Especially for mailing lists, I want this feature. After let&#8217;s say 90 days the mails should be automatically deleted. I do not need to store mailing list contents for longer. So I took the nice tool imapfilter and wrote a config file that &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=95\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Pimping MobileMe #1: Expiration dates on folders&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,64,24],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/95"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=95"}],"version-history":[{"count":0,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/95\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}