-
Notifications
You must be signed in to change notification settings - Fork 2
/
errors.go
30 lines (25 loc) · 839 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package ulist
import (
"fmt"
"github.com/emersion/go-smtp"
)
// Some RCPT error codes in SMTP
//
// 4xx Temporary errors
// 421 Service is unavailable due to a connection problem
// 450 Requested mail action not taken: mailbox unavailable
// 451 Requested action aborted: local error in processing
// 452 Requested action not taken: insufficient system storage
//
// 5xx Permanent errors
// 550 Requested action not taken: mailbox unavailable
// 552 Requested mail action aborted: exceeded storage allocation
// 554 Transaction failed, maybe spam/blacklisted
var SMTPErrUserNotExist = SMTPErrorf(550, "user not found")
func SMTPErrorf(code int, format string, a ...interface{}) *smtp.SMTPError {
return &smtp.SMTPError{
Code: code,
EnhancedCode: smtp.EnhancedCodeNotSet,
Message: fmt.Sprintf(format, a...),
}
}