(Sorry for breaking the thread, I just subscribed so this is a manual reply.)
Selene Scriven wrote:
One issue I've noticed is that notmuch forgets everything it knows about a message (such as tags I've assigned) after that message is [s]aved from one maildir to another in mutt... which is probably because mutt actually does a copy-then-delete instead of simply moving it. Any idea how to avoid this?
I just started using mutt-kz and am having a similar problem.
I'm trying to use this macro to archive mail that I'm done with to a different maildir, with different notmuch labels:
macro index S "<modify-labels>-inbox\n<previous-entry><save-message>=archives\n<previous-entry><modify-labels>"
"notmuch new" doesn't detect the rename, it treats it as a new file.
I have my archive macro look like this: macro index S "<modify-labels-then-hide>+archive -inbox\n<sync-mailbox>" "archive message"
I'm using offlineimap, and I have this as a prefetch script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MAILDIR=${HOME}/ssd/Maildir # Make sure db is up-to-date notmuch new # First move any mail that's still in the INBOX, but tagged as archive to # the Reference folder OLDIFS=$IFS IFS=`echo -en "\n\b"`; for v in `notmuch search --output=files -- tag:archive and folder:${MAILDIR}/INBOX`; do if [ -f "$v" ]; then echo "Moving $v" mv -f "$v" ${MAILDIR}/Reference/cur/ else echo "'$v' is not longer present" fi done IFS=$OLDIFS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So basically I have a script move the mail around between folders based on nomuch tags rather than manually move them with mutt. 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...
AJ
On Tue, Nov 05, 2013 at 06:34:41AM -0700, Brendan Taylor wrote:
(Sorry for breaking the thread, I just subscribed so this is a manual reply.)
Selene Scriven wrote:
One issue I've noticed is that notmuch forgets everything it knows about a message (such as tags I've assigned) after that message is [s]aved from one maildir to another in mutt... which is probably because mutt actually does a copy-then-delete instead of simply moving it. Any idea how to avoid this?
I just started using mutt-kz and am having a similar problem.
I'm trying to use this macro to archive mail that I'm done with to a different maildir, with different notmuch labels:
macro index S "<modify-labels>-inbox\n<previous-entry><save-message>=archives\n<previous-entry><modify-labels>"
"notmuch new" doesn't detect the rename, it treats it as a new file. _______________________________________________ mutt-kz mailing list mutt-kz@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/mutt-kz
* AJ Lewis aj.lewis@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
mutt-kz@lists.fedoraproject.org