Merge branch 'develop' of https://github.com/databasus/databasus into develop

This commit is contained in:
Rostislav Dugin
2026-02-01 16:41:52 +03:00
2 changed files with 10 additions and 2 deletions

View File

@@ -52,6 +52,10 @@ func (s *EmailSMTPSender) buildEmailContent(to, subject, body, from string) []by
// Encode Subject header using RFC 2047 to avoid SMTPUTF8 requirement
encodedSubject := encodeRFC2047(subject)
subjectHeader := fmt.Sprintf("Subject: %s\r\n", encodedSubject)
// Get the current time
now := time.Now()
// Generate Date header that is compliant with RFC 5322 using the format from RFC 1123Z
dateHeader := fmt.Sprintf("Date: %s\r\n", now.Format(time.RFC1123Z))
mimeHeaders := fmt.Sprintf(
"MIME-version: 1.0;\nContent-Type: %s; charset=\"%s\";\n\n",
@@ -65,7 +69,7 @@ func (s *EmailSMTPSender) buildEmailContent(to, subject, body, from string) []by
toHeader := fmt.Sprintf("To: %s\r\n", to)
return []byte(fromHeader + toHeader + subjectHeader + mimeHeaders + body)
return []byte(fromHeader + toHeader + subjectHeader + dateHeader + mimeHeaders + body)
}
func (s *EmailSMTPSender) sendImplicitTLS(

View File

@@ -130,6 +130,10 @@ func (e *EmailNotifier) buildEmailContent(heading, message, from string) []byte
// This ensures compatibility with SMTP servers that don't support SMTPUTF8
encodedSubject := encodeRFC2047(heading)
subject := fmt.Sprintf("Subject: %s\r\n", encodedSubject)
// Get the current time
now := time.Now()
// Generate Date header that is compliant with RFC 5322 using the format from RFC 1123Z
dateHeader := fmt.Sprintf("Date: %s\r\n", now.Format(time.RFC1123Z))
mimeHeaders := fmt.Sprintf(
"MIME-version: 1.0;\nContent-Type: %s; charset=\"%s\";\n\n",
@@ -143,7 +147,7 @@ func (e *EmailNotifier) buildEmailContent(heading, message, from string) []byte
toHeader := fmt.Sprintf("To: %s\r\n", e.TargetEmail)
return []byte(fromHeader + toHeader + subject + mimeHeaders + message)
return []byte(fromHeader + toHeader + subject + dateHeader + mimeHeaders + message)
}
func (e *EmailNotifier) sendImplicitTLS(