mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-08 17:51:57 +00:00
Remove the MTA-STS (Strict Transport Security) implementation
This commit removes the experimental MTA-STS (Strict Transport Security) implementation for now, as it's not up to date with the latest draft. Development will continue on the "sts" branch, but this way it won't block releases until it is ready. Commits reverted: -cb6500b993-0eeb964534-e66288e4b4-216cf47ffa-d66b06de51-fe00750e39-933ab54cd8
This commit is contained in:
@@ -2,16 +2,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"flag"
|
||||
"log"
|
||||
"net"
|
||||
"net/smtp"
|
||||
"time"
|
||||
|
||||
"blitiri.com.ar/go/chasquid/internal/spf"
|
||||
"blitiri.com.ar/go/chasquid/internal/sts"
|
||||
"blitiri.com.ar/go/chasquid/internal/tlsconst"
|
||||
|
||||
"golang.org/x/net/idna"
|
||||
@@ -37,21 +34,6 @@ func main() {
|
||||
log.Fatalf("IDNA conversion failed: %v", err)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
log.Printf("=== STS policy")
|
||||
policy, err := sts.UncheckedFetch(ctx, domain)
|
||||
if err != nil {
|
||||
log.Printf("Not available (%s)", err)
|
||||
} else {
|
||||
log.Printf("Parsed contents: [%+v]\n", *policy)
|
||||
if err := policy.Check(); err != nil {
|
||||
log.Fatalf("Invalid: %v", err)
|
||||
}
|
||||
log.Printf("OK")
|
||||
}
|
||||
|
||||
mxs, err := net.LookupMX(domain)
|
||||
if err != nil {
|
||||
log.Fatalf("MX lookup: %v", err)
|
||||
@@ -101,13 +83,6 @@ func main() {
|
||||
c.Close()
|
||||
}
|
||||
|
||||
if policy != nil {
|
||||
if !policy.MXIsAllowed(mx.Host) {
|
||||
log.Fatalf("NOT allowed by STS policy")
|
||||
}
|
||||
log.Printf("Allowed by policy")
|
||||
}
|
||||
|
||||
log.Printf("")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user