Send as webhook.me.uk, add favicon, share image and SEO tags

Mail now comes from no-reply@webhook.me.uk (DKIM, SPF and DMARC are
set up for it) and the Message-ID uses that domain instead of the
container hostname. The landing page gets a favicon, an Open Graph
image, canonical/OG/Twitter/JSON-LD tags, robots.txt that keeps
crawlers off email URLs, and a sitemap. Footer links to dixon.cx.
This commit is contained in:
Andy Dixon
2026-09-22 08:50:20 +01:00
parent 07701ba9cd
commit 680bfac014
11 changed files with 68 additions and 11 deletions
+3 -2
View File
@@ -6,12 +6,13 @@ import (
"mime/quotedprintable"
"net/smtp"
"os"
"strings"
"time"
)
var (
smtpAddr = envOr("SMTP_ADDR", "127.0.0.1:25")
mailFrom = envOr("MAIL_FROM", "no-reply@dixon.cx")
mailFrom = envOr("MAIL_FROM", "no-reply@webhook.me.uk")
)
// sendMail is a variable so tests can capture messages instead of sending them.
@@ -43,7 +44,7 @@ func smtpSend(to, subject, htmlBody string) error {
}
func buildMessage(to, subject, htmlBody string) []byte {
host, _ := os.Hostname()
host := mailFrom[strings.LastIndex(mailFrom, "@")+1:]
var b []byte
b = fmt.Appendf(b, "From: Webhook Call <%s>\r\n", mailFrom)
b = fmt.Appendf(b, "To: <%s>\r\n", to)