Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Richard Riley <rileyrg@gmail.com>
To: info-gnus-english@gnu.org
Subject: Re: Gnus with multiple gmail imap accounts
Date: Wed, 28 Jul 2010 21:14:04 +0200	[thread overview]
Message-ID: <i2pvht$uth$1@dough.gmane.org> (raw)
In-Reply-To: <i2plj1$og5$1@dough.gmane.org>

Richard Riley <rileyrg@gmail.com> writes:

> I would be interested in hearing how anyone has got gnus talking to
> multiple gmail accounts. One sticking point is the non prefixed INBOX on
> each account. How best to handle this or to uniquely name each INBOX for
> each gmail account? (Come to that how to uniquely name All Mail, spam etc too).
>
> There is some advice here
>
> http://superuser.com/questions/86798/multiple-email-accounts-from-the-same-server-in-emacs-gnus
>
> But I'm not sure how he defined those servers with their aliases in elisp (the author has
> since dropped gnus for wanderlust).
>
> One approach I have tried (but dont really like) is to apply a filter to ALL
> incoming mail and to label each new post with something like
> "inbox-rileyrg" and then subscribe to that "label/group" from gnus. That
> doesnt solve the issue with the gmail system labels however.
>
> Any pointers appreciated.

I have settled on this solution.

Firstly create your nnimap servers :-

--8<---------------cut here---------------start------------->8---
  (setq gnus-secondary-select-methods '((nnimap "rileymail"
                                                (nnimap-server-port 993)
                                                (nnimap-stream ssl)                                                             
                                                (nnir-search-engine imap)
                                                (nnimap-address "imap.gmail.com")
                                                (nnimap-list-pattern ("inbox-" "webs" "tax"))
                                                (nnimap-authinfo-file "~/.authinfo.gpg")
                                                )
                                        (nnimap "shamrockmail"
                                                (nnimap-server-port 993)
                                                (nnimap-stream ssl)                                                             
                                                (nnir-search-engine imap)
                                                (nnimap-address "imap.gmail.com")
                                                (nnimap-list-pattern ("inbox-"))
                                                (nnimap-authinfo-file "~/.authinfo.gpg")
                                                )
                                        (nnimap "friendsmail"
                                                (nnimap-server-port 993)
                                                (nnimap-stream ssl)                                                             
                                                (nnir-search-engine imap)
                                                (nnimap-address "imap.gmail.com")
                                                (nnimap-list-pattern ("inbox-"))
                                                (nnimap-authinfo-file "~/.authinfo.gpg")
                                                )
                                        ))

--8<---------------cut here---------------end--------------->8---

Notice the nnimap-list-pattern - this limits the imap folders you can
see. Gmail is messy. Tweak as appropriate.

Then for each  account alias above add a line to your .authinfo (I use a gpg
file) like this :-

--8<---------------cut here---------------start------------->8---
machine friendsmail login gmailuserid force yes password mypassword port 993
--8<---------------cut here---------------end--------------->8---

Now the important thing is to set up each gmail account so that you can
uniquely recognise things and not have clashing INBOXs. This is done by
creating a filter on my INBOX for each account where in "words to search
for" you use "in:inbox" and specify that filter to then apply a label to
all incoming email. So I have a filter on my rileyrg account which
applies a label "inbox-personal" to all incoming mail. When I browse the
"rileymail" nnimap server shown above I then see and subscribe to an
IMAP group called .. inbox-personal. For the shamrockmail I apply the
label "inbox-shamrock". etc etc - easy to differentiate the different
INBOXs this way.

Seems to work well but I would be interested to hear any alternative and
potentially simpler methods.

One thing now I miss not using offlineimap to store mail locally is the
use mairix. Is there some way to search all mail via imap? I think alt-s
only searches the mails in the summary buffer and not all the mails.

      reply	other threads:[~2010-07-28 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 16:24 Richard Riley
2010-07-28 19:14 ` Richard Riley [this message]

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='i2pvht$uth$1@dough.gmane.org' \
    --to=rileyrg@gmail.com \
    --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).