Re: cyrus-imapd-2.2.12-10 -- impurge and -f recursion --
On Fri, Jan 15, James B. Byrne wrote: > I run cyrus-imapd under CentOS-4.8 (a RedHat el4 clone). I am > trying to discover if there is any way to purge a user's INBOX of > old and over-sized messages without affecting the contents of any > subfolders thereof. > > I have looked at impurge as the mechanism. However,my reading of the > man page, and of online discussions relating to this matter, > indicate that in order for impurge to remove any mail from the INBOX > then the -f switch has to be passed. But, I also gather that > whenever the -f switch is used then ALL subfolders of the target > directory are purged recursively as well. > > This strikes me as a rather odd combination of attributes but I > cannot see any way to prevent recursion if the -f switch is used. > What is the recommended way to purge mail from a user's INBOX only > using criteria such as age and size? You are not the only one searching for a better control of what ipurge should delete. I created a feature request for that and submitted a patch to the cmu bugzilla: https://bugzilla.andrew.cmu.edu/show_bug.cgi?id=3167 This is the link to the patch including documentation in the manpage: https://bugzilla.andrew.cmu.edu/attachment.cgi?id=1232 -- With best regards, Carsten Hoeger pgp1vwdw9zf5k.pgp Description: PGP signature Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
Re: cyrus-imapd-2.2.12-10 -- impurge and -f recursion --
On Fri, 2010-01-15 at 08:39 -0500, James B. Byrne wrote: > I run cyrus-imapd under CentOS-4.8 (a RedHat el4 clone). I am > trying to discover if there is any way to purge a user's INBOX of > old and over-sized messages without affecting the contents of any > subfolders thereof. > > I have looked at impurge as the mechanism. However,my reading of the > man page, and of online discussions relating to this matter, > indicate that in order for impurge to remove any mail from the INBOX > then the -f switch has to be passed. But, I also gather that > whenever the -f switch is used then ALL subfolders of the target > directory are purged recursively as well. > > This strikes me as a rather odd combination of attributes but I > cannot see any way to prevent recursion if the -f switch is used. > What is the recommended way to purge mail from a user's INBOX only > using criteria such as age and size? > > Sincerely, > I think you mean ipurge (not impurge) Even I had exactly the same issue .. I modified ipurge.c a bit so that it will expect a "-r" switch to recurse through subfolders along with "-f" else "-f" works only on the inbox I have a workaroud patch to ipurge.c I can share .. but *absolutely no guarantee* that it will work for you --- ipurge.c.default 2006-01-21 18:50:26.0 +0530 +++ ipurge.c 2006-01-21 18:50:34.0 +0530 @@ -85,6 +85,8 @@ int skipflagged = 0; int datemode = OFFSET_SENTDATE; int invertmatch = 0; +short int recurse =0; +short int done=0; /* for statistical purposes */ typedef struct mbox_stats_s { @@ -159,6 +161,9 @@ case 'i' : { invertmatch = 1; } break; + case 'r' : { + recurse = 1; + } break; case 'h': default: usage(argv[0]); } @@ -234,6 +239,10 @@ if (!strncasecmp(name,"INBOX",5) || mboxname_isusermailbox(name, 0)) return 0; } +if(!recurse){ + if(done) return(0); + done=1; + } + Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
cyrus-imapd-2.2.12-10 -- impurge and -f recursion --
I run cyrus-imapd under CentOS-4.8 (a RedHat el4 clone). I am trying to discover if there is any way to purge a user's INBOX of old and over-sized messages without affecting the contents of any subfolders thereof. I have looked at impurge as the mechanism. However,my reading of the man page, and of online discussions relating to this matter, indicate that in order for impurge to remove any mail from the INBOX then the -f switch has to be passed. But, I also gather that whenever the -f switch is used then ALL subfolders of the target directory are purged recursively as well. This strikes me as a rather odd combination of attributes but I cannot see any way to prevent recursion if the -f switch is used. What is the recommended way to purge mail from a user's INBOX only using criteria such as age and size? Sincerely, -- *** E-Mail is NOT a SECURE channel *** James B. Byrnemailto:byrn...@harte-lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 Cyrus Home Page: http://cyrusimap.web.cmu.edu/ Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html