From: "Jose A. Ortega Ruiz" <jao@gnu.org>
To: info-gnus-english@gnu.org
Subject: Re: nnimap workflow examples?
Date: Sun, 26 Apr 2020 23:47:58 +0100 [thread overview]
Message-ID: <87wo61g8yp.fsf@gnus.jao.io> (raw)
In-Reply-To: <87a7314ad9.fsf@pc-117-162.ovh.com>
Hi Garjola,
On Fri, Apr 24 2020, Garjola Dindi wrote:
[...]
> I am looking for examples of configurations or workflows that I could
> use.
Here goes what i do, since i do thinks a tad differently that what i've
seen explained in the available tutorials. As you're about to see, it's
kind of complicated, and i don't expect many people to use it in the
same way, but there are some bits and pieces that i discovered over the
years and that might be useful by themselves.
- I keep my local email using dovecot smptp server. I configure it to
use a maildir directory in my home (~/var/mail), and all local mails
eventually end there, although Gnus access them exclusively via
nnimap (to localhost).
- As an aside, the fact that ~/var/mail is a regular maildir allows me
to have notifications of new mails and the like independently of
dovecot or Gnus (i use a xmobar monitor, and sometimes a little emacs
lib i wrote that in turn uses inotify).
- To fetch mail from remote imap servers (in my case a gmail account
for work and protonmail via its bridge), i use fetchmail
- I tell fetchmail to deliver the fetched mails using dovecot's mda.
This is an example using cli flags, but the same can be done in
fetchmailrc
mda="/usr/lib/dovecot/dovecot-lda -a"
function fetch_work () {
fetchmail --ssl --sslproto auto --folder $1 $2 $3 \
--mda "$mda jao+work/${1,,}" \
--user jao@bigml.com imap.gmail.com
}
fetch_work INBOX --keep
fetch_work support --nokeep --fetchall
Here, i'm fetching mail from a gmail INBOX and telling fetchmail to
deliver it to dovecot with envelope addresses
jao+work/inbox@localhost, and fetching mail from a gmail "folder"
called support and sending it to jao+work/support@locahost. "jao"
is my local username.
Also, in the first case i'm keeping emails in the remote server and
in the second deleting them when i download them.
- In dovecot, i have a sieve filter that sends mail directed to
jao+FOO to the local inbox FOO. so those mails above go to local
imap inboxes work/inbox and work/support. That's what Gnus sees
when it connects to the local imap server: a work/inbox and a
work/support.
- This can be extended to as many remote imap folders and servers as
you want (i have two servers and a handful of folders in each).
- I also have local sieve filters to put mail fetched from the remote
server in different local imap boxes. I prefer the filtering being
doing by dovecot because that way may email notifiers (which look at
the inbox maildirs) don't depend on a gnus fetch: i get a
notification as soon as dovecot puts the mail there (usually
instructed by fetchmail, asynchronosuly, but also local mail
deliveries go there).
- To search mail locally, one can use the regular nnimap search in
Gnus against the local dovecot server. I also use in paralell
ivy-notmuch: i tell notmuch to (re)index ~/var/mail after each
fetchmail round (that's in a cron job), and the perform searches
typically with ivy-notmuch)... i've got a little bit of elisp that
goes then from a notmuch result to the corresponding mail in Gnus.
- I use postfix to deliver email using different remote SMTP servers
(multiplexing on the mail's From: address), so emacs sends all mails
to just to the local MTA (postfix), and it asynchronously takes care
of dispatching the mail (that way, sending an email is always almost
instantaneous).
It's simpler than it looks :)
HTH,
jao
--
Once you hear the details of victory, it is hard to distinguish it
from a defeat. -Jean-Paul Sartre, writer and philosopher (1905-1980)
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english
next prev parent reply other threads:[~2020-04-26 23:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 7:21 Garjola Dindi
2020-04-26 22:47 ` Jose A. Ortega Ruiz [this message]
2020-04-27 2:20 ` 황병희
2020-04-27 16:19 ` Eric Abrahamsen
2020-04-28 14:46 ` Garjola Dindi
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wo61g8yp.fsf@gnus.jao.io \
--to=jao@gnu.org \
--cc=info-gnus-english@gnu.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.
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 NNTP newsgroup(s).