fix prefix; test attachments; add maxsize

This commit is contained in:
Aine
2022-08-22 20:21:22 +03:00
parent d5cf9a84f5
commit 564cd82c6b
7 changed files with 15 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ func (b *backend) AnonymousLogin(state *smtp.ConnectionState) (smtp.Session, err
return b.newSession(), nil
}
func Start(domain, port, loglevel string, client Client) error {
func Start(domain, port, loglevel string, maxSize int, client Client) error {
log := logger.New("smtp.", loglevel)
be := &backend{
log: log,
@@ -46,7 +46,7 @@ func Start(domain, port, loglevel string, client Client) error {
s.AuthDisabled = true
s.ReadTimeout = 10 * time.Second
s.WriteTimeout = 10 * time.Second
s.MaxMessageBytes = 128 * 1024
s.MaxMessageBytes = maxSize * 1024 * 1024
if log.GetLevel() == "DEBUG" || log.GetLevel() == "TRACE" {
s.Debug = os.Stdout
}