mirror of
https://github.com/decke/smtprelay.git
synced 2025-12-26 15:52:28 -07:00
Fix output for "-version" to not contain unneccessary noise
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -188,6 +189,11 @@ func ConfigLoad() {
|
|||||||
// Set up logging as soon as possible
|
// Set up logging as soon as possible
|
||||||
setupLogger()
|
setupLogger()
|
||||||
|
|
||||||
|
if *versionInfo {
|
||||||
|
fmt.Printf("smtprelay/%s (%s)\n", appVersion, buildTime)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
if *remotesStr == "" && *command == "" {
|
if *remotesStr == "" && *command == "" {
|
||||||
log.Warn("no remotes or command set; mail will not be forwarded!")
|
log.Warn("no remotes or command set; mail will not be forwarded!")
|
||||||
}
|
}
|
||||||
|
|||||||
6
main.go
6
main.go
@@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
"os"
|
"os"
|
||||||
@@ -282,11 +281,6 @@ func getTLSConfig() *tls.Config {
|
|||||||
func main() {
|
func main() {
|
||||||
ConfigLoad()
|
ConfigLoad()
|
||||||
|
|
||||||
if *versionInfo {
|
|
||||||
fmt.Printf("smtprelay/%s (%s)\n", appVersion, buildTime)
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.WithField("version", appVersion).
|
log.WithField("version", appVersion).
|
||||||
Debug("starting smtprelay")
|
Debug("starting smtprelay")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user