Are there any good maildir manipulation utilities out there?
Chris Green
cl at isbd.net
Thu Apr 8 16:49:54 UTC 2021
On Thu, Apr 08, 2021 at 09:55:52AM -0400, Dan Ritter wrote:
> Chris Green wrote:
> > On Thu, Apr 08, 2021 at 08:43:48AM +1000, Cameron Simpson wrote:
> > > On 07Apr2021 18:34, Kurt Hackenberg <kh at panix.com> wrote:
> > > >On 2021/04/07 18:16, Kurt Hackenberg wrote:
> > > >>On 2021/04/07 17:01, Chris Green wrote:
> > > >>>I'm looking for a tool which will allow me to search through a large
> > > >>>hierarchy of maildir messages and then provide actions to take on the
> > > >>>matched messages.
>
> ...
>
>
> > Yes, that was just one typical requirement. The other major
> > requirement is rather different. I have (for example) lots of
> > messages about orders from Screwfix which are currently spread around
> > in various sub-directories of 'shopping'. For suppliers like Screwfix
> > from whom I buy a lot of rather mixed up sort of items it now makes
> > sense to me to keep them all in a Screwfix directory. So the
> > requirement is to find all messages from Screwfix and put them in one
> > directory.
> >
> >
> > > I suspect Chris may need to roll his own. I'd imagine something like:
> > >
> > > find message paths using mairix \
> > > | move message files sideways, making sure there's no conflicts
> > >
> > Yes, I think it may have to be a roll my own something like this.
> > It's just that mairix doesn't provide a very good 'handle' to use.
>
> Have you added a mairix search => maildir integration in your
> muttrc?
>
> The Screwfix case would be:
>
> macro index <F8> "<enter-command>set my_cmd = \`/usr/local/bin/mairixsearch\`<return><enter-command>push
> \$my_cmd<return>" "search messages"
>
> macro index <F9> "<change-folder-readonly>~/results<enter><limit>.<enter>"
> "display search results"
>
> F8 f screwfix
> F9
> # tag or untag or whatever until you've got the right ones
> ;s =screwfix
>
> Would that work for you?
>
Yes, on digging a bit further into this using mairix isn't too
difficult:-
Search with mairix producing a maildir full of symbolic links to
the hits.
Move the *target* of the symbolic links to the new directory as
required.
Delete the target of the symbolic links.
Job done! Since there are already readlink and/or readpath commands
for finding the target of a symbolic link this is rather easy.
--
Chris Green
More information about the Mutt-users
mailing list