unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Reto <reto@labrat.space>
To: moonmaillist@firemail.cc
Cc: notmuch@notmuchmail.org
Subject: Re: Best practices for notmuch and neomutt
Date: Tue, 3 Mar 2020 20:48:46 +0100	[thread overview]
Message-ID: <20200303194846.6chdh7nktwzligaf@feather.localdomain> (raw)
In-Reply-To: <4604f4697d634eb702d95ce0f43880ac@firemail.cc>

On Tue, Mar 03, 2020 at 11:13:47AM +0000, moonmaillist@firemail.cc wrote:
> I really want to know best practices or nice virtual-mailboxes, which aren't
> included in normal tutorials. Most tutorial just have 1 email address and
> only use tags like inbox, archive, deleted and spam. But there must be much
> better use cases and much more detailed notmuch queries or even hooks which
> are triggered to specific events.

I mean in the end you need to make up a system that works for you.
I personally just tag it by topic (notmuch / neomutt / distro related...)
possibilities are endless.

But the more tags you have the harder it gets to keep track and make sense of them.

I dump all mails from 3 addresses into one notmuch db.

The necessary tricks to cope with that is in neomutt

```
set sendmail="/bin/msmtp --read-envelope-from"
set use_from=yes
set reverse_name
set envelope_from=no

# special case for lists, where we aren't explicitly on the to/cc headers
reply-hook . 'unmy_hdr From:'
reply-hook '~h"Delivered-To: asdf@gmail\.com"' my_hdr from: asdf@gmail.com
reply-hook '~h"Delivered-To: xyz@stuff\.com"' my_hdr from: xyz@stuff.com
```
While that may not be the most elegant solution, at least it works.

On the notmuch side I just use a after sync script containing all the tagging
```
#first put all in the inbox
notmuch tag +inbox -- tag:new

#temporary tag which will be removed at the end
for email in ${own_adresses[@]}; do
    notmuch tag +to_me -- "to:${email} and tag:new"
done

for email in ${own_adresses[@]}; do
    notmuch tag +sent -- "from:${email} and tag:new"
done

# then remove all the non inbox stuff one by one

# filter stuff we sent from the inbox if it isn't a self message
notmuch tag -inbox -- tag:sent and not tag:to_me
notmuch tag -inbox +lists +notmuch -- to:notmuch and tag:new
# kill muted threads
notmuch search --output=threads tag:muted | xargs -r -n1 notmuch tag +muted
#get rid of old clutter from mailing lists
notmuch tag +archive -- tag:lists and date:..30d and not tag:unread
#archived stuff should not be unread
notmuch tag -unread -- tag:unread and tag:archive
#finally remove the temporary tags
notmuch tag -new -to_me -- tag:new
```

Stuff like that...
Does this help?

Greetings,
Reto

  reply	other threads:[~2020-03-03 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 11:13 Best practices for notmuch and neomutt moonmaillist
2020-03-03 19:48 ` Reto [this message]
2020-03-03 21:10 ` Kim ALLAMANDOLA

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=20200303194846.6chdh7nktwzligaf@feather.localdomain \
    --to=reto@labrat.space \
    --cc=moonmaillist@firemail.cc \
    --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).