mailiosmtp

package
v0.0.0-...-5077a15 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// VerdictStatusPass is the verdict status for PASS
	VerdictStatusPass = "PASS"
	// VerdictStatusFail is the verdict status for FAIL
	VerdictStatusFail = "FAIL"
	// VerdictStatusNotAvailable is the verdict status for NOT_AVAILABLE
	VerdictStatusNotAvailable = "NOT_AVAILABLE"
)

Variables

View Source
var (
	// ErrMailWebhookSignatureInvalid is returned when the webhook signature is invalid
	ErrMailWebhookSignatureInvalid = fmt.Errorf("invalid webhook signature")

	// ErrMailFailedSending is returned when the mail sending failed
	ErrMailFailedSending = fmt.Errorf("failed sending mail")

	// ErrMailParsingFailed is returned when the mail parsing failed
	ErrMailParsingFailed = fmt.Errorf("failed parsing mail")
)

Functions

This section is empty.

Types

type Mail

type Mail struct {
	From                 mail.Address        `json:"from"`              // The email address of the original sender.
	ReplyTo              []*mail.Address     `json:"replyTo,omitempty"` // The email address to which bounces (undeliverable notifications) are to be forwarded.
	To                   []mail.Address      `json:"to"`                // The email addresses of the recipients.
	Cc                   []*mail.Address     `json:"cc,omitempty"`      // The email addresses of the CC recipients.
	Bcc                  []*mail.Address     `json:"bcc,omitempty"`     // The email addresses of the BCC recipients.
	MessageId            string              `json:"messageId"`         // message id
	Subject              string              `json:"subject"`
	BodyText             string              `json:"bodyText,omitempty"`       // The text version of the email.
	BodyHTML             string              `json:"bodyHtml,omitempty"`       // The HTML version of the email.
	BodyInlinePart       []*MailBodyRaw      `json:"bodyInlinePart,omitempty"` // The raw inline content of the email.
	Headers              map[string][]string `json:"headers,omitempty"`        // The email headers. (one header can be specified multiple times with different values)
	Attachments          []*SmtpAttachment   `json:"attachments,omitempty"`
	SizeBytes            int64               `json:"sizeBytes"`              // The size of the email in bytes.
	SizeHtmlBodyBytes    int64               `json:"sizeHtmlBodyBytes"`      // The size of the HTML body in bytes.
	SizeInlineBytes      int64               `json:"sizeInlineBytes"`        // The size of the inline content in bytes.
	SizeAttachmentsBytes int64               `json:"sizeAttachmentsBytes"`   // The size of the attachments in bytes.
	Timestamp            int64               `json:"timestamp"`              // since epoch in miliseconds
	SpamVerdict          *VerdictStatus      `json:"spamVerdict,omitempty"`  // optional, spam verdict
	VirusVerdict         *VerdictStatus      `json:"virusVerdict,omitempty"` // optional, virus verdict
	SpfVerdict           *VerdictStatus      `json:"spfVerdict,omitempty"`   // optinal, spf verdict
	DkimVerdict          *VerdictStatus      `json:"dkimVerdict,omitempty"`  // optional, dkim verdict
	DmarcVerdict         *VerdictStatus      `json:"dmarcVerdict"`           // optional, dmarc verdict
}

type MailBodyRaw

type MailBodyRaw struct {
	ContentID          string `json:"contentId,omitempty"`          // The content id of the raw email.
	ContentType        string `json:"contentType"`                  // The content type of the raw email.
	ContentDisposition string `json:"contentDisposition,omitempty"` // The content disposition of the raw email.
	Content            []byte `json:"content"`                      // The raw content of the email.
}

type SmtpAttachment

type SmtpAttachment struct {
	ContentType        string  `json:"contentType"`                  // The content type of the attachment.
	ContentDisposition string  `json:"contentDisposition,omitempty"` // The content disposition of the attachment.
	Filename           string  `json:"filename"`                     // The name of the attachment.
	Content            []byte  `json:"content"`                      // The content of the attachment.
	ContentURL         *string `json:"contentUrl,omitempty"`         // The content uri of the attachment.
	ContentID          string  `json:"contentId,omitempty"`          // The content id of the attachment.
}

type VerdictStatus

type VerdictStatus struct {
	Status string `json:"status" validate:"required,oneof=PASS FAIL NOT_AVAILABLE"` // possible values: PASS, FAIL, NOT_AVAILABLE
}

Jump to

Keyboard shortcuts

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