{"id":1715,"date":"2009-03-30T20:28:19","date_gmt":"2009-03-31T00:28:19","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/?p=1715"},"modified":"2009-03-30T20:28:19","modified_gmt":"2009-03-31T00:28:19","slug":"email-holding-tanks","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/03\/30\/email-holding-tanks\/","title":{"rendered":"E-mail Holding Tanks"},"content":{"rendered":"<p>I suspect my situation really isn&#8217;t that different from a lot of people. I get a <em>lot<\/em> of e-mail every day. Easily 250 messages on a good day, and well over 1,000 on a bad day. I get a copy of every error that occurs on our site, an e-mail for every cron job that runs anywhere, and a whole lot of other junk. I have Exchange set up to filter my mail before it lands in my Inbox, which helps keep me sane.<\/p>\n<p>Some mail I want to keep forever. I consult my &#8220;Sent Items&#8221; folder often enough that I don&#8217;t intend to ever purge it. Same goes for my &#8220;Archival &#8211; Keep&#8221; folder. But I also have a lot of folders on the mailserver that are basically holding tanks. Periodically I go through and clean out the accumulated crap. I realize I don&#8217;t need copies of errors that occured in January, or cron jobs from December, and go crazy deleting things.<\/p>\n<p>There are a few problems with that. The biggest, really, is that it&#8217;s a waste of my time. But I&#8217;m sitting here blogging about it, so I can&#8217;t complain about that. \ud83d\ude09<\/p>\n<p>The other one is that Exchange (and probably any other mailserver) really, really hates it when you highlight 10,000 messages and hit delete. And by &#8220;Exchange really, really hates it,&#8221; I mean you start hearing everyone in the office asking each other, &#8220;Is e-mail down for you, too?&#8221; So I learned my lesson and wrote nice-delete.pl, a simple little Perl script using Net::IMAP to grab a list of all mail in a folder and iterate over the messages, deleting 50, expunging the mailbox, and then sleeping for 3 seconds. That keeps the load down.<\/p>\n<p>I&#8217;ve thought about extending it to run weekly via cron, download each message, and check the headers to see if it&#8217;s older than, say, 21 days, and just trash it if so. But then I realized: I use Thunderbird, which has an ungodly amount of plugins. Surely, someone has written this before!<\/p>\n<p>Unless my Google-fu is failing me, though, no one has. Is it really that uncommon of a request to want to auto-purge certain folders after a while? And, more importantly, what does it take to write a Thunderbird extension?<\/p>","protected":false},"excerpt":{"rendered":"<p>I suspect my situation really isn&#8217;t that different from a lot of people. I get a lot of e-mail every day. Easily 250 messages on a good day, and well over 1,000 on a bad day. I get a copy &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/03\/30\/email-holding-tanks\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/1715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=1715"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/1715\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}