diff --git a/imap/imap.go b/imap/imap.go index 261da14..3f7da80 100644 --- a/imap/imap.go +++ b/imap/imap.go @@ -164,7 +164,7 @@ func cmd(s string) string { } func (c *connection) write(s string) { - c.Conn.SetWriteDeadline(time.Now().Add(timeout * time.Second)) + c.Conn.SetWriteDeadline(time.Now().Add(timeout * time.Millisecond)) bytes := []byte(s) n, err := c.Conn.Write(bytes) var desc string diff --git a/unreadMail/unreadMail.go b/unreadMail/unreadMail.go index 3116dc6..379d6c5 100644 --- a/unreadMail/unreadMail.go +++ b/unreadMail/unreadMail.go @@ -20,10 +20,8 @@ func main() { par := &unreadMail.Parameters{*serverPtr, *portPtr, *certPtr, *userPtr, *passwdPtr} mails, errs := unreadMail.FetchPlaintext(par) - if len(errs) > 0 { - for _, err := range errs { - fmt.Fprintln(os.Stderr, err) - } + for _, err := range errs { + fmt.Fprintln(os.Stderr, err) } for _, mail := range mails { fmt.Println(mail)