Documentation ¶
Overview ¶
Package smtp provides SMTP server of the Bridge.
Index ¶
- Constants
- func NewSMTPBackend(eventListener listener.Listener, users *users.Users, bccSelf bool) *smtpBackend
- type ContactMetadata
- type SendPreferences
- type Server
- func (s *Server) Address() string
- func (s *Server) Close()
- func (s *Server) DebugClient() bool
- func (s *Server) DebugServer() bool
- func (s *Server) DisconnectUser(address string)
- func (s *Server) ListenAndServe()
- func (Server) Protocol() serverutil.Protocol
- func (s *Server) Serve(l net.Listener) error
- func (s *Server) SetLoggers(localDebug, remoteDebug io.Writer)
- func (s *Server) StopServe() error
- func (s *Server) TLSConfig() *tls.Config
- func (s *Server) UseSSL() bool
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 ¶
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.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is Bridge SMTP server implementation.
func NewSMTPServer ¶
func NewSMTPServer( debug bool, address string, port int, useSSL bool, tls *tls.Config, smtpBackend goSMTP.Backend, eventListener listener.Listener, ) *Server
NewSMTPServer returns an SMTP server configured with the given options.
func (*Server) DebugClient ¶
func (*Server) DebugServer ¶
func (*Server) DisconnectUser ¶
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
ListenAndServe will run server and all monitors.
func (Server) Protocol ¶
func (Server) Protocol() serverutil.Protocol
func (*Server) SetLoggers ¶
Click to show internal directories.
Click to hide internal directories.