Stephan Kulow
428dad4a4d
keeping the semantic of setRDict
...
void KMFolder::setRDict(KMMsgDictREntry *rentry) {
- assert(!mRDict);
+ if (rentry == mRDict)
+ return;
+ KMMsgDict::deleteRentry(mRDict);
bool KMMsgDict::removeFolderIds(KMFolder *folder)
{
- KMMsgDictREntry *rentry = folder->rDict();
- if (rentry) {
- folder->setRDict(0);
- delete rentry;
- }
+ folder->setRDict(0);
QString filename = getFolderIdsLocation(folder);
svn path=/trunk/kdenetwork/kmail/; revision=140193
24 years ago
Stephan Kulow
baf8845684
removing some stale memory usages (wouldn't call them leaks)
...
svn path=/trunk/kdenetwork/kmail/; revision=140132
24 years ago
Waldo Bastian
77f2dc529d
Make index files portable across platforms.
...
svn path=/trunk/kdenetwork/kmail/; revision=138151
24 years ago
Malcolm Hunter
6814e78db7
CVS_SILENT Corrected typographical errors
...
svn path=/trunk/kdenetwork/kmail/; revision=132782
25 years ago
Waldo Bastian
6867509cd5
Remove linebreaks from messageboxes.
...
svn path=/trunk/kdenetwork/kmail/; revision=132491
25 years ago
Michael Haeckel
fcb762825b
Use KProcess instead of system, otherwise KMail occasionally freezes for some
...
reason.
svn path=/trunk/kdenetwork/kmail/; revision=131102
25 years ago
Michael Haeckel
27f789ba80
Open the destination folder only once, when moving several message from IMAP
...
to local.
svn path=/trunk/kdenetwork/kmail/; revision=131050
25 years ago
Ingo Klcker
273f4ba53a
Avoid a compiler warning by adding a default to a switch statement
...
svn path=/trunk/kdenetwork/kmail/; revision=130150
25 years ago
Michael Haeckel
9ff395049f
Better support for read only folders. The locally stored messages status is
...
no longer overwritten by the flags on the server and checking for new mails
only reports the really new mails.
svn path=/trunk/kdenetwork/kmail/; revision=130054
25 years ago
Michael Haeckel
cd2280cb20
Use our own hash table instead of QDict. This is much faster and requires
...
much less memory.
Patch by Ronen Tzur <rtzur@shani.net>
svn path=/trunk/kdenetwork/kmail/; revision=129822
25 years ago
Michael Haeckel
a7fe4c0e8b
Touch always the mbox file before writing the index. This way it is sure, that
...
it has always an older date than the index, even if the user changed the clock
or lets KMail running, while it switches itself from daylight savings time to
normal time.
svn path=/trunk/kdenetwork/kmail/; revision=129370
25 years ago
Carsten Burghardt
8a7ec2ba3f
Added support for imap-sets to addMsg, removeMsg, copyMsg and take
...
svn path=/trunk/kdenetwork/kmail/; revision=129294
25 years ago
Harald Fernengel
1e8c919b26
Added "Mark all Mails as read" Action
...
svn path=/trunk/kdenetwork/kmail/; revision=129206
25 years ago
Michael Haeckel
4d3acc97eb
Use unicode and special character save names for the IMAP cache files.
...
svn path=/trunk/kdenetwork/kmail/; revision=128768
25 years ago
Michael Haeckel
8ff17d71db
Display the number of all messages in the outbox, not only those with the
...
queued status.
svn path=/trunk/kdenetwork/kmail/; revision=128570
25 years ago
Ingo Klcker
d77bc08232
- Smart Message-Id generation
...
- Show number of queued messages in outbox
- Open thread if it contains new, unread or _important_ messages
svn path=/trunk/kdenetwork/kmail/; revision=128438
25 years ago
Michael Haeckel
4d6996e796
- Use iso-2022-jp as default Japanese charset instead of euc-jp.
...
- Slightly better support for broken mails without charset header
Thanks to Takumi ASAKI <asataku@osk3.3web.ne.jp>
svn path=/trunk/kdenetwork/kmail/; revision=127974
25 years ago
Carsten Burghardt
d71bba9303
Added support for sets to the setStatus-method for imap-folders.
...
Added a new method setStatus(QValueList<int>, status) to kmfolder
svn path=/trunk/kdenetwork/kmail/; revision=127430
25 years ago
Michael Haeckel
f1c8f60d60
Update the serial numbers correctely, when emtying a folder.
...
Patch by Ronen Tzur <rtzur@shani.net>.
svn path=/trunk/kdenetwork/kmail/; revision=126028
25 years ago
Carsten Burghardt
2acae2c231
Support for configurable Sender/Receiver is now better
...
svn path=/trunk/kdenetwork/kmail/; revision=125536
25 years ago
Carsten Burghardt
9bc7408968
Adds configurable sender/receiver to each folder
...
svn path=/trunk/kdenetwork/kmail/; revision=125247
25 years ago
Michael Haeckel
d106dc8427
Don't loose the automatically set replied flags in IMAP folders after
...
restarting KMail.
Patch by Ronen Tzur <rtzur@shani.net>
svn path=/trunk/kdenetwork/kmail/; revision=125237
25 years ago
Michael Haeckel
32970dbf49
Don't delete the serial number files after reading them and some cleanup.
...
Patch by Ronen Tzur <rtzur@shani.net>
svn path=/trunk/kdenetwork/kmail/; revision=125084
25 years ago
Michael Haeckel
81fd954e5d
Use serial numbers instead of message id for undo.
...
svn path=/trunk/kdenetwork/kmail/; revision=124888
25 years ago
Michael Haeckel
1a0a626a15
Introduce message serial numbers in order to make the context menu in separate
...
reader windows working correctely.
Patch by Ronen Tzur <rtzur@shani.net>
svn path=/trunk/kdenetwork/kmail/; revision=123542
25 years ago
Michael Haeckel
297b1516c4
Make index file recreation O(n) instead of O(n^2). This becomes slow with
...
folders > 30000 messages otherwise.
svn path=/trunk/kdenetwork/kmail/; revision=123023
25 years ago
Michael Haeckel
ed29cf8fc9
Expire old messages from any folder.
...
Patch by Samuel Penn <sam@bifrost.demon.co.uk>.
svn path=/trunk/kdenetwork/kmail/; revision=119556
25 years ago
David Faure
60198e652a
CVS_SILENT fixheaders
...
svn path=/trunk/kdenetwork/kmail/; revision=117511
25 years ago
Dirk Mueller
6797558d5d
356 includes less
...
svn path=/trunk/kdenetwork/kmail/; revision=117339
25 years ago
Michael Haeckel
f532a1d6fb
Don't crash, when moving several messages from an IMAP folder to a local one.
...
svn path=/trunk/kdenetwork/kmail/; revision=115849
25 years ago
Michael Haeckel
afaa128982
Prevent some compiler warnings.
...
svn path=/trunk/kdenetwork/kmail/; revision=114851
25 years ago
Michael Haeckel
82339c4c96
Make moving/copying multiple mails from IMAP to local folders working again
...
correctely.
svn path=/trunk/kdenetwork/kmail/; revision=113902
25 years ago
Michael Haeckel
3053058627
QList -> QPtrList
...
svn path=/trunk/kdenetwork/kmail/; revision=112855
25 years ago
Michael Haeckel
e3127d7f19
Store the IMAP folder also in a KMFolderMgr like the local folders.
...
- Allows easily keeping track of obsolete cache files. These are now cleaned up.
- IMAP folders are now always accesible, not only when already connected.
svn path=/trunk/kdenetwork/kmail/; revision=111641
25 years ago
Don Sanders
80a5c3453d
Fix problem with index file corruption detection. It was returning a lot
...
of false positives.
svn path=/trunk/kdenetwork/kmail/; revision=109794
25 years ago
Kurt Granroth
0b28159da9
Massive commit to include native maildir-style mailboxes support in
...
KMail. To test, create a Child Folder and select "maildir" as the
mailbox type.
svn path=/trunk/kdenetwork/kmail/; revision=109511
25 years ago
Michael Haeckel
afcde8f996
Permanent IMAP header caching.
...
svn path=/trunk/kdenetwork/kmail/; revision=109324
25 years ago
Don Sanders
21474c87be
Disable recently added sanity checking, was necessary due to the
...
incurable insanity of nfs.
svn path=/trunk/kdenetwork/kmail/; revision=107601
25 years ago
Don Sanders
ff043abbf7
Fix problem with local accounts introduced by my last commit.
...
svn path=/trunk/kdenetwork/kmail/; revision=106707
25 years ago
Don Sanders
0a0bb2b8d2
Here's a patch which works towards a couple of goals.
...
The idea is to attempt to prevent mail loss when exceptional
events that KMail was not designed to handle occur.
In order to prevent mail loss when an external application
(like procmail) modifies folder files in ~/Mail I want to
check for an out of date index file everywhere that the
index file is updated which is in three places.
1) When closing (for real) a folder
2) When adding message to a folder
3) When compacting a folder
There's also the possibility that an external program
modifies a folder file but doesn't update its date, making
the kmail index file out of sync with the corresponding
folder file. I want to check for this, and if it occurs
then no longer compact that folder file (disabling
compaction should eliminate the possibility of losing mail
due to an index file being out of sync).
I have two ideas for doing this.
1) Check that the index entry matches the folder file when
a message is selected and if not disable compaction for
that folder (I've done that in the attached patch, it would
be best to prompt the user asking if they want to regnerate
the index file).
2) When compacting check that the index entry matches the
folder file. I'm working on a way to this quickly.
svn path=/trunk/kdenetwork/kmail/; revision=106520
25 years ago
Don Sanders
04a6be9323
Revert undiscussed commit by tanton
...
svn path=/trunk/kdenetwork/kmail/; revision=105335
25 years ago
Don Sanders
e2abc31a31
Added missing resize calls.
...
diff -u -r1.176 kmfolder.cpp
--- kmfolder.cpp 2001/07/07 19:13:07 1.176
+++ kmfolder.cpp 2001/07/08 14:16:04
@@ -1724,7 +1724,8 @@
}
mi = (KMMsgInfo*)mMsgList[idx];
msize = mi->msgSize();
- mtext.resize(msize+2);
+ if (mtext.size() < msize + 2)
+ mtext.resize(msize+2);
folder_offset = mi->folderOffset();
//now we need to find the separator! grr...
@@ -1734,9 +1735,13 @@
rc = errno;
break;
}
+ if (mtext.size() < 20)
+ mtext.resize(20);
fread(mtext.data(), 20, 1, mStream);
if(i <= 0) { //woops we've reached the top of the file, last try..
if(!strncasecmp(mtext.data(), "from ", 5)) {
+ if (mtext.size() < folder_offset)
+ mtext.resize(folder_offset);
if(fseek(mStream, chunk_offset, SEEK_SET) == -1 ||
!fread(mtext.data(), folder_offset, 1, mStream) ||
!fwrite(mtext.data(), folder_offset, 1, tmpfile)) {
@@ -1756,6 +1761,8 @@
}
if(last_crlf != -1) {
int size = folder_offset - (i + last_crlf+1);
+ if (mtext.size() < size)
+ mtext.resize(size);
if(fseek(mStream, i + last_crlf+1, SEEK_SET) == -1 ||
!fread(mtext.data(), size, 1, mStream) ||
!fwrite(mtext.data(), size, 1, tmpfile)) {
svn path=/trunk/kdenetwork/kmail/; revision=105334
25 years ago
Tobias Anton
2c506f40b0
this fixes a crash when parsing a corrupted index file.
...
looked over my mark, but not posted for review because
there's no open smtp i know.
anton at stud dot fbi dot fh-darmstadt dot de
Index: kmfolder.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfolder.cpp,v
retrieving revision 1.175
diff -r1.175 kmfolder.cpp
872a873
> bool conversion_result;
892c893,896
< mi->compat_fromOldIndexString(line, mConvertToUtf8);
---
> // convert from old index file format.
> // TODO: make use of return value from
> // compat_fromOldIndexString (tobias)
> conversion_result = mi->compat_fromOldIndexString(line, mConvertToUtf8);
895a900,902
> // could this be the desired solution? (tobias)
> // if (!conversion_result)
> // break;
Index: kmmsginfo.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmmsginfo.cpp,v
retrieving revision 1.28
diff -r1.28 kmmsginfo.cpp
6a7,8
> #include <kdebug.h>
>
341c343
< void KMMsgInfo::compat_fromOldIndexString(const QCString& str, bool toUtf8)
---
> bool KMMsgInfo::compat_fromOldIndexString(const QCString& str, bool toUtf8)
352a355,368
> // TODO: have stricter checks, e.g. for zero strings
> if (str.length()<263+22)
> {
> kdDebug(5001) << "Index string too short: "
> << str.length()
> << "characters."
> << endl << "using default values." << endl;
> kd->subject = QString();
> kd->from = QString();
> kd->to = QString();
> kd->replyToIdMD5 = QString();
> kd->msgIdMD5 = QString();
> return false;
> }
357,358c373,377
< } else {
< start = offset = str.data() + 37;
---
> }
> else
> {
> QCString midstr;
> start = offset = str.data () + 37;
360,361c379,384
< kd->subject = QString::fromUtf8(str.mid(start - str.data(),
< 100 - (start - offset)), 100 - (start - offset));
---
> midstr = str.mid(start - str.data(), 100 - (start - offset));
> if (!midstr.isNull())
> kd->subject = QString::fromUtf8(midstr,100 - (start - offset));
> else
> kd->subject = QString();
>
364,365c387,392
< kd->from = QString::fromUtf8(str.mid(start - str.data(),
< 50 - (start - offset)), 50 - (start - offset));
---
> midstr = str.mid(start - str.data(), 50 - (start - offset));
> if (!midstr.isNull())
> kd->from = QString::fromUtf8(midstr, 50 - (start - offset));
> else
> kd->from = QString();
>
368,369c395,399
< kd->to = QString::fromUtf8(str.mid(start - str.data(),
< 50 - (start - offset)), 50 - (start - offset));
---
> midstr = str.mid(start - str.data(), 50 - (start - offset));
> if (!midstr.isNull())
> kd->to = QString::fromUtf8(midstr, 50 - (start - offset));
> else
> kd->to = QString();
373a404
> return true;
svn path=/trunk/kdenetwork/kmail/; revision=105260
25 years ago
Don Sanders
6b45aa141a
Don't fsync a KMFolder after everytime addMsg is called.
...
Instead when checking for new mail sync just before expunging the local
account or just before deleting mail from the pop server. I guess syncing
isn't currently as issue for imap.
There is a question of whether/when sync should be called for other
operations such as moving messages between folders.
svn path=/trunk/kdenetwork/kmail/; revision=105142
25 years ago
Don Sanders
c51b01e9b6
More robust handling of upgrading index files corrupted with nulls.
...
svn path=/trunk/kdenetwork/kmail/; revision=105125
25 years ago
Don Sanders
8d1e6dd3fa
Critical bug fix - please move tag.
...
Index file corruption could occur if KMail was killed at a sensitive
stage of folder compaction. This bug was introduced by Sam's patch.
rc = fsync(fileno(tmpfile));
rc |= fclose(tmpfile);
if (!rc) {
+ bool autoCreate = mAutoCreateIndex;
+ _rename(tempName.local8Bit(), location().local8Bit());
writeIndex();
+ writeConfig();
+ mAutoCreateIndex = false;
close(TRUE);
- _rename(tempName.local8Bit(), location().local8Bit());
+ mAutoCreateIndex = autoCreate;
}
svn path=/trunk/kdenetwork/kmail/; revision=103871
25 years ago
Don Sanders
7bae55584e
Possibly improve reliability on unclean shutdown of the operating system.
...
svn path=/trunk/kdenetwork/kmail/; revision=103812
25 years ago
Michael Haeckel
71a665f186
Escape leading dots in foldernames of imap folders.
...
Otherwise KMail claims, it has found mailbox files from a KMail version of a
different univers of the generation after next with version number 135949380,
if the user browes a ~/Mail directory produced from KMail via IMAP and has
hidden folders enabled.
svn path=/trunk/kdenetwork/kmail/; revision=103059
25 years ago
Michael Haeckel
e895b47719
Mailing list IMAP folders work now correctely without loosing the settings.
...
svn path=/trunk/kdenetwork/kmail/; revision=103040
25 years ago
Don Sanders
858d958c03
I've fixed the problem with deleting messages
...
causing trailing "F"s.
Now that Sam's patch has been applied KMMsgInfos store an
offset into an mbox and the length of the message at that
point.
But a problem occurs when a new message is appended to an
mbox. KMail ensures a '\n' separator is appended in the
file to separate the last message in the mbox from the
"From ..." mbox separator that will be inserted for the
new message.
This causing a complication that the last message in the
mbox must have its length updated (otherwise compaction is
messed up).
The patch fixes an exception to the above. If a message at
the end of the mbox is deleted then we don't want to update
the length of the last (undeleted) message in the mbox (as
that length has already been updated earlier when new mail
arrived).
This patch won't fix currently deleted mbox files. I'm not
to sure how bad the corruption it. Hmm, might be bad.
I also noticed that the "revert" variable seems to be set
wrong. It is used to roll back the mbox when a critical
error (like disk space exhausted) occurs. So I fixed that
also.
svn path=/trunk/kdenetwork/kmail/; revision=102830
25 years ago