~rjarry/aerc#129: 
Deal more efficiently with incorrect messages

When showing a maildir folder, if some messages do not adhere to the proper RFC2822 specification, aerc is slowed down, while showing error messages as, for example:

ERROR 2022/12/12 19:22:11.546359 worker.go:466: could not get message info: mail: missing '<' in msg-id
ERROR 2022/12/12 19:22:11.231045 worker.go:466: could not get message info: mail: missing '@' in msg-id
ERROR 2022/12/12 19:18:56.914947 worker.go:466: could not get message info: mail: invalid string

In a maildir account replicated from Gmail using offmap, of a total of >200k messages, I have around 4k messages that trigger those errors. When opening the "all mail" folder, aerc takes quite a lot of time, and the logs says that it is spending over 26s while reporting those errors.

Would it be possible to deal with wrongly specified messages more gracefully?

Status
REPORTED
Submitter
~inwit
Assigned to
No-one
Submitted
a month ago
Updated
a month ago
Labels
No labels applied.

~inwit a month ago

Or maybe those 26s are what it takes for reading the whole set of messages, and would not be reduced if there were no wrongly specified messages?

~inwit a month ago

Update: the errors are reproduced upon events like activating threads, receiving a new email, opening a message, reloading the folder... In those cases, aerc is still responsive while the errors are being dumped to the log, but CPU goes to 100% during the process. Opening a message should not trigger a re-read of the folder, should it?

Register here or Log in to comment, or comment via email.