mirror of
https://github.com/decke/smtprelay.git
synced 2025-12-25 07:43:06 -07:00
Fix code formatting with gofmt -s
This commit is contained in:
13
config.go
13
config.go
@@ -7,8 +7,8 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/vharitonsky/iniflags"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vharitonsky/iniflags"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -47,7 +47,6 @@ func localAuthRequired() bool {
|
||||
return *allowedUsers != ""
|
||||
}
|
||||
|
||||
|
||||
func setupAllowedNetworks() {
|
||||
for _, netstr := range splitstr(*allowedNetsStr, ' ') {
|
||||
baseIP, allowedNet, err := net.ParseCIDR(netstr)
|
||||
@@ -73,7 +72,7 @@ func setupAllowedNetworks() {
|
||||
func setupAllowedPatterns() {
|
||||
var err error
|
||||
|
||||
if (*allowedSenderStr != "") {
|
||||
if *allowedSenderStr != "" {
|
||||
allowedSender, err = regexp.Compile(*allowedSenderStr)
|
||||
if err != nil {
|
||||
log.WithField("allowed_sender", *allowedSenderStr).
|
||||
@@ -82,7 +81,7 @@ func setupAllowedPatterns() {
|
||||
}
|
||||
}
|
||||
|
||||
if (*allowedRecipStr != "") {
|
||||
if *allowedRecipStr != "" {
|
||||
allowedRecipients, err = regexp.Compile(*allowedRecipStr)
|
||||
if err != nil {
|
||||
log.WithField("allowed_recipients", *allowedRecipStr).
|
||||
@@ -92,7 +91,6 @@ func setupAllowedPatterns() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func setupRemoteAuth() {
|
||||
logger := log.WithField("remote_auth", *remoteAuthStr)
|
||||
|
||||
@@ -150,7 +148,7 @@ func splitProto(s string) protoAddr {
|
||||
}
|
||||
return protoAddr{
|
||||
protocol: s[0:idx],
|
||||
address: s[idx+3 : len(s)],
|
||||
address: s[idx+3:],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +162,6 @@ func setupListeners() {
|
||||
"not allowed with non-TLS listener")
|
||||
}
|
||||
|
||||
|
||||
listenAddrs = append(listenAddrs, pa)
|
||||
}
|
||||
}
|
||||
@@ -175,7 +172,7 @@ func ConfigLoad() {
|
||||
// Set up logging as soon as possible
|
||||
setupLogger()
|
||||
|
||||
if (*remoteHost == "") {
|
||||
if *remoteHost == "" {
|
||||
log.Warn("remote_host not set; mail will not be forwarded!")
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ func setupLogger() {
|
||||
log = logrus.New()
|
||||
|
||||
// Handle logfile
|
||||
if (*logFile == "") {
|
||||
if *logFile == "" {
|
||||
log.SetOutput(os.Stderr)
|
||||
} else {
|
||||
writer, err := os.OpenFile(*logFile, os.O_CREATE|os.O_RDWR|os.O_APPEND, 0600)
|
||||
|
||||
Reference in New Issue
Block a user