xref: /freebsd/contrib/sendmail/include/libmilter/mfdef.h (revision c98323078dede7579020518ec84cdcb478e5c142)
1 /*
2  * Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
3  *	All rights reserved.
4  *
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.
8  *
9  *
10  *	$Id: mfdef.h,v 8.11.2.1 2002/11/11 23:22:28 ca Exp $
11  */
12 
13 /*
14 **  mfdef.h -- Global definitions for mail filter and MTA.
15 */
16 
17 #ifndef _LIBMILTER_MFDEF_H
18 # define _LIBMILTER_MFDEF_H	1
19 
20 /* Shared protocol constants */
21 # define MILTER_LEN_BYTES	4	/* length of 32 bit integer in bytes */
22 # define MILTER_OPTLEN	(MILTER_LEN_BYTES * 3) /* length of options */
23 # define MILTER_CHUNK_SIZE	65535	/* body chunk size */
24 
25 /* These apply to SMFIF_* flags */
26 #define SMFI_V1_ACTS	0x0000000FL	/* The actions of V1 filter */
27 #if _FFR_QUARANTINE
28 # define SMFI_V2_ACTS	0x0000003FL	/* The actions of V2 filter */
29 #else /* _FFR_QUARANTINE */
30 # define SMFI_V2_ACTS	0x0000001FL	/* The actions of V2 filter */
31 #endif /* _FFR_QUARANTINE */
32 #define SMFI_CURR_ACTS	SMFI_V2_ACTS	/* The current version */
33 
34 /* address families */
35 # define SMFIA_UNKNOWN		'U'	/* unknown */
36 # define SMFIA_UNIX		'L'	/* unix/local */
37 # define SMFIA_INET		'4'	/* inet */
38 # define SMFIA_INET6		'6'	/* inet6 */
39 
40 /* commands: don't use anything smaller than ' ' */
41 # define SMFIC_ABORT		'A'	/* Abort */
42 # define SMFIC_BODY		'B'	/* Body chunk */
43 # define SMFIC_CONNECT		'C'	/* Connection information */
44 # define SMFIC_MACRO		'D'	/* Define macro */
45 # define SMFIC_BODYEOB		'E'	/* final body chunk (End) */
46 # define SMFIC_HELO		'H'	/* HELO/EHLO */
47 # define SMFIC_HEADER		'L'	/* Header */
48 # define SMFIC_MAIL		'M'	/* MAIL from */
49 # define SMFIC_EOH		'N'	/* EOH */
50 # define SMFIC_OPTNEG		'O'	/* Option negotiation */
51 # define SMFIC_QUIT		'Q'	/* QUIT */
52 # define SMFIC_RCPT		'R'	/* RCPT to */
53 
54 /* actions (replies) */
55 # define SMFIR_ADDRCPT		'+'	/* add recipient */
56 # define SMFIR_DELRCPT		'-'	/* remove recipient */
57 # define SMFIR_ACCEPT		'a'	/* accept */
58 # define SMFIR_REPLBODY		'b'	/* replace body (chunk) */
59 # define SMFIR_CONTINUE		'c'	/* continue */
60 # define SMFIR_DISCARD		'd'	/* discard */
61 # define SMFIR_CHGHEADER	'm'	/* change header */
62 # define SMFIR_PROGRESS		'p'	/* progress */
63 # define SMFIR_REJECT		'r'	/* reject */
64 # define SMFIR_TEMPFAIL		't'	/* tempfail */
65 # if _FFR_MILTER_421
66 #  define SMFIR_SHUTDOWN	'4'	/* 421: shutdown (internal to MTA) */
67 # endif /* _FFR_MILTER_421 */
68 # define SMFIR_ADDHEADER	'h'	/* add header */
69 # define SMFIR_REPLYCODE	'y'	/* reply code etc */
70 # if _FFR_QUARANTINE
71 #  define SMFIR_QUARANTINE	'q'	/* quarantine */
72 # endif /* _FFR_QUARANTINE */
73 
74 /* What the MTA can send/filter wants in protocol */
75 # define SMFIP_NOCONNECT 0x00000001L	/* MTA should not send connect info */
76 # define SMFIP_NOHELO	0x00000002L	/* MTA should not send HELO info */
77 # define SMFIP_NOMAIL	0x00000004L	/* MTA should not send MAIL info */
78 # define SMFIP_NORCPT	0x00000008L	/* MTA should not send RCPT info */
79 # define SMFIP_NOBODY	0x00000010L	/* MTA should not send body */
80 # define SMFIP_NOHDRS	0x00000020L	/* MTA should not send headers */
81 # define SMFIP_NOEOH	0x00000040L	/* MTA should not send EOH */
82 
83 # define SMFI_V1_PROT	0x0000003FL	/* The protocol of V1 filter */
84 # define SMFI_V2_PROT	0x0000007FL	/* The protocol of V2 filter */
85 # define SMFI_CURR_PROT	SMFI_V2_PROT	/* The current version */
86 
87 #endif /* !_LIBMILTER_MFDEF_H */
88