Skip to content

Commit

Permalink
fix #2108
Browse files Browse the repository at this point in the history
Send Message-ID even if DKIM is not enabled, for compatibility with Gmail:

* A workaround for Ergo 2.12.0 is to enable DKIM
* You need to enable either DKIM or SPF (preferably both) to send to Gmail anyway
* You also need forward-confirmed reverse DNS, which can be tricky for IPv6...
  • Loading branch information
slingamn committed Dec 21, 2023
1 parent b1a0e7c commit e11bda6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions irc/email/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ func ComposeMail(config MailtoConfig, recipient, subject string) (message bytes.
dkimDomain := config.DKIM.Domain
if dkimDomain != "" {
fmt.Fprintf(&message, "Message-ID: <%s@%s>\r\n", utils.GenerateSecretKey(), dkimDomain)
} else {
// #2108: send Message-ID even if dkim is not enabled
fmt.Fprintf(&message, "Message-ID: <%s-%s>\r\n", utils.GenerateSecretKey(), config.Sender)
}
fmt.Fprintf(&message, "Date: %s\r\n", time.Now().UTC().Format(time.RFC1123Z))
fmt.Fprintf(&message, "Subject: %s\r\n", subject)
Expand Down

0 comments on commit e11bda6

Please sign in to comment.