Print this page
XXXX update sendmail to 8.14.9
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/sendmail/include/libmilter/mfapi.h
+++ new/usr/src/cmd/sendmail/include/libmilter/mfapi.h
1 1 /*
2 - * Copyright (c) 1999-2004, 2006, 2008 Sendmail, Inc. and its suppliers.
2 + * Copyright (c) 1999-2004, 2006, 2008, 2012 Proofpoint, Inc. and its suppliers.
3 3 * All rights reserved.
4 4 *
5 5 * By using this file, you agree to the terms and conditions set
6 6 * forth in the LICENSE file which can be found at the top level of
7 7 * the sendmail distribution.
8 8 *
9 9 *
10 - * $Id: mfapi.h,v 8.80 2009/11/26 00:57:08 ca Exp $
10 + * $Id: mfapi.h,v 8.83 2013-11-22 20:51:27 ca Exp $
11 11 */
12 12
13 13 /*
14 - * MFAPI.H -- Global definitions for mail filter library and mail filters.
15 - */
14 +** MFAPI.H -- Global definitions for mail filter library and mail filters.
15 +*/
16 16
17 -#ifndef _LIBMILTER_MFAPI_H
18 -#define _LIBMILTER_MFAPI_H
17 +#ifndef _LIBMILTER_MFAPI_H
18 +# define _LIBMILTER_MFAPI_H 1
19 19
20 +/* Only need to export C interface if used by C++ source code */
20 21 #ifdef __cplusplus
21 22 extern "C" {
22 -#endif
23 +#endif /* __cplusplus */
23 24
24 25 #ifndef SMFI_VERSION
25 -#if _FFR_MDS_NEGOTIATE
26 -#define SMFI_VERSION 0x01000002 /* libmilter version number */
26 +# if _FFR_MDS_NEGOTIATE
27 +# define SMFI_VERSION 0x01000002 /* libmilter version number */
27 28
28 -/* first libmilter version that has MDS support */
29 -#define SMFI_VERSION_MDS 0x01000002
30 -#else /* _FFR_MDS_NEGOTIATE */
31 -#define SMFI_VERSION 0x01000001 /* libmilter version number */
32 -#endif /* _FFR_MDS_NEGOTIATE */
29 + /* first libmilter version that has MDS support */
30 +# define SMFI_VERSION_MDS 0x01000002
31 +# else /* _FFR_MDS_NEGOTIATE */
32 +# define SMFI_VERSION 0x01000001 /* libmilter version number */
33 +# endif /* _FFR_MDS_NEGOTIATE */
33 34 #endif /* ! SMFI_VERSION */
34 35
35 -#define SM_LM_VRS_MAJOR(v) (((v) & 0x7f000000) >> 24)
36 -#define SM_LM_VRS_MINOR(v) (((v) & 0x007fff00) >> 8)
37 -#define SM_LM_VRS_PLVL(v) ((v) & 0x0000007f)
36 +#define SM_LM_VRS_MAJOR(v) (((v) & 0x7f000000) >> 24)
37 +#define SM_LM_VRS_MINOR(v) (((v) & 0x007fff00) >> 8)
38 +#define SM_LM_VRS_PLVL(v) ((v) & 0x0000007f)
38 39
39 -#include <sys/types.h>
40 -#include <sys/socket.h>
40 +# include <sys/types.h>
41 +# include <sys/socket.h>
41 42
42 43 #include <libmilter/mfdef.h>
43 44
44 -#define LIBMILTER_API extern
45 +# define LIBMILTER_API extern
45 46
47 +
46 48 #ifndef _SOCK_ADDR
47 -#define _SOCK_ADDR struct sockaddr
49 +# define _SOCK_ADDR struct sockaddr
48 50 #endif /* ! _SOCK_ADDR */
49 51
50 52 /*
51 - * libmilter functions return one of the following to indicate
52 - * success/failure(/continue):
53 - */
53 +** libmilter functions return one of the following to indicate
54 +** success/failure(/continue):
55 +*/
54 56
55 -#define MI_SUCCESS 0
56 -#define MI_FAILURE (-1)
57 +#define MI_SUCCESS 0
58 +#define MI_FAILURE (-1)
57 59 #if _FFR_WORKERS_POOL
58 -#define MI_CONTINUE 1
60 +# define MI_CONTINUE 1
59 61 #endif /* _FFR_WORKERS_POOL */
60 62
61 63 /* "forward" declarations */
62 64 typedef struct smfi_str SMFICTX;
63 65 typedef struct smfi_str *SMFICTX_PTR;
64 66
65 67 typedef struct smfiDesc smfiDesc_str;
66 68 typedef struct smfiDesc *smfiDesc_ptr;
67 69
68 70 /*
69 - * Type which callbacks should return to indicate message status.
70 - * This may take on one of the SMFIS_* values listed below.
71 - */
71 +** Type which callbacks should return to indicate message status.
72 +** This may take on one of the SMFIS_* values listed below.
73 +*/
72 74
73 75 typedef int sfsistat;
74 76
75 -#if defined(__linux__) && defined(__GNUC__) && defined(__cplusplus) && \
76 - __GNUC_MINOR__ >= 8
77 -#define SM__P(X) __PMT(X)
77 +#if defined(__linux__) && defined(__GNUC__) && defined(__cplusplus) && __GNUC_MINOR__ >= 8
78 +# define SM__P(X) __PMT(X)
78 79 #else /* __linux__ && __GNUC__ && __cplusplus && _GNUC_MINOR__ >= 8 */
79 -#define SM__P(X) __P(X)
80 +# define SM__P(X) __P(X)
80 81 #endif /* __linux__ && __GNUC__ && __cplusplus && _GNUC_MINOR__ >= 8 */
81 82
82 83 /* Some platforms don't define __P -- do it for them here: */
83 84 #ifndef __P
84 -#ifdef __STDC__
85 -#define __P(X) X
86 -#else /* __STDC__ */
87 -#define __P(X) ()
88 -#endif /* __STDC__ */
85 +# ifdef __STDC__
86 +# define __P(X) X
87 +# else /* __STDC__ */
88 +# define __P(X) ()
89 +# endif /* __STDC__ */
89 90 #endif /* __P */
90 91
91 92 #if SM_CONF_STDBOOL_H
92 -#include <stdbool.h>
93 +# include <stdbool.h>
93 94 #else /* SM_CONF_STDBOOL_H */
94 -#ifndef __cplusplus
95 -#ifndef bool
96 -#ifndef __bool_true_false_are_defined
95 +# ifndef __cplusplus
96 +# ifndef bool
97 +# ifndef __bool_true_false_are_defined
97 98 typedef int bool;
98 -#define __bool_true_false_are_defined 1
99 -#endif /* ! __bool_true_false_are_defined */
100 -#endif /* bool */
101 -#endif /* ! __cplusplus */
99 +# define false 0
100 +# define true 1
101 +# define __bool_true_false_are_defined 1
102 +# endif /* ! __bool_true_false_are_defined */
103 +# endif /* bool */
104 +# endif /* ! __cplusplus */
102 105 #endif /* SM_CONF_STDBOOL_H */
103 106
104 107 /*
105 - * structure describing one milter
106 - */
108 +** structure describing one milter
109 +*/
107 110
108 111 struct smfiDesc
109 112 {
110 113 char *xxfi_name; /* filter name */
111 114 int xxfi_version; /* version code -- do not change */
112 115 unsigned long xxfi_flags; /* flags */
113 116
114 117 /* connection info filter */
115 - sfsistat (*xxfi_connect) SM__P((SMFICTX *, char *,
116 - _SOCK_ADDR *));
118 + sfsistat (*xxfi_connect) SM__P((SMFICTX *, char *, _SOCK_ADDR *));
117 119
118 120 /* SMTP HELO command filter */
119 121 sfsistat (*xxfi_helo) SM__P((SMFICTX *, char *));
120 122
121 123 /* envelope sender filter */
122 124 sfsistat (*xxfi_envfrom) SM__P((SMFICTX *, char **));
123 125
124 126 /* envelope recipient filter */
125 127 sfsistat (*xxfi_envrcpt) SM__P((SMFICTX *, char **));
126 128
127 129 /* header filter */
128 130 sfsistat (*xxfi_header) SM__P((SMFICTX *, char *, char *));
129 131
130 132 /* end of header */
131 133 sfsistat (*xxfi_eoh) SM__P((SMFICTX *));
132 134
133 135 /* body block */
134 - sfsistat (*xxfi_body) SM__P((SMFICTX *, unsigned char *,
135 - size_t));
136 + sfsistat (*xxfi_body) SM__P((SMFICTX *, unsigned char *, size_t));
136 137
137 138 /* end of message */
138 139 sfsistat (*xxfi_eom) SM__P((SMFICTX *));
139 140
140 141 /* message aborted */
141 142 sfsistat (*xxfi_abort) SM__P((SMFICTX *));
142 143
143 144 /* connection cleanup */
144 145 sfsistat (*xxfi_close) SM__P((SMFICTX *));
145 146
146 147 /* any unrecognized or unimplemented command filter */
147 148 sfsistat (*xxfi_unknown) SM__P((SMFICTX *, const char *));
148 149
149 150 /* SMTP DATA command filter */
150 151 sfsistat (*xxfi_data) SM__P((SMFICTX *));
151 152
152 153 /* negotiation callback */
153 154 sfsistat (*xxfi_negotiate) SM__P((SMFICTX *,
154 155 unsigned long, unsigned long,
155 156 unsigned long, unsigned long,
156 157 unsigned long *, unsigned long *,
157 158 unsigned long *, unsigned long *));
158 159
159 160 #if 0
160 161 /* signal handler callback, not yet implemented. */
161 162 int (*xxfi_signal) SM__P((int));
162 163 #endif
163 164
164 165 };
|
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
165 166
166 167 LIBMILTER_API int smfi_opensocket __P((bool));
167 168 LIBMILTER_API int smfi_register __P((struct smfiDesc));
168 169 LIBMILTER_API int smfi_main __P((void));
169 170 LIBMILTER_API int smfi_setbacklog __P((int));
170 171 LIBMILTER_API int smfi_setdbg __P((int));
171 172 LIBMILTER_API int smfi_settimeout __P((int));
172 173 LIBMILTER_API int smfi_setconn __P((char *));
173 174 LIBMILTER_API int smfi_stop __P((void));
174 175 LIBMILTER_API size_t smfi_setmaxdatasize __P((size_t));
175 -LIBMILTER_API int smfi_version __P((unsigned int *, unsigned int *,
176 - unsigned int *));
176 +LIBMILTER_API int smfi_version __P((unsigned int *, unsigned int *, unsigned int *));
177 177
178 178 /*
179 - * What the filter might do -- values to be ORed together for
180 - * smfiDesc.xxfi_flags.
181 - */
179 +** What the filter might do -- values to be ORed together for
180 +** smfiDesc.xxfi_flags.
181 +*/
182 182
183 -#define SMFIF_NONE 0x00000000L /* no flags */
184 -#define SMFIF_ADDHDRS 0x00000001L /* filter may add headers */
185 -#define SMFIF_CHGBODY 0x00000002L /* filter may replace body */
186 -#define SMFIF_MODBODY SMFIF_CHGBODY /* backwards compatible */
187 -#define SMFIF_ADDRCPT 0x00000004L /* filter may add recipients */
188 -#define SMFIF_DELRCPT 0x00000008L /* filter may delete recipients */
189 -#define SMFIF_CHGHDRS 0x00000010L /* filter may change/delete headers */
190 -#define SMFIF_QUARANTINE 0x00000020L /* filter may quarantine envelope */
183 +#define SMFIF_NONE 0x00000000L /* no flags */
184 +#define SMFIF_ADDHDRS 0x00000001L /* filter may add headers */
185 +#define SMFIF_CHGBODY 0x00000002L /* filter may replace body */
186 +#define SMFIF_MODBODY SMFIF_CHGBODY /* backwards compatible */
187 +#define SMFIF_ADDRCPT 0x00000004L /* filter may add recipients */
188 +#define SMFIF_DELRCPT 0x00000008L /* filter may delete recipients */
189 +#define SMFIF_CHGHDRS 0x00000010L /* filter may change/delete headers */
190 +#define SMFIF_QUARANTINE 0x00000020L /* filter may quarantine envelope */
191 191
192 192 /* filter may change "from" (envelope sender) */
193 -#define SMFIF_CHGFROM 0x00000040L
194 -#define SMFIF_ADDRCPT_PAR 0x00000080L /* add recipients incl. args */
193 +#define SMFIF_CHGFROM 0x00000040L
194 +#define SMFIF_ADDRCPT_PAR 0x00000080L /* add recipients incl. args */
195 195
196 196 /* filter can send set of symbols (macros) that it wants */
197 -#define SMFIF_SETSYMLIST 0x00000100L
197 +#define SMFIF_SETSYMLIST 0x00000100L
198 198
199 199
200 200 /*
201 - * Macro "places";
202 - * Notes:
203 - * - must be coordinated with libmilter/engine.c and sendmail/milter.c
204 - * - the order MUST NOT be changed as it would break compatibility between
205 - * different versions. It's ok to append new entries however
206 - * (hence the list is not sorted by the SMT protocol steps).
207 - */
201 +** Macro "places";
202 +** Notes:
203 +** - must be coordinated with libmilter/engine.c and sendmail/milter.c
204 +** - the order MUST NOT be changed as it would break compatibility between
205 +** different versions. It's ok to append new entries however
206 +** (hence the list is not sorted by the SMT protocol steps).
207 +*/
208 208
209 -#define SMFIM_FIRST 0 /* Do NOT use, internal marker only */
210 -#define SMFIM_CONNECT 0 /* connect */
211 -#define SMFIM_HELO 1 /* HELO/EHLO */
212 -#define SMFIM_ENVFROM 2 /* MAIL From */
213 -#define SMFIM_ENVRCPT 3 /* RCPT To */
214 -#define SMFIM_DATA 4 /* DATA */
215 -#define SMFIM_EOM 5 /* end of message (final dot) */
216 -#define SMFIM_EOH 6 /* end of header */
217 -#define SMFIM_LAST 6 /* Do NOT use, internal marker only */
209 +#define SMFIM_NOMACROS (-1) /* Do NOT use, internal only */
210 +#define SMFIM_FIRST 0 /* Do NOT use, internal marker only */
211 +#define SMFIM_CONNECT 0 /* connect */
212 +#define SMFIM_HELO 1 /* HELO/EHLO */
213 +#define SMFIM_ENVFROM 2 /* MAIL From */
214 +#define SMFIM_ENVRCPT 3 /* RCPT To */
215 +#define SMFIM_DATA 4 /* DATA */
216 +#define SMFIM_EOM 5 /* end of message (final dot) */
217 +#define SMFIM_EOH 6 /* end of header */
218 +#define SMFIM_LAST 6 /* Do NOT use, internal marker only */
218 219
219 220 /*
220 - * Continue processing message/connection.
221 - */
221 +** Continue processing message/connection.
222 +*/
222 223
223 -#define SMFIS_CONTINUE 0
224 +#define SMFIS_CONTINUE 0
224 225
225 226 /*
226 - * Reject the message/connection.
227 - * No further routines will be called for this message
228 - * (or connection, if returned from a connection-oriented routine).
229 - */
227 +** Reject the message/connection.
228 +** No further routines will be called for this message
229 +** (or connection, if returned from a connection-oriented routine).
230 +*/
230 231
231 -#define SMFIS_REJECT 1
232 +#define SMFIS_REJECT 1
232 233
233 234 /*
234 - * Accept the message,
235 - * but silently discard the message.
236 - * No further routines will be called for this message.
237 - * This is only meaningful from message-oriented routines.
238 - */
235 +** Accept the message,
236 +** but silently discard the message.
237 +** No further routines will be called for this message.
238 +** This is only meaningful from message-oriented routines.
239 +*/
239 240
240 -#define SMFIS_DISCARD 2
241 +#define SMFIS_DISCARD 2
241 242
242 243 /*
243 - * Accept the message/connection.
244 - * No further routines will be called for this message
245 - * (or connection, if returned from a connection-oriented routine;
246 - * in this case, it causes all messages on this connection
247 - * to be accepted without filtering).
248 - */
244 +** Accept the message/connection.
245 +** No further routines will be called for this message
246 +** (or connection, if returned from a connection-oriented routine;
247 +** in this case, it causes all messages on this connection
248 +** to be accepted without filtering).
249 +*/
249 250
250 -#define SMFIS_ACCEPT 3
251 +#define SMFIS_ACCEPT 3
251 252
252 253 /*
253 - * Return a temporary failure, i.e.,
254 - * the corresponding SMTP command will return a 4xx status code.
255 - * In some cases this may prevent further routines from
256 - * being called on this message or connection,
257 - * although in other cases (e.g., when processing an envelope
258 - * recipient) processing of the message will continue.
259 - */
254 +** Return a temporary failure, i.e.,
255 +** the corresponding SMTP command will return a 4xx status code.
256 +** In some cases this may prevent further routines from
257 +** being called on this message or connection,
258 +** although in other cases (e.g., when processing an envelope
259 +** recipient) processing of the message will continue.
260 +*/
260 261
261 -#define SMFIS_TEMPFAIL 4
262 +#define SMFIS_TEMPFAIL 4
262 263
263 264 /*
264 - * Do not send a reply to the MTA
265 - */
265 +** Do not send a reply to the MTA
266 +*/
266 267
267 -#define SMFIS_NOREPLY 7
268 +#define SMFIS_NOREPLY 7
268 269
269 270 /*
270 - * Skip over rest of same callbacks, e.g., body.
271 - */
271 +** Skip over rest of same callbacks, e.g., body.
272 +*/
272 273
273 -#define SMFIS_SKIP 8
274 +#define SMFIS_SKIP 8
274 275
275 276 /* xxfi_negotiate: use all existing protocol options/actions */
276 -#define SMFIS_ALL_OPTS 10
277 +#define SMFIS_ALL_OPTS 10
277 278
278 279 #if 0
279 280 /*
280 - * Filter Routine Details
281 - */
281 +** Filter Routine Details
282 +*/
282 283
283 284 /* connection info filter */
284 285 extern sfsistat xxfi_connect __P((SMFICTX *, char *, _SOCK_ADDR *));
285 286
286 287 /*
287 - * xxfi_connect(ctx, hostname, hostaddr) Invoked on each connection
288 - *
289 - * char *hostname; Host domain name, as determined by a reverse lookup
290 - * on the host address.
291 - * _SOCK_ADDR *hostaddr; Host address, as determined by a getpeername
292 - * call on the SMTP socket.
293 - */
288 +** xxfi_connect(ctx, hostname, hostaddr) Invoked on each connection
289 +**
290 +** char *hostname; Host domain name, as determined by a reverse lookup
291 +** on the host address.
292 +** _SOCK_ADDR *hostaddr; Host address, as determined by a getpeername
293 +** call on the SMTP socket.
294 +*/
294 295
295 296 /* SMTP HELO command filter */
296 297 extern sfsistat xxfi_helo __P((SMFICTX *, char *));
297 298
298 299 /*
299 - * xxfi_helo(ctx, helohost) Invoked on SMTP HELO/EHLO command
300 - *
301 - * char *helohost; Value passed to HELO/EHLO command, which should be
302 - * the domain name of the sending host (but is, in practice,
303 - * anything the sending host wants to send).
304 - */
300 +** xxfi_helo(ctx, helohost) Invoked on SMTP HELO/EHLO command
301 +**
302 +** char *helohost; Value passed to HELO/EHLO command, which should be
303 +** the domain name of the sending host (but is, in practice,
304 +** anything the sending host wants to send).
305 +*/
305 306
306 307 /* envelope sender filter */
307 308 extern sfsistat xxfi_envfrom __P((SMFICTX *, char **));
308 309
309 310 /*
310 - * xxfi_envfrom(ctx, argv) Invoked on envelope from
311 - *
312 - * char **argv; Null-terminated SMTP command arguments;
313 - * argv[0] is guaranteed to be the sender address.
314 - * Later arguments are the ESMTP arguments.
315 - */
311 +** xxfi_envfrom(ctx, argv) Invoked on envelope from
312 +**
313 +** char **argv; Null-terminated SMTP command arguments;
314 +** argv[0] is guaranteed to be the sender address.
315 +** Later arguments are the ESMTP arguments.
316 +*/
316 317
317 318 /* envelope recipient filter */
318 319 extern sfsistat xxfi_envrcpt __P((SMFICTX *, char **));
319 320
320 321 /*
321 - * xxfi_envrcpt(ctx, argv) Invoked on each envelope recipient
322 - *
323 - * char **argv; Null-terminated SMTP command arguments;
324 - * argv[0] is guaranteed to be the recipient address.
325 - * Later arguments are the ESMTP arguments.
326 - */
322 +** xxfi_envrcpt(ctx, argv) Invoked on each envelope recipient
323 +**
324 +** char **argv; Null-terminated SMTP command arguments;
325 +** argv[0] is guaranteed to be the recipient address.
326 +** Later arguments are the ESMTP arguments.
327 +*/
327 328
328 329 /* unknown command filter */
329 330
330 331 extern sfsistat *xxfi_unknown __P((SMFICTX *, const char *));
331 332
332 333 /*
333 - * xxfi_unknown(ctx, arg) Invoked when SMTP command is not recognized or not
334 - * implemented.
335 - * const char *arg; Null-terminated SMTP command
336 - */
334 +** xxfi_unknown(ctx, arg) Invoked when SMTP command is not recognized or not
335 +** implemented.
336 +** const char *arg; Null-terminated SMTP command
337 +*/
337 338
338 339 /* header filter */
339 340 extern sfsistat xxfi_header __P((SMFICTX *, char *, char *));
340 341
341 342 /*
342 - * xxfi_header(ctx, headerf, headerv) Invoked on each message header. The
343 - * content of the header may have folded white space (that is, multiple
344 - * lines with following white space) included.
345 - *
346 - * char *headerf; Header field name
347 - * char *headerv; Header field value
348 - */
343 +** xxfi_header(ctx, headerf, headerv) Invoked on each message header. The
344 +** content of the header may have folded white space (that is, multiple
345 +** lines with following white space) included.
346 +**
347 +** char *headerf; Header field name
348 +** char *headerv; Header field value
349 +*/
349 350
350 351 /* end of header */
351 352 extern sfsistat xxfi_eoh __P((SMFICTX *));
352 353
353 354 /*
354 - * xxfi_eoh(ctx) Invoked at end of header
355 - */
355 +** xxfi_eoh(ctx) Invoked at end of header
356 +*/
356 357
357 358 /* body block */
358 359 extern sfsistat xxfi_body __P((SMFICTX *, unsigned char *, size_t));
359 360
360 361 /*
361 - * xxfi_body(ctx, bodyp, bodylen) Invoked for each body chunk. There may
362 - * be multiple body chunks passed to the filter. End-of-lines are
363 - * represented as received from SMTP (normally Carriage-Return/Line-Feed).
364 - *
365 - * unsigned char *bodyp; Pointer to body data
366 - * size_t bodylen; Length of body data
367 - */
362 +** xxfi_body(ctx, bodyp, bodylen) Invoked for each body chunk. There may
363 +** be multiple body chunks passed to the filter. End-of-lines are
364 +** represented as received from SMTP (normally Carriage-Return/Line-Feed).
365 +**
366 +** unsigned char *bodyp; Pointer to body data
367 +** size_t bodylen; Length of body data
368 +*/
368 369
369 370 /* end of message */
370 371 extern sfsistat xxfi_eom __P((SMFICTX *));
371 372
372 373 /*
373 - * xxfi_eom(ctx) Invoked at end of message. This routine can perform
374 - * special operations such as modifying the message header, body, or
375 - * envelope.
376 - */
374 +** xxfi_eom(ctx) Invoked at end of message. This routine can perform
375 +** special operations such as modifying the message header, body, or
376 +** envelope.
377 +*/
377 378
378 379 /* message aborted */
379 380 extern sfsistat xxfi_abort __P((SMFICTX *));
380 381
381 382 /*
382 - * xxfi_abort(ctx) Invoked if message is aborted outside of the control of
383 - * the filter, for example, if the SMTP sender issues an RSET command. If
384 - * xxfi_abort is called, xxfi_eom will not be called and vice versa.
385 - */
383 +** xxfi_abort(ctx) Invoked if message is aborted outside of the control of
384 +** the filter, for example, if the SMTP sender issues an RSET command. If
385 +** xxfi_abort is called, xxfi_eom will not be called and vice versa.
386 +*/
386 387
387 388 /* connection cleanup */
388 389 extern sfsistat xxfi_close __P((SMFICTX *));
389 390
390 391 /*
391 - * xxfi_close(ctx) Invoked at end of the connection. This is called on
392 - * close even if the previous mail transaction was aborted.
393 - */
392 +** xxfi_close(ctx) Invoked at end of the connection. This is called on
393 +** close even if the previous mail transaction was aborted.
394 +*/
394 395 #endif /* 0 */
395 396
396 397 /*
397 - * Additional information is passed in to the vendor filter routines using
398 - * symbols. Symbols correspond closely to sendmail macros. The symbols
399 - * defined depend on the context. The value of a symbol is accessed using:
400 - */
398 +** Additional information is passed in to the vendor filter routines using
399 +** symbols. Symbols correspond closely to sendmail macros. The symbols
400 +** defined depend on the context. The value of a symbol is accessed using:
401 +*/
401 402
402 403 /* Return the value of a symbol. */
403 -LIBMILTER_API char *smfi_getsymval __P((SMFICTX *, char *));
404 +LIBMILTER_API char * smfi_getsymval __P((SMFICTX *, char *));
404 405
405 406 /*
406 - * Return the value of a symbol.
407 - *
408 - * SMFICTX *ctx; Opaque context structure
409 - * char *symname; The name of the symbol to access.
410 - */
407 +** Return the value of a symbol.
408 +**
409 +** SMFICTX *ctx; Opaque context structure
410 +** char *symname; The name of the symbol to access.
411 +*/
411 412
412 413 /*
413 - * Vendor filter routines that want to pass additional information back to
414 - * the MTA for use in SMTP replies may call smfi_setreply before returning.
415 - */
414 +** Vendor filter routines that want to pass additional information back to
415 +** the MTA for use in SMTP replies may call smfi_setreply before returning.
416 +*/
416 417
417 418 LIBMILTER_API int smfi_setreply __P((SMFICTX *, char *, char *, char *));
418 419
419 420 /*
420 - * Alternatively, smfi_setmlreply can be called if a multi-line SMTP reply
421 - * is needed.
422 - */
421 +** Alternatively, smfi_setmlreply can be called if a multi-line SMTP reply
422 +** is needed.
423 +*/
423 424
424 -LIBMILTER_API int smfi_setmlreply __P((SMFICTX *, const char *, const char *,
425 - ...));
425 +LIBMILTER_API int smfi_setmlreply __P((SMFICTX *, const char *, const char *, ...));
426 426
427 427 /*
428 - * Set the specific reply code to be used in response to the active
429 - * command. If not specified, a generic reply code is used.
430 - *
431 - * SMFICTX *ctx; Opaque context structure
432 - * char *rcode; The three-digit (RFC 821) SMTP reply code to be
433 - * returned, e.g., ``551''.
434 - * char *xcode; The extended (RFC 2034) reply code, e.g., ``5.7.6''.
435 - * char *message; The text part of the SMTP reply.
436 - */
428 +** Set the specific reply code to be used in response to the active
429 +** command. If not specified, a generic reply code is used.
430 +**
431 +** SMFICTX *ctx; Opaque context structure
432 +** char *rcode; The three-digit (RFC 821) SMTP reply code to be
433 +** returned, e.g., ``551''.
434 +** char *xcode; The extended (RFC 2034) reply code, e.g., ``5.7.6''.
435 +** char *message; The text part of the SMTP reply.
436 +*/
437 437
438 438 /*
439 - * The xxfi_eom routine is called at the end of a message (essentially,
440 - * after the final DATA dot). This routine can call some special routines
441 - * to modify the envelope, header, or body of the message before the
442 - * message is enqueued. These routines must not be called from any vendor
443 - * routine other than xxfi_eom.
444 - */
439 +** The xxfi_eom routine is called at the end of a message (essentially,
440 +** after the final DATA dot). This routine can call some special routines
441 +** to modify the envelope, header, or body of the message before the
442 +** message is enqueued. These routines must not be called from any vendor
443 +** routine other than xxfi_eom.
444 +*/
445 445
446 446 LIBMILTER_API int smfi_addheader __P((SMFICTX *, char *, char *));
447 447
448 448 /*
449 - * Add a header to the message. It is not checked for standards
450 - * compliance; the mail filter must ensure that no protocols are violated
451 - * as a result of adding this header.
452 - *
453 - * SMFICTX *ctx; Opaque context structure
454 - * char *headerf; Header field name
455 - * char *headerv; Header field value
456 - */
449 +** Add a header to the message. It is not checked for standards
450 +** compliance; the mail filter must ensure that no protocols are violated
451 +** as a result of adding this header.
452 +**
453 +** SMFICTX *ctx; Opaque context structure
454 +** char *headerf; Header field name
455 +** char *headerv; Header field value
456 +*/
457 457
458 458 LIBMILTER_API int smfi_chgheader __P((SMFICTX *, char *, int, char *));
459 459
460 460 /*
461 - * Change/delete a header in the message. It is not checked for standards
462 - * compliance; the mail filter must ensure that no protocols are violated
463 - * as a result of adding this header.
464 - *
465 - * SMFICTX *ctx; Opaque context structure
466 - * char *headerf; Header field name
467 - * int index; The Nth occurence of header field name
468 - * char *headerv; New header field value (empty for delete header)
469 - */
461 +** Change/delete a header in the message. It is not checked for standards
462 +** compliance; the mail filter must ensure that no protocols are violated
463 +** as a result of adding this header.
464 +**
465 +** SMFICTX *ctx; Opaque context structure
466 +** char *headerf; Header field name
467 +** int index; The Nth occurence of header field name
468 +** char *headerv; New header field value (empty for delete header)
469 +*/
470 470
471 471 LIBMILTER_API int smfi_insheader __P((SMFICTX *, int, char *, char *));
472 472
473 473 /*
474 - * Insert a header into the message. It is not checked for standards
475 - * compliance; the mail filter must ensure that no protocols are violated
476 - * as a result of adding this header.
477 - *
478 - * SMFICTX *ctx; Opaque context structure
479 - * int idx; index into the header list where the insertion should happen
480 - * char *headerh; Header field name
481 - * char *headerv; Header field value
482 - */
474 +** Insert a header into the message. It is not checked for standards
475 +** compliance; the mail filter must ensure that no protocols are violated
476 +** as a result of adding this header.
477 +**
478 +** SMFICTX *ctx; Opaque context structure
479 +** int idx; index into the header list where the insertion should happen
480 +** char *headerh; Header field name
481 +** char *headerv; Header field value
482 +*/
483 483
484 484 LIBMILTER_API int smfi_chgfrom __P((SMFICTX *, char *, char *));
485 485
486 486 /*
487 - * Modify envelope sender address
488 - *
489 - * SMFICTX *ctx; Opaque context structure
490 - * char *mail; New envelope sender address
491 - * char *args; ESMTP arguments
492 - */
487 +** Modify envelope sender address
488 +**
489 +** SMFICTX *ctx; Opaque context structure
490 +** char *mail; New envelope sender address
491 +** char *args; ESMTP arguments
492 +*/
493 493
494 494
495 495 LIBMILTER_API int smfi_addrcpt __P((SMFICTX *, char *));
496 496
497 497 /*
498 - * Add a recipient to the envelope
499 - *
500 - * SMFICTX *ctx; Opaque context structure
501 - * char *rcpt; Recipient to be added
502 - */
498 +** Add a recipient to the envelope
499 +**
500 +** SMFICTX *ctx; Opaque context structure
501 +** char *rcpt; Recipient to be added
502 +*/
503 503
504 504 LIBMILTER_API int smfi_addrcpt_par __P((SMFICTX *, char *, char *));
505 505
506 506 /*
507 - * Add a recipient to the envelope
508 - *
509 - * SMFICTX *ctx; Opaque context structure
510 - * char *rcpt; Recipient to be added
511 - * char *args; ESMTP arguments
512 - */
507 +** Add a recipient to the envelope
508 +**
509 +** SMFICTX *ctx; Opaque context structure
510 +** char *rcpt; Recipient to be added
511 +** char *args; ESMTP arguments
512 +*/
513 513
514 514
515 515 LIBMILTER_API int smfi_delrcpt __P((SMFICTX *, char *));
516 516
517 517 /*
518 - * Send a "no-op" up to the MTA to tell it we're still alive, so long
519 - * milter-side operations don't time out.
520 - *
521 - * SMFICTX *ctx; Opaque context structure
522 - */
518 +** Send a "no-op" up to the MTA to tell it we're still alive, so long
519 +** milter-side operations don't time out.
520 +**
521 +** SMFICTX *ctx; Opaque context structure
522 +*/
523 523
524 524 LIBMILTER_API int smfi_progress __P((SMFICTX *));
525 525
526 526 /*
527 - * Delete a recipient from the envelope
528 - *
529 - * SMFICTX *ctx; Opaque context structure
530 - * char *rcpt; Envelope recipient to be deleted. This should be in
531 - * exactly the form passed to xxfi_envrcpt or the address may
532 - * not be deleted.
533 - */
527 +** Delete a recipient from the envelope
528 +**
529 +** SMFICTX *ctx; Opaque context structure
530 +** char *rcpt; Envelope recipient to be deleted. This should be in
531 +** exactly the form passed to xxfi_envrcpt or the address may
532 +** not be deleted.
533 +*/
534 534
535 535 LIBMILTER_API int smfi_replacebody __P((SMFICTX *, unsigned char *, int));
536 536
537 537 /*
538 - * Replace the body of the message. This routine may be called multiple
539 - * times if the body is longer than convenient to send in one call. End of
540 - * line should be represented as Carriage-Return/Line Feed.
541 - *
542 - * char *bodyp; Pointer to block of body information to insert
543 - * int bodylen; Length of data pointed at by bodyp
544 - */
538 +** Replace the body of the message. This routine may be called multiple
539 +** times if the body is longer than convenient to send in one call. End of
540 +** line should be represented as Carriage-Return/Line Feed.
541 +**
542 +** char *bodyp; Pointer to block of body information to insert
543 +** int bodylen; Length of data pointed at by bodyp
544 +*/
545 545
546 546 /*
547 - * If the message is aborted (for example, if the SMTP sender sends the
548 - * envelope but then does a QUIT or RSET before the data is sent),
549 - * xxfi_abort is called. This can be used to reset state.
550 - */
547 +** If the message is aborted (for example, if the SMTP sender sends the
548 +** envelope but then does a QUIT or RSET before the data is sent),
549 +** xxfi_abort is called. This can be used to reset state.
550 +*/
551 551
552 552 /*
553 - * Quarantine an envelope
554 - *
555 - * SMFICTX *ctx; Opaque context structure
556 - * char *reason: explanation
557 - */
553 +** Quarantine an envelope
554 +**
555 +** SMFICTX *ctx; Opaque context structure
556 +** char *reason: explanation
557 +*/
558 558
559 559 LIBMILTER_API int smfi_quarantine __P((SMFICTX *ctx, char *reason));
560 560
561 561 /*
562 - * Connection-private data (specific to an SMTP connection) can be
563 - * allocated using the smfi_setpriv routine; routines can access private
564 - * data using smfi_getpriv.
565 - */
562 +** Connection-private data (specific to an SMTP connection) can be
563 +** allocated using the smfi_setpriv routine; routines can access private
564 +** data using smfi_getpriv.
565 +*/
566 566
567 567 LIBMILTER_API int smfi_setpriv __P((SMFICTX *, void *));
568 568
569 569 /*
570 - * Set the private data pointer
571 - *
572 - * SMFICTX *ctx; Opaque context structure
573 - * void *privatedata; Pointer to private data area
574 - */
570 +** Set the private data pointer
571 +**
572 +** SMFICTX *ctx; Opaque context structure
573 +** void *privatedata; Pointer to private data area
574 +*/
575 575
576 576 LIBMILTER_API void *smfi_getpriv __P((SMFICTX *));
577 577
578 578 /*
579 - * Get the private data pointer
580 - *
581 - * SMFICTX *ctx; Opaque context structure
582 - * void *privatedata; Pointer to private data area
583 - */
579 +** Get the private data pointer
580 +**
581 +** SMFICTX *ctx; Opaque context structure
582 +** void *privatedata; Pointer to private data area
583 +*/
584 584
585 585 LIBMILTER_API int smfi_setsymlist __P((SMFICTX *, int, char *));
586 586
587 587 /*
588 - * Set list of symbols (macros) to receive
589 - *
590 - * SMFICTX *ctx; Opaque context structure
591 - * int where; where in the SMTP dialogue should the macros be sent
592 - * char *macros; list of macros (space separated)
593 - */
588 +** Set list of symbols (macros) to receive
589 +**
590 +** SMFICTX *ctx; Opaque context structure
591 +** int where; where in the SMTP dialogue should the macros be sent
592 +** char *macros; list of macros (space separated)
593 +*/
594 594
595 595 #if _FFR_THREAD_MONITOR
596 596 LIBMILTER_API int smfi_set_max_exec_time __P((unsigned int));
597 597 #endif /* _FFR_THREAD_MONITOR */
598 598
599 599 #ifdef __cplusplus
600 600 }
601 -#endif
601 +#endif /* __cplusplus */
602 602
603 -#endif /* !_LIBMILTER_MFAPI_H */
603 +#endif /* ! _LIBMILTER_MFAPI_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX