-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol.go
55 lines (51 loc) · 1.34 KB
/
protocol.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package smtpd
const (
ReplyServiceReady = 220
ReplyServiceClosing = 221
ReplyOK = 250
ReplyDataStart = 354
ReplyUnknown = 500
ReplySyntaxError = 501
ReplyNotImplemented = 502
ReplyBadSequence = 503
ReplyInvalidMailboxSyntax = 553
)
const (
CommandData = "DATA"
CommandEhlo = "EHLO"
CommandExpn = "EXPN"
CommandHelo = "HELO"
CommandHelp = "HELP"
CommandMail = "MAIL"
CommandNoop = "NOOP"
CommandQuit = "QUIT"
CommandRcpt = "RCPT"
CommandRset = "RSET"
CommandSaml = "SAML"
CommandSend = "SEND"
CommandSoml = "SOML"
CommandVrfy = "VRFY"
)
var CommandsMail = []string{
CommandMail,
CommandSaml,
CommandSend,
CommandSoml,
}
func defaultCommands() map[string]commandFactory {
return map[string]commandFactory{
CommandData: factory(newDataCommand),
CommandEhlo: nil,
CommandExpn: nil,
CommandHelo: instanceFactory(&heloCommand{}),
CommandHelp: nil,
CommandMail: instanceFactory(newMailCommand(CommandMail)),
CommandNoop: instanceFactory(&noopCommand{}),
CommandRcpt: instanceFactory(&rcptCommand{}),
CommandRset: instanceFactory(&rsetCommand{}),
CommandSend: instanceFactory(newMailCommand(CommandSend)),
CommandSaml: instanceFactory(newMailCommand(CommandSaml)),
CommandSoml: instanceFactory(newMailCommand(CommandSoml)),
CommandVrfy: nil,
}
}