Greetings -

--On 1 June 2006 09:02:15 -0400 Anne Ramey wrote:
There are probably other utilities to do this task but the one that springs
to my mind is "mailutil" from the University of Washington (UW) IMAP
Utilities distribution.

mailutil was originally designed to create mail folders in particular
storage formats, either locally or on a remote IMAP server.

However feeping creaturism added other facilities such as copying or moving
messages between any combination of local and/or remote folders.

Amongst these is the "prune" option which lets you prune a mail folder
based on a selection string. The selection string itself is given in the
format used by IMAP2's SEARCH command (RFC 117). [I actually suspect it
now supports IMAP4rev1's SEARCH command syntax (RFC 2060, section 6.4.4)
... if this is indeed different.]

The example given in mailutil's man page is:

mailutil prune INBOX "before 1-jan-2004"

Because mailutil is built using the UW C-Client library it understands a
great many different mail folder storage formats, and can certainly be used
on traditional UNIX/Berkeley/mbox formatted folders.

You can see the man page for mailutil (and the other IMAP utilities) at


Source code, and pre-built binaries for a number of platforms, for
C-Client, Pine, the IMAP server and IMAP utilities can be found at:


mailutil is in its imap/src/mail/utils directory.

Alternatively you can just get the IMAP server + C-Client source code at:


If I'm right in thinking this deletes messages from mail folders then you
might find it a very useful tool: its selection criteria are very flexible,
enabling you to select messages by date, sender, recipient, size,
read/unread status, etc

I have used mailutil to create mail folders and copy messages around,
but haven't yet tried its "prune" option. However I'm expecting it
will work.

If someone tries it perhaps they could report back to the list?

Mike B-)

The Computing Service, University of York, Heslington, York Yo10 5DD, UK
Tel:+44-1904-433811 FAX:+44-1904-433740

* Unsolicited commercial e-mail is NOT welcome at this e-mail address. *

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupmailman-users @
postedJun 1, '06 at 1:02p
activeJun 1, '06 at 3:34p

2 users in discussion

Mike Brudenell: 1 post Anne Ramey: 1 post



site design / logo © 2022 Grokbase