1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 01:57:02 +00:00
Files
go-inbucket/inbucketd/inbucketd.go
James Hillyerd 81fea97a90 SMTP server is running with new config engine
Web still not working
2012-10-20 21:36:57 -07:00

52 lines
859 B
Go

/*
This is the inbucket daemon launcher
*/
package main
import (
"flag"
"fmt"
"github.com/jhillyerd/inbucket"
"github.com/jhillyerd/inbucket/smtpd"
"log"
"os"
)
var help = flag.Bool("help", false, "Displays this help")
func main() {
flag.Parse()
if *help {
flag.Usage()
return
}
// Load & Parse config
if flag.NArg() != 1 {
flag.Usage()
os.Exit(1)
}
err := inbucket.LoadConfig(flag.Arg(0))
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to parse config: %v\n", err)
os.Exit(1)
}
log.Println("Logger test")
inbucket.Trace("trace test")
inbucket.Info("info test")
inbucket.Warn("warn test")
inbucket.Error("error test")
// Startup SMTP server
server := smtpd.New()
server.Start()
}
func init() {
flag.Usage = func() {
fmt.Fprintln(os.Stderr, "Usage of inbucketd [options] <conf file>:")
flag.PrintDefaults()
}
}