Closed Bug 225332 Opened 21 years ago Closed 21 years ago

If "Leave Messages on Server"-Check is activated, old messages are downloaded from the Server too (on each Mail check).

Categories

(MailNews Core :: Networking: POP, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: saul, Assigned: ch.ey)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.4) Gecko/20030624

If "Leave Messages on Server"-Check is activated, old messages are downloaded
from the Server too (on each Mail check).

Reproducible: Always

Steps to Reproduce:
1. Open the mail program
2. Open the Edit -> Mail & Newsgroups Account Settings... (for a POP Mail account)
3. Go to "Server settings"
4. Check the option "Leave messages on server". Leave the option check "Delete
messages on server..." unchecked. Click OK.
5. Send a test message to yourself.
6. Click 101 times the "Check new mail" button.

Actual Results:  
Any message leaved on the server will be downloaded any time you check your
pop-mail, so you should have got 101 copies of your test message.

Expected Results:  
Download only the new messages.

Thank you :).
Reporter, I'm not sure if you have "Actual Results" and "Expected Results"
filled out correctly--I wouldn't expect to see "should" in "Actual Results". 
Please clarify.

Assuming I understood what you meant, I believe this is INVALID--Mozilla sees
that the message is on the server, but that it is the same as one already
downloaded.  There is no reason to have 101 copies of some message--the purpose
of storing mail on the server is that it is accessible from multiple
computers/email clients.
The description I gave is correct, except for the word "should". Sorry, I hope
now it is explained a little more clearly.

Actual Results:  
Any message leaved on the server will be downloaded any time you check your
pop-mail, so you DO GET 101 copies of your test message ON THE SAME MAIL CLIENT.
THE MAIL CLIENT DOES NOT MAKE ANY DIFFERENCE BETWEEN NEW AND OLD MESSAGES ON THE
SERVER.
Mozilla DOES NOT SEE that the message is the same as one already downloaded.

Expected Results:  
Download only the new messages.
Mozilla SHOULD see that the message is on the server, but that it is the same as
one already downloaded.

(Using Mozilla 1.5 / Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007)
Saúl, when the user wants to leave messages on the server, we have to keep track
which we already downloaded.
We do this in a file named popstate.dat in you profiles mail folder. Under the
two lines of comment there should be lines with quite mixed looking strings, the
UIDs.

Can you confirm such lines in the popstate.de in your pop servers subfolder
(Profiles\default\1fbirxie.slt\Mail\pop.exasol.com or so)?
I have checked the use of that file:

Before setting the "Leave messages on server" option on, the file has the
following contents:

# POP3 State File
# This is a generated file!  Do not edit.

*pop.exasol.com Saúl
k 3fb0faf000000001
k 3fb0faf000000003
k 3fb0faf000000002

After setting that option on, and sending & recieving a test-message to myself,
a new section was added!!:

# POP3 State File
# This is a generated file!  Do not edit.

*pop.exasol.com Saúl Martínez
k 3fb2465500000001
*pop.exasol.com Saúl
k 3fb0faf000000001
k 3fb0faf000000003
k 3fb2465500000001
k 3fb0faf000000002

After that point, the popstate.dat file stays constant.
Do you changed your login from Saúl to Saúl Martínez in the config for your server?

Do you now receive your test-message again and again if you get messages?

The lines
k 3fb0faf000000001
k 3fb0faf000000003
k 3fb0faf000000002
seem to belong to some older messages. If you switch off the leave on server
option, messages already downloaded in earlier sessions will be deleted (and
their UID in the file with them). So the lines might belong to some older ones
that already have been deleted from the server otherwise.
I can check the option on and off so many times you want. If the "leave messages
on server" is on, then i get all the messages stored in the mail server at every
mail check.

Of course cannot get I the older messages, since they were deleted from the server!.

Can't you reproduce the bug?

Saúl Martínez.
No, I can't reproduce this bug.
The only suspicion I have is your username for the server. This seems to be
"Saúl Martínez", yes? Is it possible for you or your admin to change it to
"SaulMartinez" - so without non-ASCII chars and without spaces?

BTW, your original report said "Windows NT 5.0; de-AT; rv:1.4" and in comment #2
you wrote "Linux i686; en-US; rv:1.5". Did you test on both platforms with both
versions? If so, please set OS to "All".
I think you just get the point.
My mail username is nor Saúl Martínez nor Saul Martinez: thats my *real name*.
My mail username at mail.exasol.com is saul. Compare this info with the data on
the file:

*pop.exasol.com Saúl Martínez
...
*pop.exasol.com Saúl

The data stored on the file is completely incorrect. This may be a bug in the
mail configuration tool? The first time I configured my account I wrote
pop.exasol.com as the mail server, and saul as my account. Then i checked the
right configuration.

To try to reproduce the bug try the following:

1. Install Mail & Newsgroups new
2. Open it for the first time and configure your mail account incorrectly
(choose an incorrect mail server and incorrect user name)
3. Try to download some mail (It will fail)
4. Repair the configuration and try again. Then check the "Leave messages on
server" checkbox.

If this also don't work, you'll have an unresolved bug.
BTW, commenting your comment: 

> your original report said "Windows NT 5.0; de-AT; rv:1.4" and in comment #2
> you wrote "Linux i686; en-US; rv:1.5". Did you test on both platforms with both
> versions? If so, please set OS to "All".

I use the mozilla bugzilla for the first time, so i don't know if a set things
ok in the bug. The version I wrote down is the right one. I haven't tested it
under Windows, sorry.

Again, the real tested version - copied from Help -> About Mozilla:

Mozilla 1.5
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Thanks for your patience.
Saúl.
Ok, I now can confirm your problem and I see the reason for it.

When you create an account, hostname is saved in mail.server.server*.hostname
and the username in mail.server.server*.userName. The last one holds "Saúl
Martínez" what you entered first by mistake.
Any changes following go into realhostname resp. realuserName. The last one
holds "saul" and is used for login aso.

The bug in Mozilla is, that it writes out the username with spaces correctly but
reads it only until the first space. The following compare of "Saúl" with "Saúl
Martínez" doesn't match, so the message is read again a.s.o.

A workaround for you now is to edit your prefs.js (resp. the pref via
about:config) and replace "Saúl Martínez" in the userName pref by saul (you may
delete your popstate.dat then, but it's not necessary). That should remove your
problem until the bug is fixed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
David, what do you think we should do?
I see two possibilities:
1. Escape the username before writing it out, so we won't get spaces in the file.
2. Remove the space from the
     user = nsCRT::strtok(newStr, " \t\r\n", &newStr);
   in nsPop3Protocol.cpp#251
OS: Linux → All
Christian, I think option 2 is fine, assuming it doesn't cause problems
somewhere else.
I didn't even try. But I don't think it will cause problems, I couldn't find a
place where something is written after the username.
But I'll make a patch and do some tests with it.
Attached patch proposed patchSplinter Review
This patch implements fix #2 from comment #11, so that names with space are
read in one piece.
I tested it with and without "Leave messages on server" and with "Until I
delete ..." subpref and it did what it should do.
Attachment #135907 - Flags: superreview?(mscott)
Attachment #135907 - Flags: review+
Attachment #135907 - Flags: superreview?(mscott) → superreview+
-> to me
Assignee: sspitzer → ch.ey
Attachment #135907 - Flags: approval1.6b?
Comment on attachment 135907 [details] [diff] [review]
proposed patch

a=asa (on behalf of drivers) for checkin to 1.6 beta.
Attachment #135907 - Flags: approval1.6b? → approval1.6b+
fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: