]>
diplodocus.org Git - nmh/blob - mts/smtp/smtp.h
d73a643820fbeb6ac1d6ef91f77ea722c0e3bb9b
2 * smtp.h -- definitions for the nmh SMTP Interface
5 /* length is the length of the string in text[], which is also NUL
6 * terminated, so s.text[s.length] should always be 0.
19 #define S_STARTTLS 0x01
20 #define S_INITTLS 0x02
21 #define S_TLSENABLEMASK 0x03
22 #define S_NOVERIFY 0x04
23 int sm_init (char *, char *, char *, int, int, int, int, const char *,
24 const char *, const char *, int);
25 int sm_winit (char *, int, int);
26 int sm_wadr (char *, char *, char *);
28 int sm_wtxt (char *, int);
31 char *rp_string (int);
33 /* The remainder of this file is derived from "mmdf.h" */
36 * Copyright (C) 1979,1980,1981,1982,1983 University of Delaware
37 * Used by permission, May, 1984.
41 * MULTI-CHANNEL MEMO DISTRIBUTION FACILITY (MMDF)
44 * Copyright (C) 1979,1980,1981,1982,1983 University of Delaware
46 * Department of Electrical Engineering
47 * University of Delaware
48 * Newark, Delaware 19711
50 * Phone: (302) 738-1163
53 * This program module was developed as part of the University
54 * of Delaware's Multi-Channel Memo Distribution Facility (MMDF).
56 * Acquisition, use, and distribution of this module and its listings
57 * are subject restricted to the terms of a license agreement.
58 * Documents describing systems using this module must cite its source.
60 * The above statements must be retained with all copies of this
61 * program and may not be removed without the consent of the
62 * University of Delaware.
66 /* Reply Codes for MMDF
68 * Based on: "Revised FTP Reply Codes", by Jon Postel & Nancy Neigus Arpanet
69 * RFC 640 / NIC 30843, in the "Arpanet Protocol Handbook", E. Feinler
70 * and J. Postel (eds.), NIC 7104, Network Information Center, SRI
71 * International: Menlo Park, CA. (NTIS AD-A0038901)
73 * Actual values are different, but scheme is same. Codes must fit into
74 * 8-bits (to pass on exit() calls); fields are packed 2-3-3 and interpreted
79 * 0yz: positive completion; entire action done
80 * 1yz: positive intermediate; only part done
81 * 2yz: Transient negative completion; may work later
82 * 3yz: Permanent negative completion; you lose forever
85 * x1z: general; doesn't fit any other category
86 * x2z: connections; truly transfer-related
87 * x3z: user/authentication/account
91 * 3-bit z field is unique to the reply. In the following,
92 * the RP_xVAL defines are available for masking to obtain a field.
96 * FIELD DEFINITIONS & BASIC VALUES
99 /* FIELD 1: Basic degree of success (2-bits) */
101 #define RP_BOK '\000' /* went fine; all done */
102 #define RP_BPOK '\100' /* only the first part got done */
103 #define RP_BTNO '\200' /* temporary failure; try later */
104 #define RP_BNO '\300' /* not now, nor never; you lose */
106 /* FIELD 2: Basic domain of discourse (3-bits) */
108 #define RP_CSYN '\000' /* purely a matter of form */
109 #define RP_CGEN '\010' /* couldn't find anywhere else for it */
110 #define RP_CCON '\020' /* data-transfer-related issue */
111 #define RP_CUSR '\030' /* pertaining to the user */
112 #define RP_CMAI '\040' /* specific to mail semantics */
116 * SPECIFIC SUCCESS VALUES
123 /* general-purpose OK */
124 #define RP_OK (RP_BOK | RP_CGEN | '\001')
126 /* message is accepted (w/text) */
127 #define RP_MOK (RP_BOK | RP_CMAI | '\000')
134 /* message address is accepted */
135 #define RP_AOK (RP_BPOK| RP_CMAI | '\000')
139 * SPECIFIC FALURE VALUES
146 /* foreign host screwed up */
147 #define RP_BHST (RP_BTNO | RP_CCON | '\001')
154 /* general-purpose NO */
155 #define RP_NO (RP_BNO | RP_CGEN | '\001')
157 /* bad reply code (PERMANENT ERROR) */
158 #define RP_RPLY (RP_BNO | RP_CCON | '\001')
160 /* couldn't deliver */
161 #define RP_NDEL (RP_BNO | RP_CMAI | '\000')
164 #define RP_PARM (RP_BNO | RP_CSYN | '\002')
166 /* command not implemented */
167 #define RP_UCMD (RP_BNO | RP_CSYN | '\003')
170 #define RP_USER (RP_BNO | RP_CUSR | '\000')
176 * The following treat the value as strictly numeric.
177 * It relies on the negative values being numerically
181 /* is return value negative? */
182 #define rp_isbad(val) (((signed char)(val)) < 0)