From 477241a2c2356c61b7317246040aee50d2a7a81d Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sat, 2 May 2020 18:51:37 +0200 Subject: WIP: Message-Ids --- pkg/config/config.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg/config') diff --git a/pkg/config/config.go b/pkg/config/config.go index dfd3d0e..993cd71 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -29,7 +29,7 @@ type GlobalOptions struct { var DefaultGlobalOptions = GlobalOptions{ Timeout: 30, MaxFailures: 10, - DefaultEmail: username() + "@" + hostname(), + DefaultEmail: username() + "@" + Hostname(), Target: "", Parts: []string{"text", "html"}, } @@ -120,7 +120,8 @@ func Load(path string) (*Config, error) { return cfg, nil } -func hostname() (hostname string) { +// Hostname returns the current hostname, or 'localhost' if it cannot be determined +func Hostname() (hostname string) { hostname, err := os.Hostname() if err != nil { hostname = "localhost" -- cgit v1.2.3-70-g09d2