Documentation ¶
Overview ¶
Package smtp provides SMTP server of the Bridge.
Index ¶
Constants ¶
View Source
const ( FieldPMScheme = "X-PM-SCHEME" FieldPMEncrypt = "X-PM-ENCRYPT" FieldPMSign = "X-PM-SIGN" FieldPMMIMEType = "X-PM-MIMETYPE" )
Variables ¶
This section is empty.
Functions ¶
func NewSMTPBackend ¶
func NewSMTPBackend( panicHandler panicHandler, eventListener listener.Listener, preferences *config.Preferences, bridge *bridge.Bridge, ) *smtpBackend
NewSMTPBackend returns struct implementing go-smtp/backend interface.
Types ¶
type ContactMetadata ¶
type ContactMetadata struct { Email string Keys []string Scheme string Sign bool SignIsSet bool Encrypt bool MIMEType string }
func GetContactMetadataFromVCards ¶
func GetContactMetadataFromVCards(cards []pmapi.Card, email string) (contactMeta *ContactMetadata, err error)
type SendPreferences ¶
type SendPreferences struct { // Encrypt indicates whether the email should be encrypted or not. // If it's encrypted, we need to know which public key to use. Encrypt bool // Sign indicates whether the email should be signed or not. Sign bool // Scheme indicates if we should encrypt body and attachments separately and // what MIME format to give the final encrypted email. The two standard PGP // schemes are PGP/MIME and PGP/Inline. However we use a custom scheme for // internal emails (including the so-called encrypted-to-outside emails, // which even though meant for external users, they don't really get out of // our platform). If the email is sent unencrypted, no PGP scheme is needed. Scheme pmapi.PackageFlag // MIMEType is the MIME type to use for formatting the body of the email // (before encryption/after decryption). The standard possibilities are the // enriched HTML format, text/html, and plain text, text/plain. But it's // also possible to have a multipart/mixed format, which is typically used // for PGP/MIME encrypted emails, where attachments go into the body too. // Because of this, this option is sometimes called MIME format. MIMEType string // PublicKey contains an OpenPGP key that can be used for encryption. PublicKey *crypto.KeyRing }
SendPreferences contains information about how to handle a message. It is derived from contact data, api key data, mail settings and composer preferences.
Click to show internal directories.
Click to hide internal directories.