Skip to content

net/mail: fails to escape address #11294

Closed
@dvyukov

Description

@dvyukov

The following program fails with the panic:

package main

import (
    "fmt"
    "net/mail"
)

func main() {
    data := "=??Q? ?=<0@0>"
    addr, err := mail.ParseAddress(data)
    if err != nil {
        return
    }
    _, err = mail.ParseAddress(addr.String())
    if err != nil {
        fmt.Printf("failed to parse addr: %q -> %q\n", data, addr)
        panic(err)
    }
}
failed to parse addr: "=??Q? ?=<0@0>" -> "\"=??Q? ?=\" <0@0>"
panic: mail: missing word in phrase: charset not supported: ""

That name should have been escaped.

go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions