git » chasquid » commit f5e466e

smtpsrv: Include the mode in the Received header

author Alberto Bertogli
2016-10-13 12:15:00 UTC
committer Alberto Bertogli
2016-10-21 21:18:53 UTC
parent c2d0d5f70554bbb1783462a8bc4b1ae58844cfa1

smtpsrv: Include the mode in the Received header

Including the mode (SMTP/submission) in the Received header can be
useful for troubleshooting transport issues.

internal/smtpsrv/conn.go +2 -2

diff --git a/internal/smtpsrv/conn.go b/internal/smtpsrv/conn.go
index 1031c61..24ba3e2 100644
--- a/internal/smtpsrv/conn.go
+++ b/internal/smtpsrv/conn.go
@@ -50,7 +50,7 @@ type SocketMode string
 // Valid socket modes.
 const (
 	ModeSMTP       SocketMode = "SMTP"
-	ModeSubmission SocketMode = "Submission"
+	ModeSubmission SocketMode = "submission"
 )
 
 // Incoming SMTP connection.
@@ -550,7 +550,7 @@ func (c *Conn) addReceivedHeader() {
 
 	v += fmt.Sprintf("by %s (chasquid)\n", c.hostname)
 
-	v += "(over "
+	v += fmt.Sprintf("(over %s ", c.mode)
 	if c.tlsConnState != nil {
 		v += fmt.Sprintf("%s-%s)\n",
 			tlsconst.VersionName(c.tlsConnState.Version),