Re: Function same_stream() has bug? Two different POP accounts are the same
Steve Hubert <[email protected]>
| Newsgroups | gmane.mail.pine.general |
|---|---|
| Organization | Univ of Washington; Computing and Communications; Seattle |
| Message-ID | <[email protected]> |
On Thu, 6 Jul 2006, [email protected] wrote: > Hi PINE team, > > I found some problem with resolution of POP streams. My situation: I have two > POP accounts on the same server with different usernames USER_A and > USER_B. > > [...] > > when the mb_n.service is "pop", it returns TRUE for the same servers, but I > think it should check also username as for IMAP connection does. > > Is it really bug or can you tell me the other reason why filter for account > USER_A applies to folder in account USER_B? Can you please check yourselves > and either update the code or tell me if this is correct functionality of pine > when accessing POP accounts? > > [...] > > Robert Wolf. Thanks for looking into this so thoroughly. Eduardo brought this up a while ago and we never got the courage to make the change. It does seem like a bug, though. We'll put a fix into the next version of pine. Like Eduardo, we are hesitant to make the change. We look at the code and say to ourselves, "We put that test in there for some reason, what was it?". It may be that the reason no longer applies. That's what it looks like. However, it may be that we will rediscover the reason once people start using it. We use so little POP around here that we barely have a place to test it, so we won't likely discover POP problems on our own. The patch is pretty much what Eduardo had in his patch for same_stream_status but the test for the health of the stream should probably be left in. I've attached a patch for pine 4.64. Thanks. Steve _______________________________________________ Pine-info mailing list [email protected] http://mailman1.u.washington.edu/mailman/listinfo/pine-info
patch
(text/plain, 2 KB)
*** pine.c.orig 2006-07-07 12:51:00.000000000 -0700
--- pine.c 2006-07-07 12:57:31.000000000 -0700
***************
*** 4164,4186 ****
|| !strucmp(canonical_name(mb_n.host), mb_s.host))
&& (!mb_n.port || mb_n.port == mb_s.port)
&& mb_n.anoflag == stream->anonymous
! && (struncmp(mb_n.service, "imap", 4)
! ? 1
! : (strcmp(imap_host(stream), ".NO-IMAP-CONNECTION.")
! && ((mb_n.user && *mb_n.user &&
! mb_s.user && !strcmp(mb_n.user, mb_s.user))
! ||
! ((!mb_n.user || !*mb_n.user)
! && mb_s.user
! && ((ps_global->VAR_USER_ID
! && !strcmp(ps_global->VAR_USER_ID, mb_s.user))
! ||
! (!ps_global->VAR_USER_ID
! && ps_global->ui.login[0]
! && !strcmp(ps_global->ui.login, mb_s.user))))
! ||
! (!((mb_n.user && *mb_n.user) || (mb_s.user && *mb_s.user))
! && stream->anonymous))))){
dprint(7, (debugfile, "same_stream: name->%s == stream->%s: yes\n",
name ? name : "?",
(stream && stream->mailbox) ? stream->mailbox : "NULL"));
--- 4164,4184 ----
|| !strucmp(canonical_name(mb_n.host), mb_s.host))
&& (!mb_n.port || mb_n.port == mb_s.port)
&& mb_n.anoflag == stream->anonymous
! && ((mb_n.user && *mb_n.user &&
! mb_s.user && !strcmp(mb_n.user, mb_s.user))
! ||
! ((!mb_n.user || !*mb_n.user)
! && mb_s.user
! && ((ps_global->VAR_USER_ID
! && !strcmp(ps_global->VAR_USER_ID, mb_s.user))
! ||
! (!ps_global->VAR_USER_ID
! && ps_global->ui.login[0]
! && !strcmp(ps_global->ui.login, mb_s.user))))
! ||
! (!((mb_n.user && *mb_n.user) || (mb_s.user && *mb_s.user))
! && stream->anonymous))
! && (struncmp(mb_n.service, "imap", 4) ? 1 : strcmp(imap_host(stream), ".NO-IMAP-CONNECTION."))){
dprint(7, (debugfile, "same_stream: name->%s == stream->%s: yes\n",
name ? name : "?",
(stream && stream->mailbox) ? stream->mailbox : "NULL"));