1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.net.smtp;
19
20
21
22
23
24
25
26
27
28
29
30
31 public final class SMTPCommand
32 {
33
34
35 public static final int HELO = 0;
36 public static final int MAIL = 1;
37 public static final int RCPT = 2;
38 public static final int DATA = 3;
39 public static final int SEND = 4;
40 public static final int SOML = 5;
41 public static final int SAML = 6;
42 public static final int RSET = 7;
43 public static final int VRFY = 8;
44 public static final int EXPN = 9;
45 public static final int HELP = 10;
46 public static final int NOOP = 11;
47 public static final int TURN = 12;
48 public static final int QUIT = 13;
49
50
51
52
53
54 public static final int AUTH = 14 ;
55
56
57
58
59
60 public static final int EHLO = 15 ;
61
62 private static final int _NEXT_ = EHLO + 1;
63
64 public static final int HELLO = HELO;
65 public static final int LOGIN = HELO;
66 public static final int MAIL_FROM = MAIL;
67 public static final int RECIPIENT = RCPT;
68 public static final int SEND_MESSAGE_DATA = DATA;
69 public static final int SEND_FROM = SEND;
70 public static final int SEND_OR_MAIL_FROM = SOML;
71 public static final int SEND_AND_MAIL_FROM = SAML;
72 public static final int RESET = RSET;
73 public static final int VERIFY = VRFY;
74 public static final int EXPAND = EXPN;
75
76
77
78
79 public static final int LOGOUT = QUIT;
80
81
82 private SMTPCommand()
83 {}
84
85 private static final String[] _commands = {
86 "HELO", "MAIL FROM:", "RCPT TO:", "DATA", "SEND FROM:", "SOML FROM:",
87 "SAML FROM:", "RSET", "VRFY", "EXPN", "HELP", "NOOP", "TURN", "QUIT",
88 "AUTH", "EHLO"
89 };
90
91
92 static {
93 if (_commands.length != _NEXT_) {
94 throw new RuntimeException("Error in array definition");
95 }
96 }
97
98
99
100
101
102
103
104
105
106 public static final String getCommand(int command)
107 {
108 return _commands[command];
109 }
110
111 }