email

package
v0.9.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Address

func Address(email string) string

Address gets email address from a valid email address notation (eg: "Jane Doe" <jane@example.com> -> jane@example.com)

func AddressList

func AddressList(emailList string) []string

Address gets email address from a valid email address notation (eg: "Jane Doe" <jane@example.com>, john.doe@example.com -> jane@example.com, john.doe@example.com)

func AddressValid

func AddressValid(email string) bool

AddressValid checks if email address is valid

func MessageID

func MessageID(eventID id.EventID, domain string) string

MessageID generates email Message-Id from matrix event ID

Types

type ContentOptions

type ContentOptions struct {
	// On/Off
	CC        bool
	Sender    bool
	Recipient bool
	Subject   bool
	HTML      bool
	Threads   bool
	Threadify bool

	// Keys
	MessageIDKey  string
	InReplyToKey  string
	ReferencesKey string
	SubjectKey    string
	FromKey       string
	ToKey         string
	CcKey         string
	RcptToKey     string
}

ContentOptions represents settings that specify how an email is to be converted to a Matrix message

type Email

type Email struct {
	Date        string
	MessageID   string
	InReplyTo   string
	References  string
	From        string
	To          string
	RcptTo      string
	CC          []string
	Subject     string
	Text        string
	HTML        string
	Files       []*utils.File
	InlineFiles []*utils.File
}

Email object

func FromEnvelope

func FromEnvelope(rcptto string, envelope *enmime.Envelope) *Email

FromEnvelope constructs Email object from envelope

func New

func New(messageID, inReplyTo, references, subject, from, to, rcptto, cc, text, html string, files, inline []*utils.File) *Email

New constructs Email object

func (*Email) Compose

func (e *Email) Compose(privkey string) string

Compose converts the email object to a string (to be used for delivery via SMTP) and possibly DKIM-signs it

func (*Email) Content

func (e *Email) Content(threadID id.EventID, options *ContentOptions) *event.Content

Content converts the email object to a Matrix event content

func (*Email) ContentBody added in v0.9.17

func (e *Email) ContentBody(threadID id.EventID, options *ContentOptions) *event.Content

ContentBody converts the email object to a Matrix event content that contains email body only NOTE: returns nil if threadify is disabled

func (*Email) Mailbox

func (e *Email) Mailbox(incoming bool) string

Mailbox returns postmoogle's mailbox, parsing it from FROM (if incoming=false) or TO (incoming=true)

type IncomingFilteringOptions

type IncomingFilteringOptions interface {
	SpamcheckDKIM() bool
	SpamcheckSMTP() bool
	SpamcheckSPF() bool
	SpamcheckMX() bool
	Spamlist() []string
}

IncomingFilteringOptions for incoming mail

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL