From 1426376aa595c5c7ca83c8a2d2f50a219335f5ae Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Thu, 22 Feb 2018 22:26:59 -0600 Subject: [PATCH] Added --disable-mailer flag to prevent starting the built-in mailer. Fixes #935 --- gophish.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gophish.go b/gophish.go index aeff3de8..a4cd7c06 100644 --- a/gophish.go +++ b/gophish.go @@ -49,7 +49,8 @@ import ( var ( Logger = log.New(os.Stdout, " ", log.Ldate|log.Ltime|log.Lshortfile) - configPath = kingpin.Flag("config", "Location of config.json.").Default("./config.json").String() + configPath = kingpin.Flag("config", "Location of config.json.").Default("./config.json").String() + disableMailer = kingpin.Flag("disable-mailer", "Disable the mailer (for use with multi-system deployments)").Bool() ) func main() { @@ -70,7 +71,11 @@ func main() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go mailer.Mailer.Start(ctx) + + // Provide the option to disable the built-in mailer + if !*disableMailer { + go mailer.Mailer.Start(ctx) + } // Setup the global variables and settings err = models.Setup() if err != nil {