Qmail
[Top] [All Lists]

Re: Script to Purge Deleted Items

To: qmail@list.cr.yp.to
Subject: Re: Script to Purge Deleted Items
From: ml-qmail@epigenomics.com
Date: 13 Dec 2006 14:25:35 +0000
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-qmail@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list qmail@list.cr.yp.to
Mailing-list: contact qmail-help@list.cr.yp.to; run by ezmlm
Organization: Epigenomics AG
References: <20061213124557.42542.qmail@web30301.mail.mud.yahoo.com> <20061213134854.GC29959@discworld.dyndns.org>
User-agent: slrn/0.9.8.1 (Debian)
On 13 Dec 2006 07:48:54 -0600,
 "Charles Cazabon" <qmail@discworld.dyndns.org> wrote:
> Craig Stillman <stillmc@yahoo.com> wrote:
>> I am in need of a script which can recursively delete mail messages marked
>> for deletion via IMAP. Any ideas?
>
> Your question isn't clear.  If an IMAP client marks a message for deletion,
> surely the IMAP server software then deletes the message from the mailstore?

That's not quite correct. IMAP has two commands: delete marks a message
for deletion, purge removes all marked messages from a mail folder.

If you have your IMAP mail folders in Maildir format, a purge can be
done easily using find:

find /home/*/Maildir -name '*:2,*T*' -exec rm -fv {} \;

T is the Maildir flag for "marked for deletion", see also
http://cr.yp.to/proto/maildir.html

Greetings
-- 
Robert Sander                     Senior Manager Information Systems
Epigenomics AG    Kleine Praesidentenstr. 1    10178 Berlin, Germany
phone:+49-30-24345-0                            fax:+49-30-24345-555
http://www.epigenomics.com             robert.sander@epigenomics.com

<Prev in Thread] Current Thread [Next in Thread>