Documentation
¶
Index ¶
- type Backend
- type Config
- type DeliveryWorker
- type Server
- type Session
- func (s *Session) Auth(mech string) (sasl.Server, error)
- func (s *Session) AuthMechanisms() []string
- func (s *Session) AuthPlain(username, password string) error
- func (s *Session) Data(r io.Reader) error
- func (s *Session) Logout() error
- func (s *Session) Mail(from string, opts *smtp.MailOptions) error
- func (s *Session) Rcpt(to string, opts *smtp.RcptOptions) error
- func (s *Session) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements SMTP backend interface
func NewBackend ¶
func NewBackend( userService mailService.UserServiceInterface, messageService mailService.MessageServiceInterface, queueService mailService.QueueServiceInterface, domainRepo repository.DomainRepository, telemetryService *repService.TelemetryService, dkimSigner *dkim.Signer, dkimVerifier *dkim.Verifier, spfValidator *spf.Validator, dmarcEnforcer *dmarc.Enforcer, greylister *greylist.Greylister, rateLimiter *ratelimit.Limiter, adaptiveLimiter *repService.AdaptiveLimiter, bruteForce *bruteforce.Protection, clamav *antivirus.ClamAV, spamAssassin *antispam.SpamAssassin, logger *zap.Logger, ) *Backend
NewBackend creates a new SMTP backend with all dependencies
type Config ¶
type Config struct {
Hostname string
DNSServer string
TLSMode string // "none", "starttls", "tls"
Username string
Password string
InsecureTLS bool
}
Config holds delivery worker configuration
type DeliveryWorker ¶
type DeliveryWorker struct {
// contains filtered or unexported fields
}
DeliveryWorker handles outbound SMTP message delivery
func NewDeliveryWorker ¶
func NewDeliveryWorker( queueService *service.QueueService, domainRepo repository.DomainRepository, messageService service.MessageServiceInterface, mailboxService service.MailboxServiceInterface, userService service.UserServiceInterface, telemetryService *repService.TelemetryService, logger *zap.Logger, config *Config, ) *DeliveryWorker
NewDeliveryWorker creates a new delivery worker
func (*DeliveryWorker) ProcessQueue ¶
func (w *DeliveryWorker) ProcessQueue(ctx context.Context) error
ProcessQueue processes pending queue items
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server manages SMTP server instances
func NewServer ¶
func NewServer(cfg *config.SMTPConfig, tlsCfg *tls.Config, backend *Backend, logger *zap.Logger) *Server
NewServer creates a new SMTP server manager
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents an SMTP session
func (*Session) Auth ¶
Auth creates a SASL server for the specified mechanism This method implements the AuthSession interface to enable AUTH advertisement
func (*Session) AuthMechanisms ¶
AuthMechanisms returns the list of supported authentication mechanisms This method implements the AuthSession interface to enable AUTH advertisement
func (*Session) Mail ¶
func (s *Session) Mail(from string, opts *smtp.MailOptions) error
Mail is called when the client sends MAIL FROM