marking messages as read, bugs and fixes
Earl Fogel
fogel@duke.usask.ca
Thu, 21 Dec 2000 10:30:13 -0600 (CST)
---------------------- multipart/mixed attachment
Hello,
I've run into two bugs in IMP 2.2.3 when talking to a UW-IMAP server.
In the first case, a new empty message continues to be marked as new,
even after you read it in imp. It does get marked as read if you
view the Message Source.
The problem is the BuildMessage function in message.php3, which fetches each
part of the message body from the IMAP server. If a message has no parts,
nothing is retrieved, and the message remains marked as new.
I fixed this by trying to retrieve part 0 of the body in this case.
The second problem is that new messages become marked as read after sorting
a mailbox. I dont' entirely understand why this happens, but did find a
workaround.
I've attached patches for mailbox.php3 and message.php3 to fix these
problems.
Earl Fogel
Computing Services phone: (306) 966-4861
University of Saskatchewan email: earl.fogel@usask.ca
---------------------- multipart/mixed attachment
KioqIG1lc3NhZ2UucGhwMy5kaXN0CVRodSBTZXAgMjEgMDM6MzI6MTMgMjAw
MA0KLS0tIG1lc3NhZ2UucGhwMwlUdWUgRGVjIDE5IDA5OjAyOjQ0IDIwMDAN
CioqKioqKioqKioqKioqKg0KKioqIDg0LDg5ICoqKioNCi0tLSA4NCw5NSAt
LS0tDQogIAlnbG9iYWwgJGltcCwgJGluZGV4LCAkZGVmYXVsdCwgJGxhbmcs
ICR0ZXh0cGFydHMsICRpbWFnZXMsICRhdGM7DQogIAkkaiA9IDA7DQogIAkN
CisgLyoNCisgICogd2UgbmVlZCB0byBnZXQgdGhlIGJvZHkgZXZlbiBpZiB0
aGVyZSBpc24ndCBvbmUsDQorICAqIG9yIHRoZSBtZXNzYWdlIHdvbid0IGJl
IG1hcmtlZCBhcyByZWFkIC0gZWFybA0KKyAgKi8NCisgaWYgKCEkYXR0YWNo
bWVudHMpIHtpbWFwX2ZldGNoYm9keSgkaW1wLT5zdHJlYW0sICRpbmRleCwg
MCwgRlRfVUlEKTt9DQorIA0KICAJcmVzZXQoJGF0dGFjaG1lbnRzKTsNCiAg
CXdoaWxlIChsaXN0KCRyZWYsICRtaW1lKSA9IGVhY2goJGF0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RCksICRhcnJheV9pbmRleCAr
ICRpbXAtPm9mZnNldCArIDEsICRvZmZzZXQsICRhcnJheV9pbmRleCk7DQog
ICAgJGltcC0+bXNnbCA9IGltcGxvZGUoJzonLCAkc29ydGVkKTsNCiAgICAk
aW1wLT5vZmZzZXQgPSAkb2Zmc2V0Ow0K
---------------------- multipart/mixed attachment
KioqIG1haWxib3gucGhwMy5kaXN0CVdlZCBEZWMgIDYgMTY6Mjk6NDYgMjAw
MA0KLS0tIG1haWxib3gucGhwMwlNb24gRGVjIDE4IDE0OjQ4OjI0IDIwMDAN
CioqKioqKioqKioqKioqKg0KKioqIDMzNSwzNDAgKioqKg0KLS0tIDMzNSwz
NDcgLS0tLQ0KICAJCX0NCiAgCX0NCiAgfSBlbHNlIHsNCisgLyoNCisgICog
aWYgd2UgZG9uJ3Qgc2VhcmNoIGZvciBVTlNFRU4sIHRoZW4gc29tZXRpbWVz
IGFsbCBuZXcgbWVzc2FnZXMNCisgICogZ2V0IG1hcmtlZCBhcyByZWFkIGFm
dGVyIGEgc29ydC4gIEJ1dCB0aGVuLCBpZiB3ZSBkb24ndCBzZWFyY2ggZm9y
IEFMTCwgDQorICAqIHNvcnQgYnkgZGF0ZSBpcyBtZXNzZWQgdXAuDQorICAq
Lw0KKyAgICRlYXJsID0gaW1hcF9zZWFyY2goJGltcC0+c3RyZWFtLCAnVU5T
RUVOJyk7CSMgc2VlbXMgdG8gZml4IGEgYnVnDQorICAgJGVhcmwgPSBpbWFw
X3NlYXJjaCgkaW1wLT5zdHJlYW0sICdBTEwnKTsJIyBzZWVtcyB0byBmaXgg
YSBidWcNCiAgICAkYmVnaW4gPSAxOw0KICAgICRlbmQgICA9ICRudW1tc2dz
Ow0KICAgICRwYWdlICA9IDE7DQo=
---------------------- multipart/mixed attachment--