[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gnus with multiple gmail imap accounts
From: |
Richard Riley |
Subject: |
Re: Gnus with multiple gmail imap accounts |
Date: |
Wed, 28 Jul 2010 21:14:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
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.