On Tuesday Jan 07 2025, Henrik Frisk wrote:
> Hi everyone,
>
> Is there a way to mark, say all messages from 2023, as read and move them
> into a separate folder? Something like the original question posed in this
> thread:
>
> https://groups.google.com/g/mu-discuss/c/bgQmCy7m9uc/m/YzB2A-eZBAAJ
>
> I guess marking as read is not absolutely necessary
I suppose the easiest may be to do it as a shell-command, using a
combination of 'mu find' and 'mu move'.
On Wednesday Jan 08 2025, Henrik Frisk wrote:
> Den ons 8 jan. 2025 kl 08:02 skrev Dirk-Jan C. Binnema <dj...@djcbsoftware.nl
>>:
>
>> On Tuesday Jan 07 2025, Henrik Frisk wrote:
>>
>> > Hi everyone,
>> >
>> > Is there a way to mark, say all messages from 2023, as read and move them
>> > into a separate folder? Something like the original question posed in
>> this
>> > thread:
>> >
>> > https://groups.google.com/g/mu-discuss/c/bgQmCy7m9uc/m/YzB2A-eZBAAJ
>> >
>> > I guess marking as read is not absolutely necessary
>>
>> I suppose the easiest may be to do it as a shell-command, using a
>> combination of 'mu find' and 'mu move'.
>
>
> Right, that makes sense. Is it possible o change the mark of a message with
> mu?
You can change the flags for a message (such as the read flag) with the
--flags parameter to 'mu move'. See the man-page.
On Thursday Jan 09 2025, Henrik Frisk wrote:
Ah, good. Updates to the docs are always welcome, including pointing
out where they are not clear.
>> > Hi everyone,
>> >
>> > Is there a way to mark, say all messages from 2023, as read and move them
>> > into a separate folder? Something like the original question posed in
>> this
>> > thread:
>> >
>> > https://groups.google.com/g/mu-discuss/c/bgQmCy7m9uc/m/YzB2A-eZBAAJ
>> >
>> > I guess marking as read is not absolutely necessary
>>
>> I suppose the easiest may be to do it as a shell-command, using a
>> combination of 'mu find' and 'mu move'.
>
>
> Right, that makes sense. Is it possible o change the mark of a message with
> mu?
You can change the flags for a message (such as the read flag) with the
--flags parameter to 'mu move'. See the man-page.
On Sunday Mar 09 2025, Henrik Frisk wrote:
>>>
>
>> >> > Hi everyone,
>> >> >
>> >> > Is there a way to mark, say all messages from 2023, as read and move
>> them
>> >> > into a separate folder? Something like the original question posed in
>> >> this
>> >> > thread:
>> >> >
>> >> > https://groups.google.com/g/mu-discuss/c/bgQmCy7m9uc/m/YzB2A-eZBAAJ
>> >> >
>> >> > I guess marking as read is not absolutely necessary
>> >>
>> >> I suppose the easiest may be to do it as a shell-command, using a
>> >> combination of 'mu find' and 'mu move'.
>> >
>> >
>> > Right, that makes sense. Is it possible o change the mark of a message
>> with
>> > mu?
>>
>> You can change the flags for a message (such as the read flag) with the
>> --flags parameter to 'mu move'. See the man-page.
>>
>> I didn't get around to deal with this until now. One question, how can I
> get mu find to format the input so that i can either pipe it or use int in
> the mu move command? I can of course write a script and reformat the plain
> output of mu find, but before I do I wanted to check if I'm missing
> something obvious!
See the `--exec' option for `mu find'. Or alternatively, use `--fields=l'
On Wednesday Mar 12 2025, Henrik Frisk wrote:
> I'm running into problems though. If I run
>
> $ mu find d:20240401..20240501 maildir:"/work/*" | wc -l
>
> I get 617.
>
> If I run the same search with --exec like this:
>
> $ mu find d:20240401..20240501 maildir:"/work/*" --exec='mu move --flags
> -N+S' | wc -l
>
> I get:
> error: Source is not a readable file
> error: shell command exited with exit-code 1
> 223
>
> This is consistent with other searches, it ends with an exit-code 1
>
> What can I do to track down the error?
Use small steps. First your find, then `--exec echo`, then perhaps echo
your move command, and then the actually move and only then use the
pipe.
On Monday Apr 28 2025, Henrik Frisk wrote:
>>
>> Yes of course. I was confused by the fact that this:
>
> mu find s:Proton m:/fsdata/* d:20250415 --exec 'mu move -N+S'
>
> appeared to be working, but I'm guessing now it didn't, it just didn't
> throw any errors.
The situation there is a little different as there is no target path to
be confused with the source.
(I guess I could add some explicit --target=... to `mu move` to avoid
the confusion).
#!/bin/bash
mdir="maildir:/work/INBOX"
seen="--flags -N+S"
archive=/work/Archive
date=d:20250101..20250601
for m in $(mu find $date $mdir --exec echo);
do
mu move $m $seen;
# mu move $m $archive;
done