{"id":1951,"date":"2009-06-08T03:10:25","date_gmt":"2009-06-08T07:10:25","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/?p=1951"},"modified":"2009-06-08T03:10:25","modified_gmt":"2009-06-08T07:10:25","slug":"an-arcane-question","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/06\/08\/an-arcane-question\/","title":{"rendered":"An Arcane Question"},"content":{"rendered":"<p>I couldn&#8217;t sleep, so I figured I&#8217;d work on purging some old e-mail from my Inbox.<\/p>\n<p>I wound up with something like 30,000 messages in my Trash folder on our Exchange server. When I went to empty the folder, Thunderbird seemed to want to <em>download<\/em> each message first. Argh!<\/p>\n<p>I decided to use Ruby&#8217;s Net::IMAP, but sending an expunge command to the trash does nothing. The folder still had 30,000 messages. I remembered some weirdness where things weren&#8217;t actually getting deleted off the server until I disconnected, so I gave that a try, too. I reconnected and they&#8217;re still there.<\/p>\n<p>Anyone have any thoughts? I don&#8217;t know where the problem lies. Is it an IMAP thing in general that you can&#8217;t &#8220;expunge&#8221; the trash folder, but must do something special (like iteratively delete each message)? An Exchange oddity? Or a limitation of Net::IMAP?<\/p>\n<p>Toying with Net::IMAP has got me thinking that IMAP is a pretty weird protocol, by the way. Who knew that searching was done server-side, for example? I suppose it kind of makes sense (saves bandwidth from keeping the client from having to get each message), but it also seems like a single person with a big inbox could search and bring the whole server to its knees. Shows why your mailservers need to be beefy machines, I guess. A lot of the simple tasks you perform in a mail client are more complicated than I&#8217;d have thought, too. You don&#8217;t delete mail, for example. You modify the message and set a &#8220;DELETED&#8221; attribute. And then you expunge the mailbox.<\/p>\n<p>Some time when it&#8217;s not 3am, I think I want to brush up the Net::IMAP code fragments I have and whip up something that will walk through some of the folders I have and delete anything older than 14 days. A horrible idea on some folders, but on automated status e-mails and error e-mails, it&#8217;s more than generous. I probably have something like 500-1000 e-mails sent to me by scripts that need regular deletion. I was surprised to find that there&#8217;s no Thunderbird extension for this, but I think I may prefer to have it be a cron job that runs overnight, since mail clients can lag out when tens of thousands of messages disappear from folders.<\/p>","protected":false},"excerpt":{"rendered":"<p>I couldn&#8217;t sleep, so I figured I&#8217;d work on purging some old e-mail from my Inbox. I wound up with something like 30,000 messages in my Trash folder on our Exchange server. When I went to empty the folder, Thunderbird &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/06\/08\/an-arcane-question\/\">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-1951","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/1951","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=1951"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/1951\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=1951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=1951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=1951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}