Hello list! I encountered a bit of an UX issue, I think. How do you
synchronize mail constantly and index it with notmuch?
My current setup is mbsync in pre-hook, then post hook: alot + alot
move-mode + mbsync + notifymuch. All of this is run manually. The thing
is - I need to sync all folders since I move mails (so my INBOX would
not get clogged by mailing list messages when I'm viewing it on mobile).
Probably INBOX can be put on IMAP PUSH, but other folders still need to
be synced manually.
The possible solutions are:
1. Put everything into some sort of cron job (systemd timer?). This
looks the easiest, but would sync mail only <X> minutes.
2. Get rid of first mbsync, make it only poll INBOX, then index it every
time a new message comes. Feels a bit impractical to run `notmuch new`
for every message, since I'm not that proficient in mbsync settings.
Also I'm using NixOS and home-manager to keep most of the setup working,
so maybe there would be a little more or a lot less config tweaking.
This setup also has a problem of overloading my mail server, which can
possibly crash it since I keep it on my RPi. Folder moves could probably
be run only every <X> minutes, but that would require somehow rewriting
3. Get rid of folder-moving. Would need to get rid of mobile mail access
4. Transfer the setup to mail server. Would take more time, but I would
be able to move and index messages even when my laptop is unavailable.
Also would require setting up Nix (since my server runs on Gentoo).
And to maybe think of alternative solution, I ask you - what do you use
to seamlessly sync your mail?
> And to maybe think of alternative solution, I ask you - what do you use
> to seamlessly sync your mail?
I use a script that connects to my imap server. New mail comes into
my sieve-filtered inbox which then triggers the imap-notify script
on my local machine. This script runs muchsync, which in turn runs
notmuch new on the remote machine, and then syncs tags between the local
machine and the server.
Once muchsync finishes I trigger a notification with notify-send,
which pops up a message on twmnd.
To make this rube goldberg device work I have a bunch of systemd
services defined in NixOS that manages everything. It's pretty hacky
and can get stuck, so I have a python script that restarts imap-notifier
when I wake from sleep when I'm on my laptop.
I should probably get around to turning this into a single program that
works well, but here we are.
My setup with muchsync assumes you run your own mailserver. If you're
using something like gmail you can scrap the muchsync step and just use
an imap-notifier-like script to run mbsync and the notmuch-new.
> Hello list! I encountered a bit of an UX issue, I think. How do you
> synchronize mail constantly and index it with notmuch?
I use offlineimap for syncing. Works perfect for me. I am syncing two
mail accounts this way, using some mail service providers. Offlineimap
works by keep running and I have it configured to sync every 4 minutes.
Then I have a hook (postsynchook) in the offlineimap config that calls a
script where I index and tag stuff with notmuch. It shouldn't be
difficult to move messages between folders during that script, I guess
before indexing with notmuch.
> My current setup is mbsync in pre-hook, then post hook: alot + alot
> move-mode + mbsync + notifymuch. All of this is run manually. The thing
> is - I need to sync all folders since I move mails (so my INBOX would
> not get clogged by mailing list messages when I'm viewing it on mobile).
I do some refiling of mailing-list items, but semi-manually. I have
key-bindings to mark messages with a tag 'rfile' and then in the 'hello'
buffer I have a another key-binding to trigger the actual move between
folders. I put those list-messages in a folder 'archive' which is not
synced and hence gets deleted from server. (Not sure if this was also
your concern but anyway).