Andreas Aardal Hanssen <[EMAIL PROTECTED]>
> I know this. What's your point? That I'm lousy at throwing together
> examples, or that UNIX commands can't do the job? ;)

That if you want reliability and correctness, it's not a lot simpler than
using the classic berkeley format.

It may be a little simpler. I don't know.

> >> To delete all messages from Ole:
> >>   find . -type f | xargs grep -liE 'return-path:.*?<ole>' | xargs rm -v
> >That command deletes 1) your message to the list 2) this reply and 3) some
> >other messages, but not messages from ole@localhost or from [EMAIL PROTECTED]
> 
> I know this too. Is it very hard, though, to solve the problem?

About as hard as solving it for berkely mbox, I'd guesstimate. In both
cases you need a proper rfc822/2047 parser, which rather dominates the
complexity.

<about races>
> No guarantee.. but what's the worst case scenario?

1. Returning "success" when in fact the command did not succeed. If the
   file name's used to store flags, and those flags are set, this can
   happen.

2. Deleting the wrong mail. If someone deletes one of the same message as
   you want to delete, and some tempnam()-like code then chances on the
   same name, this can happen.

> Ok, back to you: Try to think of the impact of the race conditions, and 
> then _conclude_ with something.

Your simplicity is very simple, but it's not reliable.

You use grep as an example. Well, using grep for searching doesn't handle
quoted-printable or base64 encoding, doesn't handle character sets
correctly (think utf-8 vs. iso-8859-1), doesn't handle rfc822 header
wrapping or do header/body differentiation, doesn't handle rfc2047 header
encoding or 822-style quoting. There may be more - those are just the
problems I remember from using grep on MH mailboxes.

Now, if you don't care about reliability, that's fine for you. But this is
the IMAP mailing list. An IMAP server may not "mostly" delete the right
messages. It may not return "most" of the search results. If you want to
argue that maildir is a superior mailbox format, "grep mostly works" won't
do.

--Arnt

Reply via email to