Documentation ¶
Overview ¶
Package message contains set of tools to convert message between Proton API and IMAP format.
Index ¶
- Constants
- Variables
- func BuildRFC822(kr *crypto.KeyRing, msg proton.Message, attData [][]byte, opts JobOptions) ([]byte, error)
- func BuildRFC822Into(kr *crypto.KeyRing, msg proton.Message, attData [][]byte, opts JobOptions, ...) error
- func HeaderLines(header []byte) [][]byte
- func SanitizeMessageDate(msgTime int64) time.Time
- type Attachment
- type Body
- type JobOptions
- type MIMEBody
- type Message
Constants ¶
View Source
const InternalIDDomain = `protonmail.internalid`
InternalIDDomain is used as a placeholder for reference/message ID headers to improve compatibility with various clients.
Variables ¶
View Source
var ( ErrDecryptionFailed = errors.New("message could not be decrypted") ErrNoSuchKeyRing = errors.New("the keyring to decrypt this message could not be found") )
Functions ¶
func BuildRFC822 ¶
func BuildRFC822Into ¶ added in v3.1.0
func HeaderLines ¶
HeaderLines returns each line in the given header.
func SanitizeMessageDate ¶
SanitizeMessageDate will return time from msgTime timestamp. If timestamp is not after epoch the RFC822 publish day will be used. No message should realistically be older than RFC822 itself.
Types ¶
type Attachment ¶
type JobOptions ¶
type JobOptions struct { IgnoreDecryptionErrors bool // Whether to ignore decryption errors and create a "custom message" instead. SanitizeDate bool // Whether to replace all dates before 1970 with RFC822's birthdate. AddInternalID bool // Whether to include MessageID as X-Pm-Internal-Id. AddExternalID bool // Whether to include ExternalID as X-Pm-External-Id. AddMessageDate bool // Whether to include message time as X-Pm-Date. AddMessageIDReference bool // Whether to include the MessageID in References. }
type Message ¶
type Message struct { MIMEBody MIMEBody RichBody Body PlainBody Body Attachments []Attachment MIMEType rfc822.MIMEType IsReply bool Subject string Sender *mail.Address ToList []*mail.Address CCList []*mail.Address BCCList []*mail.Address ReplyTos []*mail.Address References []string ExternalID string InReplyTo string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.