Skip to content

Commit

Permalink
adds imap full charset
Browse files Browse the repository at this point in the history
  • Loading branch information
rwese committed May 30, 2021
1 parent a26cb29 commit da9fc85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions archivar/archiver/archivers/imap/client/imap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/emersion/go-imap"
"github.com/emersion/go-imap/client"
"github.com/emersion/go-message/charset"
"github.com/emersion/go-message/mail"
"github.com/rwese/archivar/archivar/archiver/archivers"
"github.com/rwese/archivar/internal/file"
Expand Down Expand Up @@ -41,6 +42,8 @@ func New(server, username, password, inbox string, allowInsecureSSL bool, logger

i.section = &imap.BodySectionName{}
i.items = []imap.FetchItem{i.section.FetchItem()}
imap.CharsetReader = charset.Reader

return i
}

Expand Down Expand Up @@ -137,14 +140,14 @@ func (i Imap) ProcessMessage(msg imap.Message, upload archivers.UploadFunc) erro
continue
}

file := file.New(
f := file.New(
filename,
filePrefixPath,
p.Body,
nil,
)

if err = upload(file); err != nil {
if err = upload(f); err != nil {
return err
}
}
Expand Down

0 comments on commit da9fc85

Please sign in to comment.