Home » Questions » Computers [ Ask a new question ]

Multiple email accounts from the same server in Emacs Gnus

Multiple email accounts from the same server in Emacs Gnus

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.

Asked by: Guest | Views: 298
Total answers/comments: 1
Guest [Entry]

"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."