Make MailHog sendmail a shortcut to mhsendmail for #45

This commit is contained in:
Ian Kent 2015-05-26 22:58:57 +01:00
parent 3f4eeae146
commit 9dc6ad8ed4
3 changed files with 22 additions and 0 deletions

View file

@ -14,6 +14,7 @@ fmt:
deps:
go get github.com/mailhog/MailHog-Server
go get github.com/mailhog/MailHog-UI
go get github.com/mailhog/mhsendmail
cd ../MailHog-UI; make bindata
go get github.com/mailhog/http
go get github.com/ian-kent/go-log/log

View file

@ -48,6 +48,16 @@ MailHog is an email testing tool for developers:
* Lightweight and portable
* No installation required
#### sendmail
[mhsendmail](https://github.com/mailhog/mhsendmail) is a sendmail replacement for MailHog.
It redirects mail to MailHog using SMTP.
You can also use `MailHog sendmail ...` instead of the separate mhsendmail binary.
#### Web UI
![Screenshot of MailHog web interface](/docs/MailHog.png "MailHog web interface")
### Contributing

11
main.go
View file

@ -15,6 +15,7 @@ import (
cfgui "github.com/mailhog/MailHog-UI/config"
"github.com/mailhog/MailHog-UI/web"
"github.com/mailhog/http"
"github.com/mailhog/mhsendmail/cmd"
)
var apiconf *cfgapi.Config
@ -30,6 +31,16 @@ func configure() {
}
func main() {
if len(os.Args) > 1 && os.Args[1] == "sendmail" {
args := os.Args
os.Args = []string{args[0]}
if len(args) > 2 {
os.Args = append(os.Args, args[2:]...)
}
cmd.Go()
return
}
configure()
exitCh = make(chan int)