A temporary email service written in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
639 B

  1. package main
  2. import (
  3. "flag"
  4. "log"
  5. "github.com/thebaer/burner/auth"
  6. "github.com/thebaer/burner/database"
  7. "github.com/thebaer/burner/mail"
  8. )
  9. var host = flag.String("h", "example.com", "Domain this service lives on.")
  10. func main() {
  11. // Parse configuration flags and validate
  12. flag.Parse()
  13. if *host == "example.com" {
  14. log.Printf("WARNING: Default hostname (example.com) unchanged. Use -h flag to set correct host.")
  15. }
  16. // Connect to database
  17. db, err := database.Open()
  18. if err != nil {
  19. panic(err)
  20. }
  21. defer db.Close()
  22. // TODO: make port numbers configurable
  23. go func() {
  24. auth.Serve(8080)
  25. }()
  26. mail.Serve(*host, 2525)
  27. }