3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-23 04:19:25 +01:00

Merge pull request #945 from slingamn/issue943_smtpdate

fix #943
This commit is contained in:
Shivaram Lingamneni 2020-04-13 10:13:27 -07:00 committed by GitHub
commit b77715eafd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -724,6 +724,7 @@ func (am *AccountManager) dispatchMailtoCallback(client *Client, account string,
if config.DKIM.Domain != "" { if config.DKIM.Domain != "" {
fmt.Fprintf(&message, "Message-ID: <%s@%s>\r\n", utils.GenerateSecretKey(), config.DKIM.Domain) fmt.Fprintf(&message, "Message-ID: <%s@%s>\r\n", utils.GenerateSecretKey(), config.DKIM.Domain)
} }
fmt.Fprintf(&message, "Date: %s\r\n", time.Now().UTC().Format(time.RFC1123Z))
fmt.Fprintf(&message, "Subject: %s\r\n", subject) fmt.Fprintf(&message, "Subject: %s\r\n", subject)
message.WriteString("\r\n") // blank line: end headers, begin message body message.WriteString("\r\n") // blank line: end headers, begin message body
fmt.Fprintf(&message, client.t("Account: %s"), account) fmt.Fprintf(&message, client.t("Account: %s"), account)

View File

@ -37,7 +37,7 @@ var defaultOptions = dkim.SigOptions{
Version: 1, Version: 1,
Canonicalization: "relaxed/relaxed", Canonicalization: "relaxed/relaxed",
Algo: "rsa-sha256", Algo: "rsa-sha256",
Headers: []string{"from", "to", "subject", "message-id"}, Headers: []string{"from", "to", "subject", "message-id", "date"},
BodyLength: 0, BodyLength: 0,
QueryMethods: []string{"dns/txt"}, QueryMethods: []string{"dns/txt"},
AddSignatureTimestamp: true, AddSignatureTimestamp: true,