From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/14038 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.gnus.user Subject: Re: Gnus with multiple gmail imap accounts Date: Wed, 28 Jul 2010 21:14:04 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1280344520 1869 80.91.229.12 (28 Jul 2010 19:15:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 28 Jul 2010 19:15:20 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Wed Jul 28 21:15:18 2010 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OeC5x-0003Qz-7o for gegu-info-gnus-english@m.gmane.org; Wed, 28 Jul 2010 21:15:13 +0200 Original-Received: from localhost ([127.0.0.1]:59116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeC5w-0000KJ-HK for gegu-info-gnus-english@m.gmane.org; Wed, 28 Jul 2010 15:15:12 -0400 Original-Received: from [140.186.70.92] (port=50596 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeC5t-0000KE-69 for info-gnus-english@gnu.org; Wed, 28 Jul 2010 15:15:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeC5r-0001Qe-Tc for info-gnus-english@gnu.org; Wed, 28 Jul 2010 15:15:09 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:59651) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeC5r-0001QP-GU for info-gnus-english@gnu.org; Wed, 28 Jul 2010 15:15:07 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OeC5H-0001yu-0z for info-gnus-english@gnu.org; Wed, 28 Jul 2010 21:14:31 +0200 Original-Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Jul 2010 21:14:30 +0200 Original-Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Jul 2010 21:14:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 81 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 85.183.18.158 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:14038 Archived-At: Richard Riley 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.