From 0df61d161f98183069494cc349d18f01d8783453 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Tue, 9 May 2017 15:34:30 +0200 Subject: implement PLT-6469 - Send HELO request containing domain name to SMTP server (#6322) --- utils/utils.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'utils/utils.go') diff --git a/utils/utils.go b/utils/utils.go index f34c82f24..038f6ab61 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -6,6 +6,7 @@ package utils import ( "net" "net/http" + "net/url" "os" "github.com/mattermost/platform/model" @@ -66,3 +67,11 @@ func GetIpAddress(r *http.Request) string { return address } + +func GetSiteName(siteURL string) string { + u, err := url.Parse(siteURL) + if err != nil { + return "" + } + return u.Host +} -- cgit v1.2.3-1-g7c22