[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automating IMAP email maintenance



-- Andy Saxena <andyML@nyc.rr.com> wrote
(on Friday, 11 October 2002, 05:30 AM -0400):
> On Wed, Oct 09, 2002 at 09:34:13AM -0500, Keith G. Murphy wrote:
> > Andy Saxena wrote:
> > >I use Cyrus as my IMAP server. When I transfer email from my ISP to
> > >Cyrus I use a procmail recipe. Before any of the procmail rules are
> > >applies I backup all email into a backup folder. I would like to be able
> > >to run a cron job to automatically delete messages from this backup
> > >folder. 
> > >
> > >Any pointers on how I could do this? Google did not reveal too
> > >much information of interest. I'd be happy to read the documention if
> > >somebody could point me the right direction.
> > >
> > One way to do it would be to use the libmail-imapclient-perl package to 
> > write a program that does it.
> > 
> > The documentation may be a little sparse.  You could end up learning 
> > Perl *and* reading an RFC!  :-)
> 
> There's always the hard way to solving any problem :-}. Anyway, I know
> that it's common for people to run cron jobs on their mbox files to
> archive email. I am just surprised that no such tool seems to exist for
> IMAP.

If I remember correctly, Cyrus uses the Maildir format. If you want to
do backups, try archivemail ('apt-get install archivemail') -- I use it
to back up my folders that have mailing lists (including this one!) each
night on a cronjob. (Prevents the message count from getting so large I
can't load the folder in a reasonable amount of time!)

The other point being... If your mailboxes *are* in Maildir format,
your mail messages are in single files, and thus you should be able to
create a script easily enough to perform the deletions you desire
*without* needing to use Mail::IMAPClient (trust me, it's a beast!).

-- 
Matthew Weier O'Phinney
matthew@weierophinney.net



Reply to: