[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: Bug#45545: marked as done (Mail disappears from inbox) by Carsten Burghardt <cb@magic-shop.de>
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2002-08-09 22:24:22
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 09 August 2002 23:36, Waldo Bastian wrote:
> On Friday 09 August 2002 02:24 pm, Ingo Klöcker wrote:
> > After some more tests I've found that both the mtime of the mbox
> > file and the mtime of the index file are unreliable.
>
> Unreliable in which sense? Does the mtime change or does the mtime
> differ from the time reported by time(0) ? Does KMail rely on time
> running fiorward or does it compare whether times are "the same"?

Do I really have to repeat the whole thread?

When opening a mail folder KMail checks the time of the index file and 
the time of the mbox file. If mtime(mbox) > mtime(index) then KMail 
assumes that the mbox file has been changed after the index was 
written. This means the index and the contents of the mbox file are 
probably out of sync. Therefore KMail will automatically recreate the 
index. So far, everything is o.k.

The problematic situation:
1. /home (or at least ~/Mail) is mounted via NFS.
2. the clock of the NFS server is ahead of the clock of the local 
computer

In this situation it regularly happens that mtime(mbox) (which we get 
with QFileInfo.lastModified()) is the correct time (i.e. the time the 
file really has on the NFS server) while mtime(index) is wrong (it 
seems to be the local time which is earlier than the files real mtime). 
Now
   time(NFS server) > time(local machine)
yields
   mtime(mbox) > mtime(index).
And because of this KMail recreates the index file although it's 
completely unnecessary. But how should KMail know.

Now I had the idea to store mtime(mbox) in the index file. This way we 
would only rely on the correct mtime of the mbox. Unfortunately, my 
tests showed that we also can't rely on the mtime of the mbox because 
in some cases NFS gives us a wrong mtime.

Conclusion, mtimes of files on NFS mounted volumes are not reliable.

Regards,
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9VEEWGnR+RTDgudgRAllwAKCYzdPbNnOcSO98etBkPfZgdwVCZACffbAv
mzMk8+smnbsgoWeUvuyGEJY=
=QoVc
-----END PGP SIGNATURE-----

_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic