2 * Copyright (c) 1999-2004 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.
10 * $Id: mfdef.h,v 8.21 2004/07/07 21:41:31 ca Exp $
14 ** mfdef.h -- Global definitions for mail filter and MTA.
17 #ifndef _LIBMILTER_MFDEF_H
18 # define _LIBMILTER_MFDEF_H 1
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 # define MILTER_MAX_DATA_SIZE 65535 /* default milter command data limit */
26 /* These apply to SMFIF_* flags */
27 #define SMFI_V1_ACTS 0x0000000FL /* The actions of V1 filter */
28 #define SMFI_V2_ACTS 0x0000003FL /* The actions of V2 filter */
29 #define SMFI_CURR_ACTS SMFI_V2_ACTS /* The current version */
31 /* address families */
32 # define SMFIA_UNKNOWN 'U' /* unknown */
33 # define SMFIA_UNIX 'L' /* unix/local */
34 # define SMFIA_INET '4' /* inet */
35 # define SMFIA_INET6 '6' /* inet6 */
37 /* commands: don't use anything smaller than ' ' */
38 # define SMFIC_ABORT 'A' /* Abort */
39 # define SMFIC_BODY 'B' /* Body chunk */
40 # define SMFIC_CONNECT 'C' /* Connection information */
41 # define SMFIC_MACRO 'D' /* Define macro */
42 # define SMFIC_BODYEOB 'E' /* final body chunk (End) */
43 # define SMFIC_HELO 'H' /* HELO/EHLO */
44 # define SMFIC_HEADER 'L' /* Header */
45 # define SMFIC_MAIL 'M' /* MAIL from */
46 # define SMFIC_EOH 'N' /* EOH */
47 # define SMFIC_OPTNEG 'O' /* Option negotiation */
48 # define SMFIC_QUIT 'Q' /* QUIT */
49 # define SMFIC_RCPT 'R' /* RCPT to */
51 # define SMFIC_DATA 'T' /* DATA */
52 # endif /* SMFI_VERSION > 3 */
54 # define SMFIC_UNKNOWN 'U' /* Any unknown command */
55 # endif /* SMFI_VERSION > 2 */
57 /* actions (replies) */
58 # define SMFIR_ADDRCPT '+' /* add recipient */
59 # define SMFIR_DELRCPT '-' /* remove recipient */
60 # define SMFIR_ACCEPT 'a' /* accept */
61 # define SMFIR_REPLBODY 'b' /* replace body (chunk) */
62 # define SMFIR_CONTINUE 'c' /* continue */
63 # define SMFIR_DISCARD 'd' /* discard */
64 # define SMFIR_CHGHEADER 'm' /* change header */
65 # define SMFIR_PROGRESS 'p' /* progress */
66 # define SMFIR_REJECT 'r' /* reject */
67 # define SMFIR_TEMPFAIL 't' /* tempfail */
68 # define SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */
69 # define SMFIR_ADDHEADER 'h' /* add header */
70 # define SMFIR_INSHEADER 'i' /* insert header */
71 # define SMFIR_REPLYCODE 'y' /* reply code etc */
72 # define SMFIR_QUARANTINE 'q' /* quarantine */
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 # if _FFR_MILTER_NOHDR_RESP
83 # define SMFIP_NOHREPL 0x00000080L /* No reply for headers */
84 # endif /* _FFR_MILTER_NOHDR_RESP */
86 # define SMFI_V1_PROT 0x0000003FL /* The protocol of V1 filter */
87 # define SMFI_V2_PROT 0x0000007FL /* The protocol of V2 filter */
88 # if _FFR_MILTER_NOHDR_RESP
89 # define SMFI_CURR_PROT 0x000000FFL /* The current version */
90 # else /* _FFR_MILTER_NOHDR_RESP */
91 # define SMFI_CURR_PROT SMFI_V2_PROT /* The current version */
92 # endif /* _FFR_MILTER_NOHDR_RESP */
94 #endif /* !_LIBMILTER_MFDEF_H */