On Mon, 13 May 2002, Arnt Gulbrandsen wrote: >Andreas Aardal Hanssen <[EMAIL PROTECTED]> >> This is IMHO a little too quick a conclusion. Standard UNIX tools are very >> easy to use with Maildir/, especially considering that no parsing is >> required to seperate emails, and that all flags can be stored in the file >> name of a message, rather than in the content. >> To find messages that contain whatever in the subject: >> find . -type f | xargs grep -liE 'subject:.*?hei' >Including messages that contain body lines like the quoted, and except >ones like this: > Subject: > hei >This isn't idle pedantry. Messages are often wrapped if their subjects are >long, partially RFC 2047 encoded or both.
I know this. What's your point? That I'm lousy at throwing together examples, or that UNIX commands can't do the job? ;) >> 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? What's your point, anyway? Easily fixed with bash, perl, whatever. /Easier/ than the same operation on UNIX spools with the same tools. >Both commands are subject to race conditions. On a mail store with a few >gigabytes worth of mail, such commands take a long time, and what >guarantee do you have that noone sets a few flags meanwhile, changing your >file names under your feet? What guarantee do you have that file x still >refers to the same message? No guarantee.. but what's the worst case scenario? >I'm reminded of the Mencken quote: "For every complex problem there is an >answer that is clear, simple, and wrong." >> These operations are much much harder with the UNIX spool system. And >> better yet: they're consistent, with no locking required. >Write the same operations _correctly_ for both formats, then compare the >commplicity of the code. Ok, back to you: Try to think of the impact of the race conditions, and then _conclude_ with something. >I skipped the rest of your message. I showed a simple way to manipulate messages with UNIX tools. These work fine in most cases. If a message is delivered while this is happening, nothing wrong happens. If concurrent actions are taken on the same message, then ok, flags may be reset. Big deal. The worst scenario I can think of with regards to race conditions, is where content is changed or messages are deleted. For the wrong message to be deleted, all pids must cycle in less than one second, and the first message must get a new name in the mean time. Please, before commenting on stuff like this, try to think of what the effects are of the cases you so eagerly type down. I don't really get your point. Compare to UNIX spools, then make your point / conclusion. Andy >--Arnt -- Andreas Aardal Hanssen
