* AJ Lewis <aj.lewis(a)quantum.com> wrote:
So basically I have a script move the mail around between
folders based on nomuch tags rather than manually move them
with mutt.
Me too, but I'm doing it via 'afew' instead of directly.
I have a setup which is something like this...
~/.mutt/rc.kz.work:
# organize by maildirs and/or tags
virtual-mailboxes \
"INBOX" "notmuch://?query=folder:work AND folder:in AND NOT
tag:archive" \
"TODO" "notmuch://?query=folder:work AND folder:in AND NOT tag:archive
AND tag:todo" \
"Foo" "notmuch://?query=folder:work AND (folder:foo OR tag:foo) AND
folder:in AND NOT tag:archive" \
"Bar" "notmuch://?query=folder:work AND (folder:bar OR tag:bar) AND
folder:in AND NOT tag:archive" \
"All lists" "notmuch://?query=folder:work AND tag:lists AND folder:in AND
NOT tag:archive" \
"--- Archives ---" "notmuch://?query=tag:none-arch" \
"All" "notmuch://?query=folder:work AND (tag:archive OR NOT
folder:in)" \
"Done" "notmuch://?query=folder:work AND (tag:archive OR NOT folder:in)
AND tag:todo" \
"A/Foo" "notmuch://?query=folder:work AND (folder:foo OR tag:foo) AND
(tag:archive OR NOT folder:in))" \
"A/Bar" "notmuch://?query=folder:work AND (folder:bar OR tag:bar) AND
(tag:archive OR NOT folder:in))" \
# archive tagged messages
macro index aa "<tag-prefix><modify-labels>+archive
-inbox<Enter><tag-prefix><tag-entry><sync-mailbox>"
# stuff I need to do
macro index mt "<modify-labels>+todo<Enter><sync-mailbox>"
macro index mT "<modify-labels>-todo<Enter><sync-mailbox>" #
don't need to do it after all
# mark/arch as foo
macro index mf "<modify-labels>+foo<Enter><sync-mailbox>"
macro index af "<tag-prefix><modify-labels>+foo +archive
-inbox<Enter><tag-prefix><tag-entry><sync-mailbox>"
# mark/arch as bar
macro index mb "<modify-labels>+bar<Enter><sync-mailbox>"
macro index ab "<tag-prefix><modify-labels>+bar +archive
-inbox<Enter><tag-prefix><tag-entry><sync-mailbox>"
~/.config/afew/config:
[MailMover]
folders = work/in work/foo/in work/bar/in
work/in = \
'tag:archive AND tag:foo':work/foo \
'tag:archive AND tag:bar':work/bar \
'tag:archive':work
work/foo/in = 'tag:archive':work/foo
work/bar/in = 'tag:archive':work/bar
This isn't the exact setup, of course, but I hope it demonstrates
the basic idea. Some things get delivered into a variety of
maildirs (via procmail), while others go into a main inbox and
are simply tagged (via 'afew'). I can tag and archive several
topics with short key sequences like 'mf' to mark something as
'foo', or 'ab' to archive something as topic 'bar'. If a message
is already tagged properly, I can simply 'aa' to archive all
messages currently selected in mutt.
The messages then get moved into appropriate maildirs by 'afew',
next time it runs. This (afew --move-mails) happens in my
fetchmail polling script, just after 'notmuch new' and 'afew
--tag --new'.
I don't know why what you're doing wouldn't work though,
unless
the directory it's getting moved to isn't in the notmuch search
path...
No idea, but when mutt moves the message (copy+delete), notmuch
views it as entirely new... while other tools can move messages
just fine.
-- Selene