Skip to content

Commit

Permalink
upgrade to match mbox lib
Browse files Browse the repository at this point in the history
  • Loading branch information
aerth committed Apr 23, 2017
1 parent d54da03 commit fa87f05
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions 00-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,13 @@ func setup() *Cosgo {
if *sendgridKey != "" {
*mboxfile = os.DevNull
}

// Open mbox or dev/null
f, ferr := os.OpenFile(*mboxfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600)
if ferr != nil {
log.Printf("error opening file: %v", ferr)
log.Fatal("Hint: touch ./cosgo.mbox, or chown/chmod it so that the cosgo process can access it.")
os.Exit(1)
}
mbox.Destination = cosgo.Destination
mbox.Open(*mboxfile)

// Set destination email for mbox and sendgrid
if *dest != "" {
cosgo.Destination = *dest
}
mbox.Destination = cosgo.Destination
mbox.Mail = f

go fortuneInit() // Spin fortunes

Expand Down

0 comments on commit fa87f05

Please sign in to comment.