cyrus-imapd-2.2.12-10 -- impurge and -f recursion --

ram ram at netcore.co.in
Mon Jan 18 04:28:15 EST 2010


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.000000000 +0530 
+++ ipurge.c 2006-01-21 18:50:34.000000000 +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; 
+ }
+



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20100118/3df2c460/attachment.html 


More information about the Info-cyrus mailing list