<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] Following symlinks when deleting mail



Tamotsu Takahashi wrote:
On Wed, Mar 02, 2005 at 09:14:13AM +0100, Bardur Arantsson wrote:

I've created a patch which adds an option

     unlink_follow (bool, default=false)

to mutt. If set, the option makes the MH/Maildir code follow symlinks
when unlinking a message. This can be very handy in combination with e.g. mairix to allow deletion of messages through complex searches on multiple mailboxes (or, most usefully *subsets* of complex searches, tagged using the mutt index of the search folder).

The patch should apply cleanly to 1.5.8 (and CVS). Comments and suggestions welcome.


It sounds useful, but I'm afraid it will result in a number
of feature requests:
        "Why not make it a quad-option?"

Delete is delete. This works at a level below that, so if mutt is asked to confirm each deletion that will still happen. Having if ask whether to follow each symlink is, IMHO, rather silly.

        "I want to delete only realpath messages, leaving
        links untouched."

I'm not sure that makes sense. The symlinks'd be pretty worthless in that case. :)

        "Similar options for <copy> and <save> functions?"

Actually, I like that idea quite a lot... They do make sense if one thinks of this patch as a sort of "poor man's virtual folders" type thing... (perhaps just combine them all into one 'poor_mans_virtual_folders' option?). It should just be a question of inserting a symlink resolution function call in appropriate places for MH/Maildir mailboxes.

In fact I the idea so much that I'll add this. :)

        "What about directories?"

Not sure I follow...?

(No, I don't request such features, at least for now. They
are only a possibility.)

All the requests above can be solved with my flexible
pass-to-command patch
(http://marc.theaimsgroup.com/?l=mutt-dev&m=110947815600780&w=2
'Re: wish: file/directory funtions for maildir etc').

For example, you can delete the realpaths of tagged links with:
        :bind index '!' pass-to-command
        ;!for i in "%s"; do rm -f `realpath $i`; done


Yes, I suppose that neatly solves the 'delete' part of the problem, but to do "copy" and "save" you'd have to know the destination mailbox type, its locking type and its path...?!? Ugh... By adding this to the patch mutt will automagically know what locking is required, can expand the full mailbox path, etc.

Cheers,

--
Bardur Arantsson
<bardur@xxxxxxxxxxxx>
<bardur@xxxxxxxxxxxxxxx>

Peace through superior firepower.