mirror of
https://github.com/decke/smtprelay.git
synced 2025-12-26 01:42:29 -07:00
Introduce VERSION to be able to identify ourselves
This commit is contained in:
11
main.go
11
main.go
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"crypto/tls"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
@@ -15,6 +16,10 @@ import (
|
||||
"github.com/vharitonsky/iniflags"
|
||||
)
|
||||
|
||||
const (
|
||||
VERSION = "1.0.2-dev"
|
||||
)
|
||||
|
||||
var (
|
||||
logFile = flag.String("logfile", "/var/log/smtpd-proxy.log", "Path to logfile")
|
||||
hostName = flag.String("hostname", "localhost.localdomain", "Server hostname")
|
||||
@@ -26,6 +31,7 @@ var (
|
||||
remoteHost = flag.String("remote_host", "smtp.gmail.com:587", "Outgoing SMTP server")
|
||||
remoteUser = flag.String("remote_user", "", "Username for authentication on outgoing SMTP server")
|
||||
remotePass = flag.String("remote_pass", "", "Password for authentication on outgoing SMTP server")
|
||||
versionInfo= flag.Bool("version", false, "Show version information")
|
||||
)
|
||||
|
||||
func handler(peer smtpd.Peer, env smtpd.Envelope) error {
|
||||
@@ -52,6 +58,11 @@ func main() {
|
||||
|
||||
iniflags.Parse()
|
||||
|
||||
if *versionInfo {
|
||||
fmt.Printf("smtpd-proxy/%s\n", VERSION)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
logwriter := io.Writer(os.Stdout)
|
||||
|
||||
if *logFile != "" {
|
||||
|
||||
Reference in New Issue
Block a user