View Javadoc

1   /****************************************************************
2    * Licensed to the Apache Software Foundation (ASF) under one   *
3    * or more contributor license agreements.  See the NOTICE file *
4    * distributed with this work for additional information        *
5    * regarding copyright ownership.  The ASF licenses this file   *
6    * to you under the Apache License, Version 2.0 (the            *
7    * "License"); you may not use this file except in compliance   *
8    * with the License.  You may obtain a copy of the License at   *
9    *                                                              *
10   *   http://www.apache.org/licenses/LICENSE-2.0                 *
11   *                                                              *
12   * Unless required by applicable law or agreed to in writing,   *
13   * software distributed under the License is distributed on an  *
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
15   * KIND, either express or implied.  See the License for the    *
16   * specific language governing permissions and limitations      *
17   * under the License.                                           *
18   ****************************************************************/
19  
20  
21  
22  package org.apache.james.dsn;
23  
24  
25  /**
26   * Constants and getters for RFC 3463 Enhanced Mail System Status Codes
27   *
28   */
29  public class DSNStatus {
30      // status code classes
31      /**
32       * Success
33       */
34      public static final int SUCCESS = 2;
35  
36      /**
37       * Persistent Transient Failure
38       */
39      public static final int TRANSIENT = 4;
40  
41      /**
42       * Permanent Failure
43       */
44      public static final int PERMANENT = 5;
45  
46      // subjects and details
47  
48      /**
49       * Other or Undefined Status
50       */
51      public static final int UNDEFINED = 0;
52  
53      /**
54       * Other undefined status
55       */
56      public static final String UNDEFINED_STATUS = "0.0";
57  
58      /**
59       * Addressing Status
60       */
61      public static final int ADDRESS = 1;
62  
63      /**
64       * Other address status
65       */
66      public static final String ADDRESS_OTHER = "1.0";
67  
68      /**
69       * Bad destination mailbox address
70       */
71      public static final String ADDRESS_MAILBOX = "1.1";
72  
73      /**
74       * Bad destination system address
75       */
76      public static final String ADDRESS_SYSTEM = "1.2";
77  
78      /**
79       * Bad destination mailbox address syntax
80       */
81      public static final String ADDRESS_SYNTAX = "1.3";
82  
83      /**
84       * Destination mailbox address ambiguous
85       */
86      public static final String ADDRESS_AMBIGUOUS = "1.4";
87  
88      /**
89       * Destination Address valid
90       */
91      public static final String ADDRESS_VALID = "1.5";
92  
93      /**
94       * Destimation mailbox has moved, no forwarding address
95       */
96      public static final String ADDRESS_MOVED = "1.6";
97  
98      /**
99       * Bad sender's mailbox address syntax
100      */
101     public static final String ADDRESS_SYNTAX_SENDER = "1.7";
102 
103     /**
104      * Bad sender's system address
105      */
106     public static final String ADDRESS_SYSTEM_SENDER = "1.8";
107 
108 
109     /**
110      * Mailbox Status
111      */
112     public static final int MAILBOX = 2;
113 
114     /**
115      * Other or Undefined Mailbox Status
116      */
117     public static final String MAILBOX_OTHER = "2.0";
118 
119     /**
120      * Mailbox disabled, not accepting messages
121      */
122     public static final String MAILBOX_DISABLED = "2.1";
123 
124     /**
125      * Mailbox full
126      */
127     public static final String MAILBOX_FULL = "2.2";
128 
129     /**
130      * Message length exceeds administrative limit
131      */
132     public static final String MAILBOX_MSG_TOO_BIG = "2.3";
133 
134     /**
135      * Mailing list expansion problem
136      */
137     public static final String MAILBOX_LIST_EXPANSION = "2.4";
138 
139 
140     /**
141      * Mail System Status
142      */
143     public static final int SYSTEM = 3;
144 
145     /**
146      * Other or undefined mail system status
147      */
148     public static final String SYSTEM_OTHER = "3.0";
149 
150     /**
151      * Mail system full
152      */
153     public static final String SYSTEM_FULL = "3.1";
154 
155     /**
156      * System not accepting messages
157      */
158     public static final String SYSTEM_NOT_ACCEPTING = "3.2";
159 
160     /**
161      * System not capable of selected features
162      */
163     public static final String SYSTEM_NOT_CAPABLE = "3.3";
164 
165     /**
166      * Message too big for system
167      */
168     public static final String SYSTEM_MSG_TOO_BIG = "3.4";
169 
170     /**
171      * System incorrectly configured
172      */
173     public static final String SYSTEM_CFG_ERROR = "3.5";
174 
175 
176     /**
177      * Network and Routing Status
178      */
179     public static final int NETWORK = 4;
180 
181     /**
182      * Other or undefined network or routing status
183      */
184     public static final String NETWORK_OTHER = "4.0";
185 
186     /**
187      * No answer form host
188      */
189     public static final String NETWORK_NO_ANSWER = "4.1";
190 
191     /**
192      * Bad Connection
193      */
194     public static final String NETWORK_CONNECTION = "4.2";
195 
196     /**
197      * Directory server failure
198      */
199     public static final String NETWORK_DIR_SERVER = "4.3";
200 
201     /**
202      * Unable to route
203      */
204     public static final String NETWORK_ROUTE = "4.4";
205 
206     /**
207      * Mail system congestion
208      */
209     public static final String NETWORK_CONGESTION = "4.5";
210 
211     /**
212      * Routing loop detected
213      */
214     public static final String NETWORK_LOOP = "4.6";
215 
216     /**
217      * Delivery time expired
218      */
219     public static final String NETWORK_EXPIRED = "4.7";
220 
221 
222     /**
223      * Mail Delivery Protocol Status
224      */
225     public static final int DELIVERY = 5;
226 
227     /**
228      * Other or undefined (SMTP) protocol status
229      */
230     public static final String DELIVERY_OTHER = "5.0";
231 
232     /**
233      * Invalid command
234      */
235     public static final String DELIVERY_INVALID_CMD = "5.1";
236 
237     /**
238      * Syntax error
239      */
240     public static final String DELIVERY_SYNTAX = "5.2";
241 
242     /**
243      * Too many recipients
244      */
245     public static final String DELIVERY_TOO_MANY_REC = "5.3";
246 
247     /**
248      * Invalid command arguments
249      */
250     public static final String DELIVERY_INVALID_ARG = "5.4";
251 
252     /**
253      * Wrong protocol version
254      */
255     public static final String DELIVERY_VERSION = "5.5";
256 
257 
258     /**
259      * Message Content or Media Status
260      */
261     public static final int CONTENT = 6;
262 
263     /**
264      * Other or undefined media error
265      */
266     public static final String CONTENT_OTHER = "6.0";
267 
268     /**
269      * Media not supported
270      */
271     public static final String CONTENT_UNSUPPORTED = "6.1";
272 
273     /**
274      * Conversion required and prohibited
275      */
276     public static final String CONTENT_CONVERSION_NOT_ALLOWED = "6.2";
277 
278     /**
279      * Conversion required, but not supported
280      */
281     public static final String CONTENT_CONVERSION_NOT_SUPPORTED = "6.3";
282 
283     /**
284      * Conversion with loss performed
285      */
286     public static final String CONTENT_CONVERSION_LOSS = "6.4";
287 
288     /**
289      * Conversion failed
290      */
291     public static final String CONTENT_CONVERSION_FAILED = "6.5";
292 
293 
294     /**
295      * Security or Policy Status
296      */
297     public static final int SECURITY = 7;
298 
299     /**
300      * Other or undefined security status
301      */
302     public static final String SECURITY_OTHER = "7.0";
303 
304     /**
305      * Delivery not authorized, message refused
306      */
307     public static final String SECURITY_AUTH = "7.1";
308 
309     /**
310      * Mailing list expansion prohibited
311      */
312     public static final String SECURITY_LIST_EXP = "7.2";
313 
314     /**
315      * Security conversion required, but not possible
316      */
317     public static final String SECURITY_CONVERSION = "7.3";
318 
319     /**
320      * Security features not supported
321      */
322     public static final String SECURITY_UNSUPPORTED = "7.4";
323 
324     /**
325      * Cryptographic failure
326      */
327     public static final String SECURITY_CRYPT_FAIL = "7.5";
328 
329     /**
330      * Cryptographic algorithm not supported
331      */
332     public static final String SECURITY_CRYPT_ALGO = "7.6";
333 
334     /**
335      * Message integrity failure
336      */
337     public static final String SECURITY_INTEGRITY = "7.7";
338 
339 
340     // get methods
341 
342     public static String getStatus(int type, String detail) {
343         return type + "." + detail;
344     }
345 
346     public static String getStatus(int type, int subject, int detail) {
347         return type + "." + subject + "." + detail;
348     }
349 }