Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
johnweldon committed Feb 23, 2016
1 parent 6471a69 commit decb1dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
7 changes: 4 additions & 3 deletions cmd/smtp-dispatcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ func usage(message string) {
fmt.Fprintf(os.Stderr, "\n%s\n\n"+
"usage: %s <command>\n"+
" where <command> is one of\n"+
" install, remove, debug, start, stop, pause, or continue.\n\n",
message, os.Args[0])
" install, remove, debug, start, stop, pause, or continue.\n\n"+
" or %s -g to generate the settings file.\n\n",
message, os.Args[0], os.Args[0])
os.Exit(8)
}

func generate() {
buf := `{
"interval": 45,
"interval": 47,
"mailqueue": "c:\\mailqueue",
"badmail": "c:\\badmail",
"connections": {
Expand Down
10 changes: 5 additions & 5 deletions config/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
mqd_smtp "github.com/jw4/mqd/smtp"
)

// SmtpAuthType names smtp authentication methods
type SmtpAuthType string
// SMTPAuthType names smtp authentication methods
type SMTPAuthType string

const (
LoginAuth SmtpAuthType = "LOGIN"
PlainAuth SmtpAuthType = "PLAIN"
LoginAuth SMTPAuthType = "LOGIN"
PlainAuth SMTPAuthType = "PLAIN"
)

// Settings holds the configuration parameters used by the mail queue
Expand Down Expand Up @@ -133,7 +133,7 @@ type ConnectionDetails struct {
Host string `json:"host,omitempty"`
// AuthType shows which authentication mechanism should be used
// when connecting to this Server.
AuthType SmtpAuthType `json:"authtype"`
AuthType SMTPAuthType `json:"authtype"`
// Username of the Sender account.
Username string `json:"username,omitempty"`
// Password of the Sender account.
Expand Down
4 changes: 4 additions & 0 deletions dispatcher/mailqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (q *folderQueue) Process(callbackFn MailQueueCallbackFn) error {
func (q *folderQueue) processItem(fn MailQueueCallbackFn) filepath.WalkFunc {
return func(path string, info os.FileInfo, err2 error) error {
glog.V(2).Infof("processing %q", path)
if info == nil {
glog.Warningf("path not found for %q", path)
return nil
}
if info.IsDir() {
if path == q.mailqueue {
return nil
Expand Down
2 changes: 1 addition & 1 deletion img/GOPHER.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/)
The design is licensed under the Creative Commons 3.0 Attributions license.
Read this article for more details: http://blog.golang.org/gopher

The Go Gopher mascot has been modified for this program.
The Go Gopher mascot has been modified for this program.

0 comments on commit decb1dd

Please sign in to comment.