mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +03:00
add todo's about mime header parameter decoding
not sure what the correct approach is, would need to analyze email archive for practices.
This commit is contained in:
parent
f87f286b80
commit
79774c15ec
4 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
]
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue