func (h *Header) Copy() Header {
	return Header{h.Header.Copy()}
}
Copy creates a stand-alone copy of the header.
package message
import (
	"mime"
	"github.com/emersion/go-message/textproto"
)
func parseHeaderWithParams(s string) (f string, params map[string]string, err error) {
	f, params, err = mime.ParseMediaType(s)
	if err != nil {
		return s, nil, err
	}
	for k, v := range params {
		params[k], _ = decodeHeader(v)
	}
	return
}
func formatHeaderWithParams(f string, params map[string]string) string {
	encParams := make(map[string]string)
	for k, v := range params {
		encParams[k] = encodeHeader(v)
	}
	return mime.FormatMediaType(f, encParams)
}
type HeaderFields interface {
	textproto.HeaderFields
	Text() (string, error)
}
type headerFields struct {
	textproto.HeaderFields
}
func (hf *headerFields) Text() (string, error) {
	return decodeHeader(hf.Value())
}
type Header struct {
	textproto.Header
}
func HeaderFromMap(m map[string][]string) Header {
	return Header{textproto.HeaderFromMap(m)}
}
func (h *Header) ContentType() (t string, params map[string]string, err error) {
	v := h.Get("Content-Type")
	if v == "" {
		return "text/plain", nil, nil
	}
	return parseHeaderWithParams(v)
}
func (h *Header) SetContentType(t string, params map[string]string) {
	h.Set("Content-Type", formatHeaderWithParams(t, params))
}
func (h *Header) ContentDisposition() (disp string, params map[string]string, err error) {
	return parseHeaderWithParams(h.Get("Content-Disposition"))
}
func (h *Header) SetContentDisposition(disp string, params map[string]string) {
	h.Set("Content-Disposition", formatHeaderWithParams(disp, params))
}
func (h *Header) Text(k string) (string, error) {
	return decodeHeader(h.Get(k))
}
func (h *Header) SetText(k, v string) {
	h.Set(k, encodeHeader(v))
}