aboutsummaryrefslogtreecommitdiff
path: root/imap.go
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-09 13:45:15 +0100
committerSimon Ser <contact@emersion.fr>2019-12-09 13:45:15 +0100
commit61ffc105fd8480b0af4151e3fadb0751d38bea82 (patch)
tree352011041a9c9e6a4db3b8ed8a072e5c117bc7b3 /imap.go
parentd1d43809577f85d2feec4bc61601ca9ade378b5b (diff)
downloadalps-61ffc105fd8480b0af4151e3fadb0751d38bea82.tar.gz
alps-61ffc105fd8480b0af4151e3fadb0751d38bea82.zip
Use imap.BodyStructure.Filename and imap.Address.Address
The former fixes encoding issues in filenames. The latter is just for brevity.
Diffstat (limited to 'imap.go')
-rw-r--r--imap.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/imap.go b/imap.go
index 9081689..0e0edc1 100644
--- a/imap.go
+++ b/imap.go
@@ -174,10 +174,7 @@ func imapPartTree(bs *imap.BodyStructure, path []int) *IMAPPartNode {
path = []int{1}
}
- var filename string
- if strings.EqualFold(bs.Disposition, "attachment") {
- filename = bs.DispositionParams["filename"]
- }
+ filename, _ := bs.Filename()
node := &IMAPPartNode{
Path: path,