Documentation
¶
Index ¶
- func GenerateRFC2822MessageID(hostname string) (string, error)
- func HtmlToText(html string) string
- func ParseMime(mime []byte) (*abi.Mail, error)
- func ToBounce(recipient mail.Address, msg abi.Mail, bounceCode string, bounceReason string, ...) ([]byte, error)
- func ToComplaint(recipient mail.Address, reporter mail.Address, msg abi.Mail, ...) ([]byte, error)
- func ToMime(msg *abi.Mail, rfc2822MessageID string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRFC2822MessageID ¶
GenerateMessageID generates and returns a string suitable for an RFC 2822 compliant Message-ID, e.g.: <1444789264909237300.3464.1819418242800517193@DESKTOP01>
The following parameters are used to generate a Message-ID: - The nanoseconds since Epoch - The calling PID - A cryptographically random int64 - The sending hostname
func HtmlToText ¶
func ToBounce ¶
func ToBounce(recipient mail.Address, msg abi.Mail, bounceCode string, bounceReason string, mailhost string) ([]byte, error)
Recommeneded to handle the following bounce reasons: Mailbox Does Not Exist — SMTP Reply Code = 550, SMTP Status Code = 5.1.1 Message Too Large — SMTP Reply Code = 552, SMTP Status Code = 5.3.4 Mailbox Full — SMTP Reply Code = 552, SMTP Status Code = 5.2.2 Message Content Rejected — SMTP Reply Code = 500, SMTP Status Code = 5.6.1 Unknown Failure — SMTP Reply Code = 554, SMTP Status Code = 5.0.0 Temporary Failure — SMTP Reply Code = 450, SMTP Status Code = 4.0.0
where 4.x.x codes are soft bounces, and 5.x..x codes are hard bounces
func ToComplaint ¶
func ToComplaint(recipient mail.Address, reporter mail.Address, msg abi.Mail, complaintReason string, mailhost string) ([]byte, error)
ToComplaint creates a complaint message
Complaints are generated when a recipient reports an email as spam or junk. The recipient's email provider sends a complaint to the custom ESP. The complaint includes the original email that was reported as spam or junk. The complaint also includes information about the recipient who reported the email as spam or junk.
https://en.wikipedia.org/wiki/Abuse_Reporting_Format https://datatracker.ietf.org/doc/html/rfc5965
Types ¶
This section is empty.