Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* IMAP - two accounts on one server
@ 2016-09-21  7:55 Loris Bennett
  2016-09-21  8:12 ` Eric Abrahamsen
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Loris Bennett @ 2016-09-21  7:55 UTC (permalink / raw)
  To: info-gnus-english

Hi,

Many years ago I set Gnus up to read mail from a server via IMAP and
every thing has been working fine.  I now want to add a second account
on the same server[1].

I have added a corresponding line to .authinfo, but there doesn't seem
to be a variable I could add to the select method to indicate which
account should be used.

Currently I just don't see any extra folders from the second account and
they do not appear when I try to subscribe to additional folder.

Any ideas?

Cheers,

Loris

Footnotes: 
[1]  To be honest, the accounts are not on the same server.  However,
the server address is the same in both cases.  Behind the scenes some
jiggery-pokery goes on to forward mail to a second server in the case of
the second account.  

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-21  7:55 IMAP - two accounts on one server Loris Bennett
@ 2016-09-21  8:12 ` Eric Abrahamsen
  2016-09-21  8:17 ` Adam Sjøgren
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Eric Abrahamsen @ 2016-09-21  8:12 UTC (permalink / raw)
  To: info-gnus-english

"Loris Bennett" <loris.bennett@fu-berlin.de> writes:

> Hi,
>
> Many years ago I set Gnus up to read mail from a server via IMAP and
> every thing has been working fine.  I now want to add a second account
> on the same server[1].
>
> I have added a corresponding line to .authinfo, but there doesn't seem
> to be a variable I could add to the select method to indicate which
> account should be used.
>
> Currently I just don't see any extra folders from the second account and
> they do not appear when I try to subscribe to additional folder.
>
> Any ideas?
>
> Cheers,
>
> Loris
>
> Footnotes: 
> [1]  To be honest, the accounts are not on the same server.  However,
> the server address is the same in both cases.  Behind the scenes some
> jiggery-pokery goes on to forward mail to a second server in the case of
> the second account.  

You didn't mention adding the second server to
`gnus-secondary-select-methods' -- that's the key step. Have you done
that? Gnus won't know about the server until you put it there, and once
it does know, it can handle the ~/.authinfo step by itself.

E



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-21  7:55 IMAP - two accounts on one server Loris Bennett
  2016-09-21  8:12 ` Eric Abrahamsen
@ 2016-09-21  8:17 ` Adam Sjøgren
       [not found] ` <mailman.2735.1474445609.22741.info-gnus-english@gnu.org>
       [not found] ` <mailman.2738.1474445871.22741.info-gnus-english@gnu.org>
  3 siblings, 0 replies; 13+ messages in thread
From: Adam Sjøgren @ 2016-09-21  8:17 UTC (permalink / raw)
  To: info-gnus-english

Loris writes:

> I have added a corresponding line to .authinfo, but there doesn't seem
> to be a variable I could add to the select method to indicate which
> account should be used.

There is, but the way people demonstrate mail configuration often
obscures this.

The point is that that the string after "machine" does NOT have to be
the hostname of the server. It can be anything, as long as it matches
your configuration of the nnimap server in Gnus.

So you could have something like:

  (setq gnus-secondary-select-methods
        '(
           (nnimap "one"
                   (nnimap-address "imap.gmail.com"))
           (nnimap "other"
                   (nnimap-address "imap.gmail.com"))))

in your .gnus, and in .authinfo you would match those up with:

  machine one login something@gmail.com password "verysecret" port imap
  machine other login somethingelse@gmail.com password "alsosecret" port imap

Hope this helps.


  Best regards,

    Adam

-- 
 "The Web is not high school."                                Adam Sjøgren
                                                         asjo@koldfront.dk


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
       [not found] ` <mailman.2735.1474445609.22741.info-gnus-english@gnu.org>
@ 2016-09-21 12:10   ` Loris Bennett
  0 siblings, 0 replies; 13+ messages in thread
From: Loris Bennett @ 2016-09-21 12:10 UTC (permalink / raw)
  To: info-gnus-english

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> "Loris Bennett" <loris.bennett@fu-berlin.de> writes:
>
>> Hi,
>>
>> Many years ago I set Gnus up to read mail from a server via IMAP and
>> every thing has been working fine.  I now want to add a second account
>> on the same server[1].
>>
>> I have added a corresponding line to .authinfo, but there doesn't seem
>> to be a variable I could add to the select method to indicate which
>> account should be used.
>>
>> Currently I just don't see any extra folders from the second account and
>> they do not appear when I try to subscribe to additional folder.
>>
>> Any ideas?
>>
>> Cheers,
>>
>> Loris
>>
>> Footnotes: 
>> [1]  To be honest, the accounts are not on the same server.  However,
>> the server address is the same in both cases.  Behind the scenes some
>> jiggery-pokery goes on to forward mail to a second server in the case of
>> the second account.  
>
> You didn't mention adding the second server to
> `gnus-secondary-select-methods' -- that's the key step. Have you done
> that? Gnus won't know about the server until you put it there, and once
> it does know, it can handle the ~/.authinfo step by itself.

Sorry, I wasn't explicit enough.  I did realise that I needed another
entry in 'gnus-secondary-select-methods', but I just couldn't see how to
differentiate if from the existing one, given that I was using the
server address as the name of the entry, and this is the same for both
accounts.  Thus, Adam pointing out that the "Address" for the select
method can be any string, not just the server address, was very helpful.

Cheers,

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
       [not found] ` <mailman.2738.1474445871.22741.info-gnus-english@gnu.org>
@ 2016-09-21 14:13   ` Ted Zlatanov
  2016-09-21 15:07     ` Adam Sjøgren
       [not found]     ` <mailman.2753.1474470506.22741.info-gnus-english@gnu.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Ted Zlatanov @ 2016-09-21 14:13 UTC (permalink / raw)
  To: info-gnus-english

On Wed, 21 Sep 2016 10:17:25 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> There is, but the way people demonstrate mail configuration often
AS> obscures this.

AS> The point is that that the string after "machine" does NOT have to be
AS> the hostname of the server. It can be anything, as long as it matches
AS> your configuration of the nnimap server in Gnus.

AS> So you could have something like:
...

:) This is basically what I wrote in
(info "(auth) Multiple GMail accounts with Gnus")

Do you think that page should be expanded? Or maybe linked from the Gnus
docs? It seems to keep tripping people up.

Ted

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-21 14:13   ` Ted Zlatanov
@ 2016-09-21 15:07     ` Adam Sjøgren
       [not found]     ` <mailman.2753.1474470506.22741.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Adam Sjøgren @ 2016-09-21 15:07 UTC (permalink / raw)
  To: info-gnus-english

Ted writes:

> On Wed, 21 Sep 2016 10:17:25 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

> AS> So you could have something like:
> ...

> :) This is basically what I wrote in
> (info "(auth) Multiple GMail accounts with Gnus")

I can't find that info-page in my Emacs. Maybe it is too old? (GNU Emacs
24.5.1)

> Do you think that page should be expanded? Or maybe linked from the Gnus
> docs? It seems to keep tripping people up.

Who reads the documentation?

I think the only way to avoid these questions is to change every example
and every tutorial to _not_ use the hostname of the mail server as the
name of the server in Gnus.

I don't think it is realistic to do that. Anyway, we need something to
talk about here as well :-)


  Best regards,

    Adam

-- 
 "The key to making programs fast is to make them do          Adam Sjøgren
  practically nothing. ;-)"                              asjo@koldfront.dk


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
       [not found]     ` <mailman.2753.1474470506.22741.info-gnus-english@gnu.org>
@ 2016-09-22  7:19       ` Loris Bennett
  2016-09-22  8:26         ` Adam Sjøgren
       [not found]         ` <mailman.2806.1474532810.22741.info-gnus-english@gnu.org>
  2016-09-22 12:07       ` Ted Zlatanov
  1 sibling, 2 replies; 13+ messages in thread
From: Loris Bennett @ 2016-09-22  7:19 UTC (permalink / raw)
  To: info-gnus-english

asjo@koldfront.dk (Adam Sjøgren) writes:

> Ted writes:
>
>> On Wed, 21 Sep 2016 10:17:25 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 
>
>> AS> So you could have something like:
>> ...
>
>> :) This is basically what I wrote in
>> (info "(auth) Multiple GMail accounts with Gnus")
>
> I can't find that info-page in my Emacs. Maybe it is too old? (GNU Emacs
> 24.5.1)

I'm on 24.4.1, where the page probably exists even less.  However, even
if it did exist, wouldn't it be better to call it "Multiple accounts on
the same server with Gnus" if it doesn't just apply to Gmail? 

>> Do you think that page should be expanded? Or maybe linked from the Gnus
>> docs? It seems to keep tripping people up.
>
> Who reads the documentation?
>
> I think the only way to avoid these questions is to change every example
> and every tutorial to _not_ use the hostname of the mail server as the
> name of the server in Gnus.
>
> I don't think it is realistic to do that. Anyway, we need something to
> talk about here as well :-)

Yeah, that ole internet thing sure does need fixin'.

But before I do that, I still have the problem that I can only access
one of the accounts.  The same set of folders appear twice, once
each for the secondary select method entries "one" and "two".

I can get the folders of either account, but Which folders I get seems
to depend on the order of the entries in the .authfile.  So it look as
if, once the connection to the server is made, the connection for the
second account is skipped, because Gnus has already seen the server.  Is
that a possible explanation?

Cheers,

Loris

-- 
This signature is currently under construction.
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-22  7:19       ` Loris Bennett
@ 2016-09-22  8:26         ` Adam Sjøgren
       [not found]         ` <mailman.2806.1474532810.22741.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 13+ messages in thread
From: Adam Sjøgren @ 2016-09-22  8:26 UTC (permalink / raw)
  To: info-gnus-english

Loris writes:

> I still have the problem that I can only access one of the accounts.
> The same set of folders appear twice, once each for the secondary
> select method entries "one" and "two".

Show your configuration.

Otherwise we can be guessing forever.


  Best regards,

    Adam

-- 
 "Accept failure gracefully."                                 Adam Sjøgren
                                                         asjo@koldfront.dk


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
       [not found]         ` <mailman.2806.1474532810.22741.info-gnus-english@gnu.org>
@ 2016-09-22  9:39           ` Loris Bennett
  2016-09-22 10:36             ` Adam Sjøgren
  2016-09-22 12:06             ` Ted Zlatanov
  0 siblings, 2 replies; 13+ messages in thread
From: Loris Bennett @ 2016-09-22  9:39 UTC (permalink / raw)
  To: info-gnus-english

asjo@koldfront.dk (Adam Sjøgren) writes:

> Loris writes:
>
>> I still have the problem that I can only access one of the accounts.
>> The same set of folders appear twice, once each for the secondary
>> select method entries "one" and "two".
>
> Show your configuration.
>
> Otherwise we can be guessing forever.
>

OK:

 '(gnus-secondary-select-methods
   (quote
    ((nnimap "mail.zedat.fu-berlin.de"
             (nnimap-stream tls)
             (nnir-search-engine imap)
             (remove-prefix "nnimap")
             (nnimap-address "mail.zedat.fu-berlin.de"))
     (nnimap "fu_exchange"
             (nnimap-stream tls)
             (nnir-search-engine imap)
             (remove-prefix "nnimap")
             (nnimap-address "mail.zedat.fu-berlin.de"))
     (nntp "news.fu-berlin.de"
           (remove-prefix nntp)))))

I have now discovered that this in fact works, but only if I don't save
the credentials in .authinfo.  If I enter both sets of credentials every
time, Gnus shows me folders from both accounts.

If I do allow Gnus to add an entry for "mail.zedat.fu-berlin.de", then I
don't get asked about the credentials for the entry "fu_exchange", Gnus
shows me the folders from the "mail.zedat.fu-berlin.de" account but not
those for "fu_exchange".  I also can't subscribe to any folders from
"fu_exchange".

So to me it looks like there is a problem when .authinfo is read, but
obviously some people have this kind of setup working with two Gmail
accounts.  So I'm stumped.

Cheers,

Loris


-- 
This signature is currently under construction.
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-22  9:39           ` Loris Bennett
@ 2016-09-22 10:36             ` Adam Sjøgren
  2016-09-22 12:06             ` Ted Zlatanov
  1 sibling, 0 replies; 13+ messages in thread
From: Adam Sjøgren @ 2016-09-22 10:36 UTC (permalink / raw)
  To: info-gnus-english

Loris writes:

>  '(gnus-secondary-select-methods
>    (quote
>     ((nnimap "mail.zedat.fu-berlin.de"

What happens if you change the name of this server to something that is
not exactly the same as the hostname?

What does your .authinfo.gpg look like? (Remember to remove passwords.)

>              (nnimap-stream tls)
>              (nnir-search-engine imap)
>              (remove-prefix "nnimap")
>              (nnimap-address "mail.zedat.fu-berlin.de"))
>      (nnimap "fu_exchange"
>              (nnimap-stream tls)
>              (nnir-search-engine imap)
>              (remove-prefix "nnimap")
>              (nnimap-address "mail.zedat.fu-berlin.de"))
>      (nntp "news.fu-berlin.de"
>            (remove-prefix nntp)))))

Maybe the .authinfo guessing-logic is "too smart"; that's the only thing
I can think of.


  Best regards,

    Adam

-- 
 "Jeg har det bedst med en sort hætte over hovedet og         Adam Sjøgren
  en dukke."                                             asjo@koldfront.dk


_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-22  9:39           ` Loris Bennett
  2016-09-22 10:36             ` Adam Sjøgren
@ 2016-09-22 12:06             ` Ted Zlatanov
  2016-09-22 14:39               ` Loris Bennett
  1 sibling, 1 reply; 13+ messages in thread
From: Ted Zlatanov @ 2016-09-22 12:06 UTC (permalink / raw)
  To: info-gnus-english

On Thu, 22 Sep 2016 11:39:06 +0200 "Loris Bennett" <loris.bennett@fu-berlin.de> wrote: 

...
LB> I have now discovered that this in fact works, but only if I don't save
LB> the credentials in .authinfo.  If I enter both sets of credentials every
LB> time, Gnus shows me folders from both accounts.
...
LB> So to me it looks like there is a problem when .authinfo is read, but
LB> obviously some people have this kind of setup working with two Gmail
LB> accounts.  So I'm stumped.

Set `auth-source-debug' to 'trivia and show the relevant lines from the
*Messages* buffer when you get the bad behavior.

Thanks
Ted

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
       [not found]     ` <mailman.2753.1474470506.22741.info-gnus-english@gnu.org>
  2016-09-22  7:19       ` Loris Bennett
@ 2016-09-22 12:07       ` Ted Zlatanov
  1 sibling, 0 replies; 13+ messages in thread
From: Ted Zlatanov @ 2016-09-22 12:07 UTC (permalink / raw)
  To: info-gnus-english

On Wed, 21 Sep 2016 17:07:36 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> Ted writes:
>> (info "(auth) Multiple GMail accounts with Gnus")

AS> I can't find that info-page in my Emacs. Maybe it is too old? (GNU Emacs
AS> 24.5.1)

That's weird, it's been part of Emacs for a while and I can definitely
access it.

Ted

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: IMAP - two accounts on one server
  2016-09-22 12:06             ` Ted Zlatanov
@ 2016-09-22 14:39               ` Loris Bennett
  0 siblings, 0 replies; 13+ messages in thread
From: Loris Bennett @ 2016-09-22 14:39 UTC (permalink / raw)
  To: info-gnus-english

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 22 Sep 2016 11:39:06 +0200 "Loris Bennett" <loris.bennett@fu-berlin.de> wrote: 
>
> ...
> LB> I have now discovered that this in fact works, but only if I don't save
> LB> the credentials in .authinfo.  If I enter both sets of credentials every
> LB> time, Gnus shows me folders from both accounts.
> ...
> LB> So to me it looks like there is a problem when .authinfo is read, but
> LB> obviously some people have this kind of setup working with two Gmail
> LB> accounts.  So I'm stumped.
>
> Set `auth-source-debug' to 'trivia and show the relevant lines from the
> *Messages* buffer when you get the bad behavior.

Thanks for this advice.  However "unfortunately" the problem has
disappeared after restarting emacs a few times.  Nevertheless it will be
handy for the next problem, but I'll start a new thread for that.

Cheers,

Loris

-- 
This signature is currently under construction.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-09-22 14:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21  7:55 IMAP - two accounts on one server Loris Bennett
2016-09-21  8:12 ` Eric Abrahamsen
2016-09-21  8:17 ` Adam Sjøgren
     [not found] ` <mailman.2735.1474445609.22741.info-gnus-english@gnu.org>
2016-09-21 12:10   ` Loris Bennett
     [not found] ` <mailman.2738.1474445871.22741.info-gnus-english@gnu.org>
2016-09-21 14:13   ` Ted Zlatanov
2016-09-21 15:07     ` Adam Sjøgren
     [not found]     ` <mailman.2753.1474470506.22741.info-gnus-english@gnu.org>
2016-09-22  7:19       ` Loris Bennett
2016-09-22  8:26         ` Adam Sjøgren
     [not found]         ` <mailman.2806.1474532810.22741.info-gnus-english@gnu.org>
2016-09-22  9:39           ` Loris Bennett
2016-09-22 10:36             ` Adam Sjøgren
2016-09-22 12:06             ` Ted Zlatanov
2016-09-22 14:39               ` Loris Bennett
2016-09-22 12:07       ` Ted Zlatanov

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