diff --git a/webmail/api.go b/webmail/api.go index b6f37fa..f7ad092 100644 --- a/webmail/api.go +++ b/webmail/api.go @@ -135,6 +135,7 @@ type Attachment struct { // File name based on "name" attribute of "Content-Type", or the "filename" // attribute of "Content-Disposition". + // todo: decode non-ascii character sets Filename string Part message.Part diff --git a/webmail/api.json b/webmail/api.json index abeac44..7663876 100644 --- a/webmail/api.json +++ b/webmail/api.json @@ -1954,7 +1954,7 @@ }, { "Name": "Filename", - "Docs": "File name based on \"name\" attribute of \"Content-Type\", or the \"filename\" attribute of \"Content-Disposition\".", + "Docs": "File name based on \"name\" attribute of \"Content-Type\", or the \"filename\" attribute of \"Content-Disposition\". todo: decode non-ascii character sets", "Typewords": [ "string" ] diff --git a/webmail/api.ts b/webmail/api.ts index c6a50ae..6c80836 100644 --- a/webmail/api.ts +++ b/webmail/api.ts @@ -322,7 +322,7 @@ export interface MessageEnvelope { // viewable text or HTML part. export interface Attachment { Path?: number[] | null // Indices into top-level message.Part.Parts. - Filename: string // File name based on "name" attribute of "Content-Type", or the "filename" attribute of "Content-Disposition". + Filename: string // File name based on "name" attribute of "Content-Type", or the "filename" attribute of "Content-Disposition". todo: decode non-ascii character sets Part: Part } diff --git a/webmail/message.go b/webmail/message.go index 5ff23cb..b089a3f 100644 --- a/webmail/message.go +++ b/webmail/message.go @@ -212,6 +212,7 @@ func parsedMessage(log *mlog.Log, m store.Message, state *msgState, full, msgite disp, params, err := mime.ParseMediaType(cp) log.Check(err, "parsing content-disposition", mlog.Field("cp", cp)) if strings.EqualFold(disp, "attachment") { + // todo: should we be decoding these names? i've seen messages with regular q-word style mime-encoding, not the one specified in ../rfc/2231:210 name := p.ContentTypeParams["name"] if name == "" { name = params["filename"]