procmail
[Top] [All Lists]

Re: Sorting mail...

2000-06-29 22:46:14
This is off-topic for the procmail list.

On Thu, 29 Jun 2000, Jason Quigley wrote:

What I need to do is run a sort on these messages on the server side during 
the night. Has anybody done anything like this?

Whether you're able to do this depends entirely on which IMAP server is
involved, and whether you have direct access to the messages.  Changing
the physical storage order of messages is not supported by IMAP; the
unique identifier number associated with each message is defined to be
part of a never-decreasing sequence that corresponds to the temporal order
in which the messages were added to the mailboxes -- e.g., the message
with UID 12 can never appear "before" any of the messages with UIDs 1-11.

If you physically reorder the messages "behind the server's back" the best
that will happen is that the server will have to reassign all the UIDs;
the worst is that it'll break entirely.

The only correct way to do this within the IMAP protocol is to copy the
messages one by one in the desired order into a new mailbox, then delete
the old mailbox and rename the new one.  I say "one by one" because if you
supply a range of numbers to the COPY command, the IMAP server is allowed
to decide the order in which it copies them, which defeats your purpose.

There are some utility programs available from ftp.washington.edu that
will help you construct shell scripts to automate the procedure, so that
you can run it overnight or whatever.  Look for imaputils.tar.Z.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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