Merge branch 'main' into expose-mta
This commit is contained in:
@@ -82,7 +82,7 @@ func (b *Bot) initCommands() commandList {
|
|||||||
{
|
{
|
||||||
key: roomOptionNoSend,
|
key: roomOptionNoSend,
|
||||||
description: fmt.Sprintf(
|
description: fmt.Sprintf(
|
||||||
"Get or set `%s` of the room (`true` - enable email sending; `false` - disable email sending)",
|
"Get or set `%s` of the room (`true` - disable email sending; `false` - enable email sending)",
|
||||||
roomOptionNoSend,
|
roomOptionNoSend,
|
||||||
),
|
),
|
||||||
sanitizer: utils.SanitizeBoolString,
|
sanitizer: utils.SanitizeBoolString,
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ func NewServer(cfg *Config) *Server {
|
|||||||
s.ReadTimeout = 10 * time.Second
|
s.ReadTimeout = 10 * time.Second
|
||||||
s.WriteTimeout = 10 * time.Second
|
s.WriteTimeout = 10 * time.Second
|
||||||
s.MaxMessageBytes = cfg.MaxSize * 1024 * 1024
|
s.MaxMessageBytes = cfg.MaxSize * 1024 * 1024
|
||||||
s.EnableREQUIRETLS = cfg.TLSRequired
|
|
||||||
s.AllowInsecureAuth = !cfg.TLSRequired
|
s.AllowInsecureAuth = !cfg.TLSRequired
|
||||||
|
s.EnableREQUIRETLS = cfg.TLSRequired
|
||||||
|
s.EnableSMTPUTF8 = true
|
||||||
if log.GetLevel() == "DEBUG" || log.GetLevel() == "TRACE" {
|
if log.GetLevel() == "DEBUG" || log.GetLevel() == "TRACE" {
|
||||||
s.Debug = os.Stdout
|
s.Debug = os.Stdout
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,10 @@ func (e *Email) Compose(privkey string) string {
|
|||||||
var data strings.Builder
|
var data strings.Builder
|
||||||
|
|
||||||
domain := strings.SplitN(e.From, "@", 2)[1]
|
domain := strings.SplitN(e.From, "@", 2)[1]
|
||||||
|
|
||||||
|
data.WriteString("Content-Type: text/plain; charset=\"UTF-8\"")
|
||||||
|
data.WriteString("\r\n")
|
||||||
|
|
||||||
data.WriteString("From: ")
|
data.WriteString("From: ")
|
||||||
data.WriteString(e.From)
|
data.WriteString(e.From)
|
||||||
data.WriteString("\r\n")
|
data.WriteString("\r\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user