1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-20 15:07:03 +00:00

chasquid: Use human-readable TLS constants in addReceivedHeader

Make the "Received" header a bit more human-friendly by using the newly
introduced tlsconst package.
This commit is contained in:
Alberto Bertogli
2016-10-01 14:08:43 +01:00
parent 16d9d45e06
commit d97a4047c1

View File

@@ -27,6 +27,7 @@ import (
"blitiri.com.ar/go/chasquid/internal/queue" "blitiri.com.ar/go/chasquid/internal/queue"
"blitiri.com.ar/go/chasquid/internal/set" "blitiri.com.ar/go/chasquid/internal/set"
"blitiri.com.ar/go/chasquid/internal/systemd" "blitiri.com.ar/go/chasquid/internal/systemd"
"blitiri.com.ar/go/chasquid/internal/tlsconst"
"blitiri.com.ar/go/chasquid/internal/trace" "blitiri.com.ar/go/chasquid/internal/trace"
"blitiri.com.ar/go/chasquid/internal/userdb" "blitiri.com.ar/go/chasquid/internal/userdb"
@@ -732,8 +733,9 @@ func (c *Conn) addReceivedHeader() {
v += fmt.Sprintf("by %s (chasquid SMTP) over ", c.hostname) v += fmt.Sprintf("by %s (chasquid SMTP) over ", c.hostname)
if c.tlsConnState != nil { if c.tlsConnState != nil {
v += fmt.Sprintf("TLS (%#x-%#x)\n", v += fmt.Sprintf("%s (%s)\n",
c.tlsConnState.Version, c.tlsConnState.CipherSuite) tlsconst.VersionName(c.tlsConnState.Version),
tlsconst.CipherSuiteName(c.tlsConnState.CipherSuite))
} else { } else {
v += "plain text!\n" v += "plain text!\n"
} }