<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Cleanup Maildir folders (archive/delete old mails)</title> <atom:link href="http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/feed/" rel="self" type="application/rss+xml" /><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/</link> <description>The Journal Of A Linux Sysadmin</description> <lastBuildDate>Wed, 08 Feb 2012 13:08:17 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3</generator> <item><title>By: Topper</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-193601</link> <dc:creator>Topper</dc:creator> <pubDate>Sun, 09 Oct 2011 19:14:16 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-193601</guid> <description>What can be a problem here:# /usr/bin/cleanup-maildir -n -vv --age=90 --archive-folder=Archive --maildir-root=/backupimap/user/joro delete &#039;&#039;
DEBUG:cleanup-maildir:Mode is delete
DEBUG:cleanup-maildir:Cleaning up ...
Traceback (most recent call last):
File &quot;/usr/bin/cleanup-maildir&quot;, line 528, in ?
cleaner.clean(mode, dir, minAge)
File &quot;/usr/bin/cleanup-maildir&quot;, line 380, in clean
maildir = mailbox.Maildir(path, MaildirMessage)
File &quot;/usr/local/lib/python2.4/mailbox.py&quot;, line 225, in __init__
boxes = [os.path.join(newdir, f)
OSError: [Errno 2] No such file or directory: &#039;/backupimap/user/joro/./new&#039;Python version 2.4.4</description> <content:encoded><![CDATA[<p>What can be a problem here:</p><p># /usr/bin/cleanup-maildir -n -vv &#8211;age=90 &#8211;archive-folder=Archive &#8211;maildir-root=/backupimap/user/joro delete &#8221;<br
/> DEBUG:cleanup-maildir:Mode is delete<br
/> DEBUG:cleanup-maildir:Cleaning up &#8230;<br
/> Traceback (most recent call last):<br
/> File &#8220;/usr/bin/cleanup-maildir&#8221;, line 528, in ?<br
/> cleaner.clean(mode, dir, minAge)<br
/> File &#8220;/usr/bin/cleanup-maildir&#8221;, line 380, in clean<br
/> maildir = mailbox.Maildir(path, MaildirMessage)<br
/> File &#8220;/usr/local/lib/python2.4/mailbox.py&#8221;, line 225, in __init__<br
/> boxes = [os.path.join(newdir, f)<br
/> OSError: [Errno 2] No such file or directory: &#8216;/backupimap/user/joro/./new&#8217;</p><p>Python version 2.4.4</p> ]]></content:encoded> </item> <item><title>By: Benjamin</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-193447</link> <dc:creator>Benjamin</dc:creator> <pubDate>Fri, 09 Sep 2011 13:15:57 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-193447</guid> <description>Tried with Age 1460 (4 Years), doesn&#039;t work. The script doesn&#039;t also not work with Age=300.... any solutions?</description> <content:encoded><![CDATA[<p>Tried with Age 1460 (4 Years), doesn&#8217;t work. The script doesn&#8217;t also not work with Age=300&#8230;. any solutions?</p> ]]></content:encoded> </item> <item><title>By: Damian</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-193264</link> <dc:creator>Damian</dc:creator> <pubDate>Wed, 03 Aug 2011 10:46:25 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-193264</guid> <description>Traceback (most recent call last):
File &quot;./cleanup-maildir&quot;, line 528, in
cleaner.clean(mode, dir, minAge)
File &quot;./cleanup-maildir&quot;, line 419, in clean
(fakeMsg, i, subFolder), msg)
File &quot;./cleanup-maildir&quot;, line 434, in log
subj = msgObj.getSubject()
File &quot;./cleanup-maildir&quot;, line 237, in getSubject
email.Header.decode_header(s)))
File &quot;/usr/local/lib/python2.5/email/header.py&quot;, line 93, in decode_header
dec = email.quoprimime.header_decode(encoded)
File &quot;/usr/local/lib/python2.5/email/quoprimime.py&quot;, line 336, in header_decode
return re.sub(r&#039;=\w{2}&#039;, _unquote_match, s)
File &quot;/usr/local/lib/python2.5/re.py&quot;, line 150, in sub
return _compile(pattern, 0).sub(repl, string, count)
File &quot;/usr/local/lib/python2.5/email/quoprimime.py&quot;, line 324, in _unquote_match
return unquote(s)
File &quot;/usr/local/lib/python2.5/email/quoprimime.py&quot;, line 106, in unquote
return chr(int(s[1:3], 16))
ValueError: invalid literal for int() with base 16: &#039;za&#039;Any help?</description> <content:encoded><![CDATA[<p>Traceback (most recent call last):<br
/> File &#8220;./cleanup-maildir&#8221;, line 528, in<br
/> cleaner.clean(mode, dir, minAge)<br
/> File &#8220;./cleanup-maildir&#8221;, line 419, in clean<br
/> (fakeMsg, i, subFolder), msg)<br
/> File &#8220;./cleanup-maildir&#8221;, line 434, in log<br
/> subj = msgObj.getSubject()<br
/> File &#8220;./cleanup-maildir&#8221;, line 237, in getSubject<br
/> email.Header.decode_header(s)))<br
/> File &#8220;/usr/local/lib/python2.5/email/header.py&#8221;, line 93, in decode_header<br
/> dec = email.quoprimime.header_decode(encoded)<br
/> File &#8220;/usr/local/lib/python2.5/email/quoprimime.py&#8221;, line 336, in header_decode<br
/> return re.sub(r&#8217;=\w{2}&#8217;, _unquote_match, s)<br
/> File &#8220;/usr/local/lib/python2.5/re.py&#8221;, line 150, in sub<br
/> return _compile(pattern, 0).sub(repl, string, count)<br
/> File &#8220;/usr/local/lib/python2.5/email/quoprimime.py&#8221;, line 324, in _unquote_match<br
/> return unquote(s)<br
/> File &#8220;/usr/local/lib/python2.5/email/quoprimime.py&#8221;, line 106, in unquote<br
/> return chr(int(s[1:3], 16))<br
/> ValueError: invalid literal for int() with base 16: &#8216;za&#8217;</p><p>Any help?</p> ]]></content:encoded> </item> <item><title>By: Mark G</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-192677</link> <dc:creator>Mark G</dc:creator> <pubDate>Sat, 02 Apr 2011 10:02:16 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-192677</guid> <description>@Albin ThulinThanks, your modified version worked a little better.   Get many of these errors thou:UnicodeDecodeError: &#039;ascii&#039; codec can&#039;t decode byte 0xc2 in position 111: ordinal not in range(128)</description> <content:encoded><![CDATA[<p>@Albin Thulin</p><p>Thanks, your modified version worked a little better.   Get many of these errors thou:</p><p>UnicodeDecodeError: &#8216;ascii&#8217; codec can&#8217;t decode byte 0xc2 in position 111: ordinal not in range(128)</p> ]]></content:encoded> </item> <item><title>By: Zoltan Papp</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-183133</link> <dc:creator>Zoltan Papp</dc:creator> <pubDate>Sun, 26 Sep 2010 22:47:33 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-183133</guid> <description>Hello,i am a little new to linux scripting and I am trying to make a cron.job that runs for all users on all domains each night and deletes messages older than 365 days. I am stuck with this script that looks like this:exec&lt;/var/vmail/$i/$k/Maildir/subscriptions
while read line; do
var=&quot;&#039;&quot;$line&quot;&#039;&quot;
./cleanup-maildir --maildir-root=&#039;/var/vmail/&#039;$i&#039;/&#039;$k&#039;/Maildir/&#039; --age=365 delete $var
doneCan you help me out, what am I doing wrong?Thank you!</description> <content:encoded><![CDATA[<p>Hello,</p><p>i am a little new to linux scripting and I am trying to make a cron.job that runs for all users on all domains each night and deletes messages older than 365 days. I am stuck with this script that looks like this:</p><p>exec&lt;/var/vmail/$i/$k/Maildir/subscriptions<br
/> while read line; do<br
/> var=&quot;&#039;&quot;$line&quot;&#039;&quot;<br
/> ./cleanup-maildir &#8211;maildir-root=&#039;/var/vmail/&#039;$i&#039;/&#039;$k&#039;/Maildir/&#039; &#8211;age=365 delete $var<br
/> done</p><p>Can you help me out, what am I doing wrong?</p><p>Thank you!</p> ]]></content:encoded> </item> <item><title>By: Dimitrios Karapiperis</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-182310</link> <dc:creator>Dimitrios Karapiperis</dc:creator> <pubDate>Thu, 19 Aug 2010 12:25:11 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-182310</guid> <description>might be useful to archive recursively all the folders and their content under the specified maildir folder...why not?</description> <content:encoded><![CDATA[<p>might be useful to archive recursively all the folders and their content under the specified maildir folder&#8230;why not?</p> ]]></content:encoded> </item> <item><title>By: Lewis</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-181885</link> <dc:creator>Lewis</dc:creator> <pubDate>Sun, 06 Jun 2010 23:53:55 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-181885</guid> <description>oops, minor typo. should be find $i-*/cur/ on the second to last line</description> <content:encoded><![CDATA[<p>oops, minor typo. should be find $i-*/cur/ on the second to last line</p> ]]></content:encoded> </item> <item><title>By: Lewis</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-181884</link> <dc:creator>Lewis</dc:creator> <pubDate>Sun, 06 Jun 2010 23:29:43 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-181884</guid> <description>#!/bin/bash# Archive monthly folders in the pattern YYYY-MM to the YYYY Maidlir after they are 31 days old.MDIR=&quot;$HOME/Maildir&quot;
YEAR=`/usr/local/bin/gnudate -d &quot;last month&quot; &#039;+%Y&#039;`for i in `find $MDIR -maxdepth 1 -name &quot;.*$YEAR&quot; &#124; grep -v Archive`; do
find $i-* -type f -ctime +31 -exec mv {} $i/cur/ \;
done</description> <content:encoded><![CDATA[<p>#!/bin/bash</p><p># Archive monthly folders in the pattern YYYY-MM to the YYYY Maidlir after they are 31 days old.</p><p>MDIR=&#8221;$HOME/Maildir&#8221;<br
/> YEAR=`/usr/local/bin/gnudate -d &#8220;last month&#8221; &#8216;+%Y&#8217;`</p><p>for i in `find $MDIR -maxdepth 1 -name &#8220;.*$YEAR&#8221; | grep -v Archive`; do<br
/> find $i-* -type f -ctime +31 -exec mv {} $i/cur/ \;<br
/> done</p> ]]></content:encoded> </item> <item><title>By: Alexander</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-181616</link> <dc:creator>Alexander</dc:creator> <pubDate>Mon, 22 Feb 2010 10:53:57 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-181616</guid> <description>I am looking for a tool to remove attachments from mail in a maildir and put them in a different location. Does anyone know of such a script?</description> <content:encoded><![CDATA[<p>I am looking for a tool to remove attachments from mail in a maildir and put them in a different location. Does anyone know of such a script?</p> ]]></content:encoded> </item> <item><title>By: claudio</title><link>http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archive-delete-old-mails/comment-page-2/#comment-181463</link> <dc:creator>claudio</dc:creator> <pubDate>Sat, 26 Dec 2009 13:28:28 +0000</pubDate> <guid
isPermaLink="false">http://www.ducea.com/2006/11/25/cleanup-maildir-folders-archivedelete-old-mails/#comment-181463</guid> <description>I think this is the best solution here:
4 Jay Farschman
4th October 2007, 14:43
I’s use the find command to locate the (ctime) files over 7 days old and the pipe it through xargs rm… like thisfind /tmp/jo -type f -ctime +7 &#124; xargs rmTo test, replace the rm with ls -la so you can see the files and ages.with this insight is easy to script the whole thingthanks pal
Claudio</description> <content:encoded><![CDATA[<p>I think this is the best solution here:<br
/> 4 Jay Farschman<br
/> 4th October 2007, 14:43<br
/> I’s use the find command to locate the (ctime) files over 7 days old and the pipe it through xargs rm… like this</p><p>find /tmp/jo -type f -ctime +7 | xargs rm</p><p>To test, replace the rm with ls -la so you can see the files and ages.</p><p>with this insight is easy to script the whole thing</p><p>thanks pal<br
/> Claudio</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Served from: www.ducea.com @ 2012-02-08 19:28:49 by W3 Total Cache -->
