Sync usage with man page.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / mail_proto.h
blob8a81b5147ce1fc7341ec512e50d855217ab87569
1 /* $NetBSD$ */
3 #ifndef _MAIL_PROTO_H_INCLUDED_
4 #define _MAIL_PROTO_H_INCLUDED_
6 /*++
7 /* NAME
8 /* mail_proto 3h
9 /* SUMMARY
10 /* mail internal and external protocol support
11 /* SYNOPSIS
12 /* #include <mail_proto.h>
13 /* DESCRIPTION
14 /* .nf
17 * System library.
19 #include <stdarg.h>
20 #include <string.h>
23 * Utility library.
25 #include <vstream.h>
26 #include <iostuff.h>
27 #include <attr.h>
30 * External protocols.
32 #define MAIL_PROTO_SMTP "SMTP"
33 #define MAIL_PROTO_ESMTP "ESMTP"
34 #define MAIL_PROTO_QMQP "QMQP"
37 * Names of services: these are the names if INET ports, UNIX-domain sockets
38 * or FIFOs that a service listens on.
40 #define MAIL_SERVICE_BOUNCE "bounce"
41 #define MAIL_SERVICE_CLEANUP "cleanup"
42 #define MAIL_SERVICE_DEFER "defer"
43 #define MAIL_SERVICE_FORWARD "forward"
44 #define MAIL_SERVICE_LOCAL "local"
45 #define MAIL_SERVICE_PICKUP "pickup"
46 #define MAIL_SERVICE_QUEUE "qmgr"
47 #define MAIL_SERVICE_TLSMGR "tlsmgr"
48 #define MAIL_SERVICE_RESOLVE "resolve"
49 #define MAIL_SERVICE_REWRITE "rewrite"
50 #define MAIL_SERVICE_VIRTUAL "virtual"
51 #define MAIL_SERVICE_SMTP "smtp"
52 #define MAIL_SERVICE_SMTPD "smtpd"
53 #define MAIL_SERVICE_SHOWQ "showq"
54 #define MAIL_SERVICE_ERROR "error"
55 #define MAIL_SERVICE_RETRY "retry"
56 #define MAIL_SERVICE_FLUSH "flush"
57 #define MAIL_SERVICE_VERIFY "verify"
58 #define MAIL_SERVICE_TRACE "trace"
59 #define MAIL_SERVICE_RELAY "relay"
60 #define MAIL_SERVICE_PROXYMAP "proxymap"
61 #define MAIL_SERVICE_PROXYWRITE "proxywrite"
62 #define MAIL_SERVICE_SCACHE "scache"
65 * Well-known socket or FIFO directories. The main difference is in file
66 * access permissions.
68 #define MAIL_CLASS_PUBLIC "public"
69 #define MAIL_CLASS_PRIVATE "private"
72 * Generic triggers.
74 #define TRIGGER_REQ_WAKEUP 'W' /* wakeup */
77 * Queue manager requests.
79 #define QMGR_REQ_SCAN_DEFERRED 'D' /* scan deferred queue */
80 #define QMGR_REQ_SCAN_INCOMING 'I' /* scan incoming queue */
81 #define QMGR_REQ_FLUSH_DEAD 'F' /* flush dead xport/site */
82 #define QMGR_REQ_SCAN_ALL 'A' /* ignore time stamps */
85 * Functional interface.
87 extern VSTREAM *mail_connect(const char *, const char *, int);
88 extern VSTREAM *mail_connect_wait(const char *, const char *);
89 extern int mail_command_client(const char *, const char *,...);
90 extern int mail_command_server(VSTREAM *,...);
91 extern int mail_trigger(const char *, const char *, const char *, ssize_t);
92 extern char *mail_pathname(const char *, const char *);
95 * Attribute names.
97 #define MAIL_ATTR_REQ "request"
98 #define MAIL_ATTR_NREQ "nrequest"
99 #define MAIL_ATTR_STATUS "status"
101 #define MAIL_ATTR_FLAGS "flags"
102 #define MAIL_ATTR_QUEUE "queue_name"
103 #define MAIL_ATTR_QUEUEID "queue_id"
104 #define MAIL_ATTR_SENDER "sender"
105 #define MAIL_ATTR_RCPT_COUNT "recipient_count"
106 #define MAIL_ATTR_ORCPT "original_recipient"
107 #define MAIL_ATTR_RECIP "recipient"
108 #define MAIL_ATTR_WHY "reason"
109 #define MAIL_ATTR_VERPDL "verp_delimiters"
110 #define MAIL_ATTR_SITE "site"
111 #define MAIL_ATTR_OFFSET "offset"
112 #define MAIL_ATTR_SIZE "size"
113 #define MAIL_ATTR_ERRTO "errors-to"
114 #define MAIL_ATTR_RRCPT "return-receipt"
115 #define MAIL_ATTR_TIME "time"
116 #define MAIL_ATTR_CREATE_TIME "create_time"
117 #define MAIL_ATTR_RULE "rule"
118 #define MAIL_ATTR_ADDR "address"
119 #define MAIL_ATTR_TRANSPORT "transport"
120 #define MAIL_ATTR_NEXTHOP "nexthop"
121 #define MAIL_ATTR_TRACE_FLAGS "trace_flags"
122 #define MAIL_ATTR_ADDR_STATUS "recipient_status"
123 #define MAIL_ATTR_ACTION "action"
124 #define MAIL_ATTR_TABLE "table"
125 #define MAIL_ATTR_KEY "key"
126 #define MAIL_ATTR_VALUE "value"
127 #define MAIL_ATTR_INSTANCE "instance"
128 #define MAIL_ATTR_SASL_METHOD "sasl_method"
129 #define MAIL_ATTR_SASL_USERNAME "sasl_username"
130 #define MAIL_ATTR_SASL_SENDER "sasl_sender"
131 #define MAIL_ATTR_ETRN_DOMAIN "etrn_domain"
132 #define MAIL_ATTR_DUMMY "dummy"
133 #define MAIL_ATTR_STRESS "stress"
134 #define MAIL_ATTR_RWR_CONTEXT "rewrite_context"
136 #define MAIL_ATTR_RWR_LOCAL "local"
137 #define MAIL_ATTR_RWR_REMOTE "remote"
139 #define MAIL_ATTR_TTL "ttl"
140 #define MAIL_ATTR_LABEL "label"
141 #define MAIL_ATTR_PROP "property"
142 #define MAIL_ATTR_CCERT_SUBJECT "ccert_subject"
143 #define MAIL_ATTR_CCERT_ISSUER "ccert_issuer"
144 #define MAIL_ATTR_CCERT_FINGERPRINT "ccert_fingerprint"
145 #define MAIL_ATTR_CRYPTO_PROTOCOL "encryption_protocol"
146 #define MAIL_ATTR_CRYPTO_CIPHER "encryption_cipher"
147 #define MAIL_ATTR_CRYPTO_KEYSIZE "encryption_keysize"
150 * Suffixes for sender_name, sender_domain etc.
152 #define MAIL_ATTR_S_NAME "_name"
153 #define MAIL_ATTR_S_DOMAIN "_domain"
156 * Special names for RBL results.
158 #define MAIL_ATTR_RBL_WHAT "rbl_what"
159 #define MAIL_ATTR_RBL_DOMAIN "rbl_domain"
160 #define MAIL_ATTR_RBL_REASON "rbl_reason"
161 #define MAIL_ATTR_RBL_TXT "rbl_txt" /* LaMont compatibility */
162 #define MAIL_ATTR_RBL_CLASS "rbl_class"
163 #define MAIL_ATTR_RBL_CODE "rbl_code"
166 * The following attribute names are stored in queue files. Changing this
167 * means lots of work to maintain backwards compatibility with queued mail.
169 #define MAIL_ATTR_ENCODING "encoding" /* internal encoding */
170 #define MAIL_ATTR_ENC_8BIT "8bit" /* 8BITMIME equivalent */
171 #define MAIL_ATTR_ENC_7BIT "7bit" /* 7BIT equivalent */
172 #define MAIL_ATTR_ENC_NONE "" /* encoding unknown */
174 #define MAIL_ATTR_LOG_CLIENT_NAME "log_client_name" /* client hostname */
175 #define MAIL_ATTR_LOG_CLIENT_ADDR "log_client_address" /* client address */
176 #define MAIL_ATTR_LOG_CLIENT_PORT "log_client_port" /* client port */
177 #define MAIL_ATTR_LOG_HELO_NAME "log_helo_name" /* SMTP helo name */
178 #define MAIL_ATTR_LOG_PROTO_NAME "log_protocol_name" /* SMTP/ESMTP/QMQP */
179 #define MAIL_ATTR_LOG_ORIGIN "log_message_origin" /* name[addr]:port */
181 #define MAIL_ATTR_ACT_CLIENT "client"/* client name addr */
182 #define MAIL_ATTR_ACT_CLIENT_NAME "client_name" /* client name */
183 #define MAIL_ATTR_ACT_CLIENT_ADDR "client_address" /* client address */
184 #define MAIL_ATTR_ACT_CLIENT_PORT "client_port" /* client TCP port */
185 #define MAIL_ATTR_ACT_CLIENT_AF "client_address_type" /* AF_INET etc. */
186 #define MAIL_ATTR_ACT_HELO_NAME "helo_name" /* SMTP helo name */
187 #define MAIL_ATTR_ACT_PROTO_NAME "protocol_name" /* SMTP/ESMTP/QMQP */
188 #define MAIL_ATTR_ACT_REVERSE_CLIENT_NAME "reverse_client_name"
189 #define MAIL_ATTR_ACT_FORWARD_CLIENT_NAME "forward_client_name"
191 #define MAIL_ATTR_PROTO_STATE "protocol_state" /* MAIL/RCPT/... */
192 #define MAIL_ATTR_ORG_NONE "unknown" /* origin unknown */
193 #define MAIL_ATTR_ORG_LOCAL "local" /* local submission */
196 * XCLIENT/XFORWARD in SMTP.
198 #define XCLIENT_CMD "XCLIENT" /* XCLIENT command */
199 #define XCLIENT_NAME "NAME" /* client name */
200 #define XCLIENT_REVERSE_NAME "REVERSE_NAME" /* reverse client name */
201 #ifdef FORWARD_CLIENT_NAME
202 #define XCLIENT_FORWARD_NAME "FORWARD_NAME" /* forward client name */
203 #endif
204 #define XCLIENT_ADDR "ADDR" /* client address */
205 #define XCLIENT_PORT "PORT" /* client port */
206 #define XCLIENT_PROTO "PROTO" /* client protocol */
207 #define XCLIENT_HELO "HELO" /* client helo */
209 #define XCLIENT_UNAVAILABLE "[UNAVAILABLE]" /* permanently unavailable */
210 #define XCLIENT_TEMPORARY "[TEMPUNAVAIL]" /* temporarily unavailable */
212 #define XFORWARD_CMD "XFORWARD" /* XFORWARD command */
213 #define XFORWARD_NAME "NAME" /* client name */
214 #define XFORWARD_ADDR "ADDR" /* client address */
215 #define XFORWARD_PORT "PORT" /* client port */
216 #define XFORWARD_PROTO "PROTO" /* client protocol */
217 #define XFORWARD_HELO "HELO" /* client helo */
218 #define XFORWARD_IDENT "IDENT" /* message identifier */
219 #define XFORWARD_DOMAIN "SOURCE"/* origin type */
220 #define XFORWARD_DOM_LOCAL "LOCAL" /* local origin */
221 #define XFORWARD_DOM_REMOTE "REMOTE"/* remote origin */
223 #define XFORWARD_UNAVAILABLE "[UNAVAILABLE]" /* attribute unavailable */
226 * DSN support.
228 #define MAIL_ATTR_DSN_STATUS "status"/* XXX Postfix <2.3 compat */
229 #define MAIL_ATTR_DSN_DTYPE "diag_type" /* dsn diagnostic code */
230 #define MAIL_ATTR_DSN_DTEXT "diag_text" /* dsn diagnostic code */
231 #define MAIL_ATTR_DSN_MTYPE "mta_type" /* dsn remote MTA */
232 #define MAIL_ATTR_DSN_MNAME "mta_mname" /* dsn remote MTA */
233 #define MAIL_ATTR_DSN_ACTION "action"/* XXX Postfix <2.3 compat */
234 #define MAIL_ATTR_DSN_ENVID "envelope_id" /* dsn envelope id */
235 #define MAIL_ATTR_DSN_RET "ret_flags" /* dsn full/headers */
236 #define MAIL_ATTR_DSN_NOTIFY "notify_flags" /* dsn notify flags */
237 #define MAIL_ATTR_DSN_ORCPT "dsn_orig_rcpt" /* dsn original recipient */
239 /* LICENSE
240 /* .ad
241 /* .fi
242 /* The Secure Mailer license must be distributed with this software.
243 /* AUTHOR(S)
244 /* Wietse Venema
245 /* IBM T.J. Watson Research
246 /* P.O. Box 704
247 /* Yorktown Heights, NY 10598, USA
248 /*--*/
250 #endif