2 * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
11 SM_RCSID("@(#)$Id: strexit.c,v 1.5 2001/09/11 04:04:49 gshapiro Exp $")
12 #include <sm/string.h>
13 #include <sm/sysexits.h>
16 ** SM_STREXIT -- convert EX_* value from <sm/sysexits.h> to a character string
18 ** This function is analogous to strerror(), except that it
19 ** operates on EX_* values from <sm/sysexits.h>.
25 ** pointer to a static message string
35 msg
= sm_sysexitmsg(ex
);
38 (void) sm_snprintf(buf
, sizeof buf
, "Unknown exit status %d",
46 ** SM_SYSEXITMSG -- convert an EX_* value to a character string, or NULL
52 ** If ex is a known exit value, then a pointer to a static
53 ** message string is returned. Otherwise NULL is returned.
62 msg
= sm_sysexmsg(ex
);
70 ** SM_SYSEXMSG -- convert an EX_* value to a character string, or NULL
76 ** If ex is a known exit value, then a pointer to a static
77 ** string is returned. Otherwise NULL is returned.
78 ** The string contains the following fixed width fields:
79 ** [0] ':' if there is an errno value associated with this
80 ** exit value, otherwise ' '.
81 ** [1,3] 3 digit SMTP error code
83 ** [5,9] 3 digit SMTP extended error code
85 ** [11,] message string
95 return " 500 5.0.0 Command line usage error";
97 return " 501 5.6.0 Data format error";
99 return ":550 5.3.0 Cannot open input";
101 return " 550 5.1.1 User unknown";
103 return " 550 5.1.2 Host unknown";
105 return " 554 5.0.0 Service unavailable";
107 return ":554 5.3.0 Internal error";
109 return ":451 4.0.0 Operating system error";
111 return ":554 5.3.5 System file missing";
113 return ":550 5.0.0 Can't create output";
115 return ":451 4.0.0 I/O error";
117 return " 450 4.0.0 Deferred";
119 return " 554 5.5.0 Remote protocol error";
121 return ":550 5.0.0 Insufficient permission";
123 return " 554 5.3.5 Local configuration error";