~sircmpwn/aerc

4 3

notmuch workflow example

Details
Message ID
<CFOQUPINOLUA.22F6K62FHMEY7@diabtop>
DKIM signature
missing
Download raw message
Hi all,

I wonder if some of you could share their workflow with notmuch.

How do you fetch your emails locally?
How do you set the copy-to= option?
How would you migrate from imap/maildir to notmuch?

Thanks.

-- 
Robin
Details
Message ID
<0101017d1a7728df-ba7ea1a9-1ca8-42f3-91fc-324639ca057d-000000@us-west-2.amazonses.com>
In-Reply-To
<CFOQUPINOLUA.22F6K62FHMEY7@diabtop> (view parent)
DKIM signature
pass
Download raw message
On Sat Nov 13, 2021 at 7:06 AM PST, Robin Jarry wrote:
> Hi all,
>
> I wonder if some of you could share their workflow with notmuch.
Sure. My workflow changes now and then, and I'm still figuring some
things out, but I'll try to explain.
>
> How do you fetch your emails locally?
I have multiple accounts that I manage, both via Gmail and self hosted
(postfix/dovecot). For syncing the self hosted one, I use mbsync,
followed by a notmuch tagging script. For GMail, I was using mbsync, but
I've recently started using
[lieer](https://github.com/gauteh/lieer), which I'm pleased with so far.
It handles both syncing GMail to a local maildir and converting gmail
labels <-> notmuch tags.

I also recently started using muchsync, which syncs notmuch databases
and their maildirs across machines. I have the whole lieer + mbsync
setup on a VPS, and sync from there to get a copy onto my laptop and
desktop. But you don't need this if you only plan to use a single
machine to access your mail.

Notmuch doesn't keep track of accounts itself. I'm currently separating
accounts using the path:<xyz> filter, which allows me to filter to a
specific maildir. You could also find a way to tag all messages relating
to an account, and I've heard that some people don't bother, and just
read all their email in one account (although I'm not sure how SMTP is
handled then).

> How do you set the copy-to= option?
This is where it gets messy. Notmuch doesn't have a concept of copy-to.
The funny thing is, I did some testing, and GMail seems to (lmk if your
mileage varies) copy things to its own sent folder whether or not the
mail client does that. This is working out for me, though, because lieer
synchronizes that and tags all messages in that folder with `sent`,
which I use as a query in my gmail query-map `sent=tag:sent`. IIRC
you're using GMail, so this should work for you.

Regarding my self-hosted account, I'm still trying to figure out how to
do this. Currently the best solution I can think of is setting up
postfix to BCC on every email, and then using notmuch to tag those
emails.
> How would you migrate from imap/maildir to notmuch?
Well, for starters, you want to sync your imap to a local maildir. Two
popular options for this are mbsync and offlineimap (I use the former).
Once you have said local maildir, get notmuch to index it. The tedious
part is tagging all that mail, but since most of my mail falls into a
few buckets, it didn't take all that much time. Just use `notmuch tag
...` commands to tag your email the way you like it, and optionally sync
those back to GMail with lieer. For new email, you can set up a tagging
file to automatically tag incoming messages the way you want. This can
be achieved with `notmuch tag --input=tagmail.notmuch`, which can be
added to a post-new hook (see man notmuch-hooks).
>
> Thanks.
No problem! There's some other things I'm figuring out as I go, so I'll
probably make a blog article at some point (hopefully soon) with all
this information. I'll share that when I do :)

Hope you enjoy notmuch!

Kalyan
Details
Message ID
<CFOYEODH2I1F.3K44ILQ5LENW7@diabtop>
In-Reply-To
<0101017d1a7728df-ba7ea1a9-1ca8-42f3-91fc-324639ca057d-000000@us-west-2.amazonses.com> (view parent)
DKIM signature
missing
Download raw message
Kalyan Sriram, Nov 13, 2021 at 19:02:
> I have multiple accounts that I manage, both via Gmail and self hosted
> (postfix/dovecot). For syncing the self hosted one, I use mbsync,
> followed by a notmuch tagging script. For GMail, I was using mbsync, but
> I've recently started using
> [lieer](https://github.com/gauteh/lieer), which I'm pleased with so far.
> It handles both syncing GMail to a local maildir and converting gmail
> labels <-> notmuch tags.

Oh this reminds me that I had tried out that project a few years ago.
I really liked the concept but not the way it was implemented. I gave
myself the challenge to create a similar tool but I never got to use it
extensively. If you have a chance, I would really like some feedback :)

https://git.sr.ht/~rjarry/notmuch-gmail

I have just taken out the code from the grave and giving it a test run.
It looks like it still works :)

> > How do you set the copy-to= option?
> This is where it gets messy. Notmuch doesn't have a concept of copy-to.
> The funny thing is, I did some testing, and GMail seems to (lmk if your
> mileage varies) copy things to its own sent folder whether or not the
> mail client does that. This is working out for me, though, because lieer
> synchronizes that and tags all messages in that folder with `sent`,
> which I use as a query in my gmail query-map `sent=tag:sent`. IIRC
> you're using GMail, so this should work for you.
>
> Regarding my self-hosted account, I'm still trying to figure out how to
> do this. Currently the best solution I can think of is setting up
> postfix to BCC on every email, and then using notmuch to tag those
> emails.

It looks like this should be handled by the email client itself.
copy-to= should do something special depending on the account type. For
imap/maildir, it only means saving the message in a folder. However for
notmuch, it would require some additional steps. Maybe a completely
different action.

What do you think?

> No problem! There's some other things I'm figuring out as I go, so I'll
> probably make a blog article at some point (hopefully soon) with all
> this information. I'll share that when I do :)

Thanks a lot for all this.

By the way, I don't know how aerc handles "delete" and "archive" with
a notmuch account. Does it involve adding/removing tags?

-- 
Robin
Details
Message ID
<87r1bjegkx.fsf@desktop.jonjfineman.com>
In-Reply-To
<CFOYEODH2I1F.3K44ILQ5LENW7@diabtop> (view parent)
DKIM signature
missing
Download raw message

"Robin Jarry" <robin@jarry.cc> writes:

>
> It looks like this should be handled by the email client itself.
> copy-to= should do something special depending on the account type. For
> imap/maildir, it only means saving the message in a folder. However for
> notmuch, it would require some additional steps. Maybe a completely
> different action.
>
> What do you think?
>

For fastmail I ended up BCC'ing myself. I added the bellow. Other ISPs
should support plus addressing.

message-default-mail-headers "Bcc: id+Sent@isp.com"
Details
Message ID
<0101017d1be252b1-10dffc45-1feb-4386-9583-42f9aea95b6d-000000@us-west-2.amazonses.com>
In-Reply-To
<CFOYEODH2I1F.3K44ILQ5LENW7@diabtop> (view parent)
DKIM signature
pass
Download raw message
On Sat Nov 13, 2021 at 1:02 PM PST, Robin Jarry wrote:
> Kalyan Sriram, Nov 13, 2021 at 19:02:
> > I have multiple accounts that I manage, both via Gmail and self hosted
> > (postfix/dovecot). For syncing the self hosted one, I use mbsync,
> > followed by a notmuch tagging script. For GMail, I was using mbsync, but
> > I've recently started using
> > [lieer](https://github.com/gauteh/lieer), which I'm pleased with so far.
> > It handles both syncing GMail to a local maildir and converting gmail
> > labels <-> notmuch tags.
>
> Oh this reminds me that I had tried out that project a few years ago.
> I really liked the concept but not the way it was implemented. I gave
> myself the challenge to create a similar tool but I never got to use it
> extensively. If you have a chance, I would really like some feedback :)
>
> https://git.sr.ht/~rjarry/notmuch-gmail
>
> I have just taken out the code from the grave and giving it a test run.
> It looks like it still works :)
>
Cool! Sure thing, I'll take a look when I get a chance.

> > > How do you set the copy-to= option?
> > This is where it gets messy. Notmuch doesn't have a concept of copy-to.
> > The funny thing is, I did some testing, and GMail seems to (lmk if your
> > mileage varies) copy things to its own sent folder whether or not the
> > mail client does that. This is working out for me, though, because lieer
> > synchronizes that and tags all messages in that folder with `sent`,
> > which I use as a query in my gmail query-map `sent=tag:sent`. IIRC
> > you're using GMail, so this should work for you.
> >
> > Regarding my self-hosted account, I'm still trying to figure out how to
> > do this. Currently the best solution I can think of is setting up
> > postfix to BCC on every email, and then using notmuch to tag those
> > emails.
>
> It looks like this should be handled by the email client itself.
> copy-to= should do something special depending on the account type. For
> imap/maildir, it only means saving the message in a folder. However for
> notmuch, it would require some additional steps. Maybe a completely
> different action.
>
> What do you think?
Hmm, I'm not sure about this one. I know that in IMAP this works out, and it's
annoying to have to depend on a server to solve the problem, but I'm not
sure what the best way to do this is other than BCC. Modifying the local
maildir is sketchy/something the notmuch workflow doesn't encourage.
I'll ask about this on the notmuch IRC, and also email Reto about what
he used to do (IIRC he used notmuch).
>
> > No problem! There's some other things I'm figuring out as I go, so I'll
> > probably make a blog article at some point (hopefully soon) with all
> > this information. I'll share that when I do :)
>
> Thanks a lot for all this.
Sure thing!
>
> By the way, I don't know how aerc handles "delete" and "archive" with
> a notmuch account. Does it involve adding/removing tags?
>
Yes. Personally I use two tags for this, `inbox` and `trash`. Deleting
is just :modify-labels +trash -inbox<Enter>, and I have exclude-tags set to
trash. My query map filters by tag:inbox, and I set that tag to all new
email by default, so archive is :modify-labels -inbox<Enter>.

By the way, I also started sketching out a project a couple weeks ago,
that aims to simplify a lot of this synchronization of states between
different mediums (IMAP, smartphone, multiple computers with maildir,
notmuch, GMail): https://git.sr.ht/~coder_kalyan/msync. Currently it
doesn't do anything useful at all, but if you're interested, we could
discuss this further. Would be great to have someone else to discuss
design with and review implementation. LMK.

Kalyan
Reply to thread Export thread (mbox)