diff --git a/config.json b/config.json index c9de72dd..2ccf0715 100644 --- a/config.json +++ b/config.json @@ -1,8 +1,7 @@ { "url" : "localhost:3333", "smtp" : { - "host" : "smtp.example.com", - "port" : 25, + "host" : "smtp.example.com:25", "user" : "username", "pass" : "password" } diff --git a/gophish.go b/gophish.go index 66b397d3..da110080 100644 --- a/gophish.go +++ b/gophish.go @@ -33,18 +33,6 @@ import ( "os" ) -type SMTPServer struct { - Server string `json:"host"` - Port int `json:"port"` - User string `json:"user"` - Password string `json:"password"` -} - -type Config struct { - URL string `json:"url"` - SMTP SMTPServer `json:"smtp"` -} - var config Config func main() { diff --git a/lib/mailer.go b/lib/mailer.go new file mode 100644 index 00000000..8d477c49 --- /dev/null +++ b/lib/mailer.go @@ -0,0 +1,9 @@ +package main + +import ( + "net/smtp" +) + +func Send(email Email, server Server) { + auth = smtp.PlainAuth("", server.User, server.Password, server.Server) +} diff --git a/models.go b/models.go new file mode 100644 index 00000000..759ce13d --- /dev/null +++ b/models.go @@ -0,0 +1,21 @@ +package main + +type SMTPServer struct { + Host string `json:"host"` + User string `json:"user"` + Password string `json:"password"` +} + +type Email struct { + Subject string + Body string + To []string + Bcc []string + Cc []string + From string +} + +type Config struct { + URL string `json:"url"` + SMTP SMTPServer `json:"smtp"` +} diff --git a/route.go b/route.go index a4e3515e..9ae1c9de 100644 --- a/route.go +++ b/route.go @@ -70,7 +70,7 @@ func Base(w http.ResponseWriter, r *http.Request) { } func Base_Campaigns(w http.ResponseWriter, r *http.Request) { - session, _ := store.Get(r, "gophish") + //session, _ := store.Get(r, "gophish") renderTemplate(w, "dashboard") } diff --git a/static/css/main.css b/static/css/main.css index 83b0df99..48f3e29a 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,3 +1,4 @@ + .navbar-logo { margin: 4px 0px; float: left; diff --git a/templates/api_doc.html b/templates/api_doc.html index 849253af..ea514231 100644 --- a/templates/api_doc.html +++ b/templates/api_doc.html @@ -9,13 +9,13 @@
Gophish runs on top of a RESTful API which allows developers to automate phishing campaigns easily. The following documentation and examples demonstrate the API functionality
+Test.
+Gophish runs on top of a RESTful API which allows developers to automate phishing campaigns easily. The following documentation and examples demonstrate the API functionality
+Test.
+