Documentation ¶
Index ¶
- Variables
- func AttachPublicKey(p *parser.Parser, key, keyName string)
- func BuildEncrypted(m *pmapi.Message, readers []io.Reader, kr *crypto.KeyRing) ([]byte, error)
- func BuildMIMEBody(p *parser.Parser) (mimeBody string, err error)
- func CustomMessage(m *pmapi.Message, decodeError error, attachBody bool) error
- func GetAttachmentHeader(att *pmapi.Attachment) textproto.MIMEHeader
- func GetBodyHeader(m *pmapi.Message) textproto.MIMEHeader
- func GetBoundary(m *pmapi.Message) string
- func GetEnvelope(m *pmapi.Message) *imap.Envelope
- func GetFlags(m *pmapi.Message) (flags []string)
- func GetHeader(msg *pmapi.Message) textproto.MIMEHeader
- func GetRelatedBoundary(m *pmapi.Message) string
- func GetRelatedHeader(m *pmapi.Message) textproto.MIMEHeader
- func Parse(r io.Reader) (m *pmapi.Message, mimeBody, plainBody string, attReaders []io.Reader, ...)
- func ParseFlags(m *pmapi.Message, flags []string)
- func ParserWithParser(p *parser.Parser) (m *pmapi.Message, plainBody string, attReaders []io.Reader, err error)
- func SeparateInlineAttachments(m *pmapi.Message) (atts, inlines []*pmapi.Attachment)
- func SetBodyContentFields(h *textproto.MIMEHeader, m *pmapi.Message)
- func WriteAttachmentBody(w io.Writer, kr *crypto.KeyRing, m *pmapi.Message, att *pmapi.Attachment, ...) (err error)
- func WriteBody(w io.Writer, kr *crypto.KeyRing, m *pmapi.Message) error
- func WriteHeader(w io.Writer, h textproto.MIMEHeader) (err error)
- type BodyStructure
- func (bs *BodyStructure) GetSection(wholeMail io.ReadSeeker, sectionPath []int) (section []byte, err error)
- func (bs *BodyStructure) GetSectionContent(wholeMail io.ReadSeeker, sectionPath []int) (section []byte, err error)
- func (bs *BodyStructure) GetSectionHeader(sectionPath []int) (header textproto.MIMEHeader, err error)
- func (bs *BodyStructure) IMAPBodyStructure(currentPart []int) (imapBS *imap.BodyStructure, err error)
- func (bs *BodyStructure) Parse(r io.Reader) error
- type Builder
Constants ¶
This section is empty.
Variables ¶
var ( AppleMailJunkFlag = imap.CanonicalFlag("$Junk") ThunderbirdJunkFlag = imap.CanonicalFlag("Junk") ThunderbirdNonJunkFlag = imap.CanonicalFlag("NonJunk") )
nolint[gochecknoglobals]
Functions ¶
func AttachPublicKey ¶ added in v1.5.6
func BuildEncrypted ¶
func BuildMIMEBody ¶ added in v1.5.6
BuildMIMEBody builds mime body from the parser returned by NewParser.
func GetAttachmentHeader ¶
func GetAttachmentHeader(att *pmapi.Attachment) textproto.MIMEHeader
func GetBodyHeader ¶
func GetBodyHeader(m *pmapi.Message) textproto.MIMEHeader
func GetBoundary ¶
func GetEnvelope ¶
func GetHeader ¶
func GetHeader(msg *pmapi.Message) textproto.MIMEHeader
GetHeader builds the header for the message.
func GetRelatedBoundary ¶
func GetRelatedHeader ¶
func GetRelatedHeader(m *pmapi.Message) textproto.MIMEHeader
func Parse ¶
func Parse(r io.Reader) (m *pmapi.Message, mimeBody, plainBody string, attReaders []io.Reader, err error)
Parse parses RAW message.
func ParseFlags ¶
func ParserWithParser ¶ added in v1.5.6
func ParserWithParser(p *parser.Parser) (m *pmapi.Message, plainBody string, attReaders []io.Reader, err error)
ParserWithParser parses message from Parser without building MIME body.
func SeparateInlineAttachments ¶
func SeparateInlineAttachments(m *pmapi.Message) (atts, inlines []*pmapi.Attachment)
func SetBodyContentFields ¶
func SetBodyContentFields(h *textproto.MIMEHeader, m *pmapi.Message)
func WriteAttachmentBody ¶
func WriteHeader ¶
func WriteHeader(w io.Writer, h textproto.MIMEHeader) (err error)
Types ¶
type BodyStructure ¶
type BodyStructure map[string]*sectionInfo
func NewBodyStructure ¶
func NewBodyStructure(reader io.Reader) (structure *BodyStructure, err error)
func (*BodyStructure) GetSection ¶
func (bs *BodyStructure) GetSection(wholeMail io.ReadSeeker, sectionPath []int) (section []byte, err error)
func (*BodyStructure) GetSectionContent ¶
func (bs *BodyStructure) GetSectionContent(wholeMail io.ReadSeeker, sectionPath []int) (section []byte, err error)
func (*BodyStructure) GetSectionHeader ¶
func (bs *BodyStructure) GetSectionHeader(sectionPath []int) (header textproto.MIMEHeader, err error)
func (*BodyStructure) IMAPBodyStructure ¶
func (bs *BodyStructure) IMAPBodyStructure(currentPart []int) (imapBS *imap.BodyStructure, err error)
type Builder ¶
type Builder struct { EncryptedToHTML bool // contains filtered or unexported fields }
Builder for converting PM message to RFC822. Builder will directly write changes to message when fetching or building message.
func NewBuilder ¶
NewBuilder initiated with client and message meta info.
func (*Builder) BuildMessage ¶
func (bld *Builder) BuildMessage() (structure *BodyStructure, message []byte, err error)
BuildMessage converts PM message to body structure (not RFC3501) and bytes of RC822 message. If successful the original PM message will contain decrypted body.
func (*Builder) SuccessfullyDecrypted ¶
SuccessfullyDecrypted is true when message was fetched and decrypted successfully
func (*Builder) WriteAttachmentBody ¶
func (bld *Builder) WriteAttachmentBody(w io.Writer, att *pmapi.Attachment, attReader io.Reader) (err error)
WriteAttachmentBody decrypts and writes the attachments