Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up Gnus to use both my gmail accounts but I can only ever get one at a time to show up in the list of folders.

(setq gnus-select-method '(nnimap "work@mywork.org"
                            (nnimap-address "secure.emailsrvr.com")
                            (nnimap-server-port 993)
                            (nnimap-stream ssl)))

(setq gnus-secondary-select-methods
      '((nnimap "myfirstaddress@gmail.com"
                (nnimap-address "imap.gmail.com")
                (nnimap-server-port 993)
                (nnimap-stream ssl))
        (nnimap "mysecondaddress@gmail.com"
                (nnimap-address "imap.gmail.com")
                (nnimap-server-port 993)
                (nnimap-stream ssl))))

That is the relevant portions of my .gnus file. It prompts me for three username passwords on startup. After I enter all three, I can access my work account and the gmail account that I enter the creds for second. This is really annoying! Any ideas?

share|improve this question
up vote 2 down vote accepted

Use 'foreign' servers instead of secondary servers. I have gnus set up as follows:

(setq gnus-select-method '(nntp "127.0.0.1"))

To set up the foreign server, go to your Gnus Group buffer and hit the '^' key to go to the server list. Here you can add a new "server", which can be an alias for a real server, by hitting 'a'. For example, I have a server defined with the following attributes:

(nnimap "foobar"
	(nnimap-address "192.168.1.101")
	(nnimap-server-port 143)
	(nnimap-list-pattern
	 ("INBOX" "*"))
	(nnimap-stream network)
	(nnimap-authenticator login)
	(nnimap-authinfo-file "~/.authinfo")
	(nnimap-expunge-on-close always)
	(gnus-check-new-newsgroups nil))

I can add a second one, with similar attributes:

(nnimap "baz"
	(nnimap-address "192.168.1.101")
	(nnimap-server-port 143)
	(nnimap-list-pattern
	 ("INBOX" "*"))
	(nnimap-stream network)
	(nnimap-authenticator login)
	(nnimap-expunge-on-close never)
	(nnimap-authinfo-file "~/.authinfo")
	(gnus-check-new-newsgroups nil))

in my ~/.authinfo file I have:

machine baz login bazzy.mcbaz force yes port 143
machine foobar login foobar password FooB@r force yes port 143

So one of them has the password and one doesn't. Also, the authinfo file defines what the login ID is.

share|improve this answer
    
Awesome! Thank you so much! – baudtack Dec 24 '09 at 1:12
    
Where you say "For example, I have a server defined with the following attributes:" can you be more specific. Where have you defined these and using what list? – Richard Riley Jul 27 '10 at 15:38
    
@richard: while on the screen where you went with ^, hit e. You'd be given the chance to set-up the server. Just make sure you never delete .newsrc.eld because changes are saved there. – user69275 Feb 26 '11 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .