aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/fetch.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-09-21 00:27:58 +0200
committerRobin Jarry <robin@jarry.cc>2022-09-25 11:54:23 +0200
commite5b0725824ac9ccf218732238e4b3b525fa6ad46 (patch)
tree54ae2d8ea02616c32a74a3d4fcfb3dce50d1c376 /worker/imap/fetch.go
parent41822a6123d5b6779be436d738bf26747de87b0a (diff)
downloadaerc-e5b0725824ac9ccf218732238e4b3b525fa6ad46.tar.gz
charset: handle unknown charsets more user-friendly
Do not throw an error when the charset is unknown; the message entity can still be read, but log the error instead. Reported-by: falsifian Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/imap/fetch.go')
-rw-r--r--worker/imap/fetch.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go
index f21c6e91..d675ed17 100644
--- a/worker/imap/fetch.go
+++ b/worker/imap/fetch.go
@@ -123,7 +123,10 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart(
part, err := message.New(message.Header{Header: h},
_msg.GetBody(&partBodySection))
- if err != nil {
+ if message.IsUnknownCharset(err) {
+ logging.Warnf("unknown charset encountered "+
+ "for uid %d", _msg.Uid)
+ } else if err != nil {
return fmt.Errorf("failed to create message reader: %w", err)
}