Hi Sanjoy, On Tue, Mar 01, 2005 at 02:19:21AM -0500, Sanjoy Mahajan wrote: > > Here is a small improvement, submitted because by doing something like > this: > > mairix -o inbox f:aims d:2w- > > I carelessly trashed my inbox, which had all my emails for the last 10 > years. I was trying to get the search to return only msgs in the > inbox, and of course '-o' is not what I wanted!
p:inbox is what you need. > I had backups so no worries, but meanwhile here is a patch so that > mairix will refuse to do what I mistakenly asked it to. > > Here is the patch, which also patches the .texi documentation. I > didn't patch the man page since it doesn't describe the '-o' option. The manpage is basically unmaintained. I find manpage syntax too revolting to touch, so I rely on contributions to keep it maintained. > I'm not sure the patch is 100% right. Probably it doesn't catch all > cases where the user might harm themselves; for example, what if the > the mfolder is specified as ../Mail/inbox, then mairix won't know that > the search output will trash inbox (assuming that Mail as the base > directory). But it's a start. It also doesn't catch the case where the mfolder is equal to something matched by a ... expression underneath something else. This should be possible to catch also. But I agree the ../Mail/inbox type of situation is hard to catch. However, I think that counts as deliberate stupidity, whereas you're aiming to safeguard the user against the obvious mistake. So I think we probably need to address 2 omissions: 1. if the start of the mfolder path matches on anything that has ... after it in the folder list 2. MH and mbox folders. If you're inclined to look at those it would be very helpful :-), but I can probably fix these myself otherwise. (That is, after I've finished on adding the capability to omit particular folders from wildcard and ... matches when indexing.) Cheers Richard -- Richard P. Curnow | Free software developer Weston-super-Mare | United Kingdom | http://www.rc0.org.uk/
pgpEb4oe68Q8u.pgp
Description: PGP signature

