unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: erik colson <eco@ecocode.net>
To: notmuch@notmuchmail.org
Subject: moving mail to another maildir based on tags and renaming files
Date: Mon, 23 May 2022 23:02:22 +0200	[thread overview]
Message-ID: <87ilpwc68x.fsf@beavernet.be> (raw)

Hi,

I would like to move mails selected by a notmuch query
(i.e. "tag:movethismailtobox-ThisBox") to *ThisBox*
I need this to somewhat still have usable access through my phone IMAP
client.

I am actually using afew already, but as I have 1000+ mailboxes it is
unmaintainable to create the rules manually.

So I am thinking to either modify the afew-configuration file with
another script (=not nice) or either write a script myself.

It wouldn't be very difficult to generate the necessary
  notmuch search --output=files ... | xargs mv ...
  
but, there is a catch: I use isync to synchronize my mails with my IMAP
server and therefor I must rename every message file when moving it.  As
I am not enough aware of maildir and IMAP servers, I am pretty ignorant
to what the new filename should be.

So I wanted to check if somebody else already wrote some
bash/perl/whatever script which handles this ?

thx
-- 
erik colson

             reply	other threads:[~2022-05-23 21:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 21:02 erik colson [this message]
2022-05-23 21:19 ` moving mail to another maildir based on tags and renaming files inwit
2022-05-23 22:01   ` erik colson
2022-05-24  9:15     ` inwit
2022-05-24  9:45       ` erik colson
2022-05-24 12:26         ` David Bremner
2022-05-24 14:08           ` erik colson
2022-05-24  0:48 ` João Pedro
2022-05-24  8:49   ` erik colson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilpwc68x.fsf@beavernet.be \
    --to=eco@ecocode.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).