Documentation ¶
Index ¶
- type EncodingMultipartWriter
- func (w *EncodingMultipartWriter) Close() error
- func (w *EncodingMultipartWriter) WriteAttachedFile(name, mimeType, description string) (io.Writer, error)
- func (w *EncodingMultipartWriter) WriteInlineFile(name, mimeType, description string) (io.Writer, error)
- func (w *EncodingMultipartWriter) WritePGPMIMEVersion() error
- func (w *EncodingMultipartWriter) WritePlainText(text string) (err error)
- type GpgUtility
- type MessageEncrypter
- type MimeEntity
- type MimeMediaType
- type OutgoingMail
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncodingMultipartWriter ¶
type EncodingMultipartWriter struct {
// contains filtered or unexported fields
}
EncodingMultipartWriter contains headers and information needed to write a MIME Multipart message
func NewEncodingMultipartWriter ¶
func NewEncodingMultipartWriter(w io.Writer, multitype, protocol string, extraHeaders map[string]string) *EncodingMultipartWriter
NewEncodingMultipartWriter returns a new encoding multipart writer of the given type writing to w. The multitype can be for example "mixed", "alternative", or "encrypted". Optionally, a protocol for the Content-Type header can be given, for example "application/pgp-encrypted" The writer defines the headers "Mime-Version", "Content-Type" and "Content-Transfer-Encoding". Additional headers can be passed via the extraHeaders field. The extraHeaders field takes precedence.
func (*EncodingMultipartWriter) Close ¶
func (w *EncodingMultipartWriter) Close() error
Close writes the trailing information for an multipartWriter
func (*EncodingMultipartWriter) WriteAttachedFile ¶
func (w *EncodingMultipartWriter) WriteAttachedFile(name, mimeType, description string) (io.Writer, error)
WriteAttachedFile writes a multipart header for an attached file and provides a writer for the file contents
func (*EncodingMultipartWriter) WriteInlineFile ¶
func (w *EncodingMultipartWriter) WriteInlineFile(name, mimeType, description string) (io.Writer, error)
WriteInlineFile writes a multipart header for an inline file and provides a writer for the file contents
func (*EncodingMultipartWriter) WritePGPMIMEVersion ¶
func (w *EncodingMultipartWriter) WritePGPMIMEVersion() error
WritePGPMIMEVersion writes a multipart containing PGP Version information
func (*EncodingMultipartWriter) WritePlainText ¶
func (w *EncodingMultipartWriter) WritePlainText(text string) (err error)
WritePlainText writes the given text as a text/plain segment
type GpgUtility ¶
type GpgUtility interface { CheckMessageSignature(message io.Reader, signature io.Reader, checkedSignerKey gpg.Key) error ReadKey(r io.Reader) (gpg.Key, error) EncryptMessage(output io.Writer, recipient gpg.Key) (plaintext io.WriteCloser, err error) DecryptMessage(message io.Reader) (result io.Reader, err error) DecryptSignedMessage(message io.Reader, output io.Writer, signerKey gpg.Key) error ServerIdentity() string }
GpgUtility is required required to manage signatures and mail encryption
type MessageEncrypter ¶
type MessageEncrypter interface { EncryptMessage(output io.Writer, recipientKey gpg.Key) (plaintext io.WriteCloser, err error) ServerIdentity() string }
MessageEncrypter is a struct able to sign a message and encrypt it for the recipient key
type MimeEntity ¶
type MimeEntity struct { Header textproto.MIMEHeader Content []byte Parts []MimeEntity IsAttachment bool SignedBy gpg.Key }
MimeEntity describes a multipart MIME encoded message
func (*MimeEntity) FindAttachment ¶
func (entity *MimeEntity) FindAttachment(mimeType string) ([]byte, error)
FindAttachment returns the first attachment of the given mimeType or an error if none is found.
func (*MimeEntity) GetSender ¶
func (entity *MimeEntity) GetSender() string
GetSender returns the value of the "From" header.
func (*MimeEntity) GetSubject ¶
func (entity *MimeEntity) GetSubject() string
GetSubject returns the value of the "Subject" header.
type MimeMediaType ¶
MimeMediaType describes a Media Type with associated parameters
type OutgoingMail ¶
type OutgoingMail struct { Message string RecipientEmail string RecipientKey gpg.Key Attachment []byte GPG MessageEncrypter }
OutgoingMail describes the contents of the mail to be sent