Open Bug 1709974 Opened 4 years ago Updated 3 years ago

IMAP folder size keeps growing because single message is downloaded and appended repeatedly downloading

Categories

(MailNews Core :: Networking: IMAP, defect)

x86_64
All
defect

Tracking

(Not tracked)

People

(Reporter: benc, Unassigned)

References

Details

Same issue as Bug 1681487, reconsidered after Bug 1702692.

If there is a badly-formed message stored locally, it'll cause nsMsgDBFolder::GetOfflineFileStream to mark it "offline", which re-fetches it from the server rather than trusting the local copy.
This causes an extra local message to be written out each time. For mbox, this means an ever-growing mbox file with multiple redundant copies of the message, and for maildir it means multiple redundant files, eg:

cec331c6-1269-5a52-a618-e2e97b723b69@chartertn.net.eml
cec331c6-1269-5a52-a618-e2e97b723b69@chartertn.net-1.eml
cec331c6-1269-5a52-a618-e2e97b723b69@chartertn.net-2.eml
... etc ...

I don't think there's any way GetOfflineFileStream() can do anything useful about borked messages. The code to mark messages "offline" should be removed, and handled by the calling code.
This probably also goes for the "bad header" check - the calling code has a better knowledge of how to deal with malformed messages.
GetOfflineFileStream() should only skip past "From " and "X-MOZILLA..." pseudo-headers, and leave it at that.
(and even there, there's an argument that the msgStore (mbox/maildir) should deal with all that!)

See Also: → 1602326, 1135434

I've something similar happening with TB 94.0b3 64bit. Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Thunderbird/94.0

I've two different Gmail IMAP accounts set up. In both accounts I see similar behavior. For example when I right click on Inbox and select Properties TB reports size on disk 991 MiB. The actual file @imap.gmail.com/INBOX though is over 2 GB and increasing in real time. TB toolbar at the bottom displays information message "...downloading emails to folder Inbox 8654 of 9000...". When TB finishes downloading all the emails it starts all over again eg "...downloading emails to folder Inbox 1 of 9000...".

I tried removing both accounts, deleting all related email folders in TB profile and adding the two Gmail accounts back. Same problem. Not even sure how to help debug this... But I have to keep TB closed at the moment. I noticed the problem because I ran out of disk space :O

For beta, that was bug 1734843, fixed in b4.

You need to log in before you can comment on or make changes to this bug.