Function same_stream() has bug? Two different POP accounts are the same

[email protected]
Newsgroups gmane.mail.pine.general
Message-ID <[email protected]>

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. I have also two filters, one for account USER_A and the other for
account USER_B. When I access account USER_A pine searches for filter to apply
and it compares stream of opened folder and stream of filter rule. This is
done in function same_stream(). There is a huge condition to compare streams.
For IMAP accounts it checks host, port and username, it's OK. But for POP
account, it simply returns TRUE (the streams are same). Here is the condition

&& (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))

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?

For testing I created two accounts, POP3 protocol, usernames "pine.test1"
and "pine.test2" with password "pinetesting" for both accounts.

Create new incoming folders in this order:

pine.test1 {pop3.seznam.cz:995/ssl/service=pop3/user=pine.test1}INBOX,
pine.test2 {pop3.seznam.cz:995/ssl/service=pop3/user=pine.test2}INBOX

Create filter:

LIT:pattern="/NICK=pine.test2/FLDTYPE=SPEC/FOLDER=pine.test2/STATN=NO"
  action="/FILTER=1/FOLDER=\/root\/mail\/pine.test2/NOKILL=1"

This filter moves read (not new) messages from POP3 account pine.test2 to 
localfile

Now send email to account [email protected] and connect with pine using
this configuration. When you read new message (or mark it as read) in account
pine.test1 and then press "X" to apply filters, message will move from folder
[email protected] to file, ie. the other folder than specified in filter.
And when you check the journal with debug level 7, you can see 

same_stream: name->{pop3.seznam.cz:995/ssl/pop3/user=pine.test2}INBOX ==
stream->{pop3.seznam.cz:995/pop3/ssl/user="pine.test1"}INBOX: yes

Can anyone confirm this?

This problem persists also in pine with Chappa's patch applied although Chappa
adds function same_stream_status() which contains nearly same conditions as
function same_stream(), but conditions (struncmp(mb_n.service, "imap", 4) and
strcmp(imap_host(stream), ".NO-IMAP-CONNECTION.") are deleted. 

There is also comment before function same_stream_status() which says

/* This is the same as same_stream, but it checks for the full stream. Really!
   This function will go away when the pine-team decides to fix same_stream
   to do a similar check to this.
 */

Could you, pine team, please repair the function same_stream()? Until this
function will be corrected, could you Edurado Chappa change all code using
function same_stream() to use function same_stream_status()?


Thank you very much for your work on pine.


Bye.

Robert Wolf.

_______________________________________________
Pine-info mailing list
[email protected]
http://mailman1.u.washington.edu/mailman/listinfo/pine-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.