Sandy,
         If you don't mind, could you walk through the script to explain what each 
line does.  I understand it until the .new section.  I appreciate you posting the 
script, we are looking for the exact same thing for our customers.  Thank you for your 
time and effort.
 
Keith

        -----Original Message----- 
        From: Sanford Whiteman [mailto:[EMAIL PROTECTED]] 
        Sent: Wed 1/15/2003 9:33 AM 
        To: [EMAIL PROTECTED] 
        Cc: 
        Subject: Re[2]: [IMail Forum] Remove mail after X # of days
        
        

        > So what I am trying to do is to "clean" out the junkmail folders for
        > all  the users to only keep the past 7 days in there (maybe less) So
        > I  need  to remove messages by date out of the junkmail.mbx files...
        
        Two batch files, ITERATE.BAT and EXPIRE.BAT:
        
        ITERATE.BAT
        -----------
        
        c:
        CD c:\imail
        FOR /F %%I IN ('DIR /S /B junkmail.mbx') DO CALL expire.bat %%I
        
        -----------
        
        EXPIRE.BAT
        ----------
        
        FOR /F %%J IN ('echo %1') DO MOVE /Y %%~dpnJ.uid c:\imail\exptemp
        FOR /F %%J IN ('echo %1') DO MOVE /Y %%~dpnJ.mbx c:\imail\exptemp
        IMMSGEXP -tc:\imail\exptemp -d7
        IF EXIST %1 REN %1 %1.new
        FOR /F %%K IN ('echo %1') DO MOVE /Y c:\imail\exptemp\*.* %%~dpK
        IF EXIST %1.new COPY /Y /B %1+%1.new %1
        IF EXIST %1.new DEL %1.new
        
        ----------
        
        Adjust  for  and  T-E-S-T in your environment. Let me know if you have
        any  questions.  Though  the  files  account  for most of the possible
        overlap  between  the batch process and delivery to the active mailbox
        (through  the  concatenation  of  .mbx and .new), you might prefer the
        still  safer  method  of  running  the batch with SendName temporarily
        renamed  to  a dummy, then starting some queue runs directly after, if
        you can spare the pause in overall delivery.
        
        -Sandy
        
        
        To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
        List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
        Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
        
        

<<winmail.dat>>

Reply via email to