]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/sendmail/include/libmilter/mfdef.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / sendmail / include / libmilter / mfdef.h
1 /*
2  * Copyright (c) 1999-2007 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.38 2007/03/27 18:53:48 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 #ifndef SMFI_PROT_VERSION
21 # define SMFI_PROT_VERSION      6       /* MTA - libmilter protocol version */
22 #endif /* SMFI_PROT_VERSION */
23
24 /* Shared protocol constants */
25 #define MILTER_LEN_BYTES        4       /* length of 32 bit integer in bytes */
26 #define MILTER_OPTLEN   (MILTER_LEN_BYTES * 3) /* length of options */
27 #define MILTER_CHUNK_SIZE       65535   /* body chunk size */
28 #define MILTER_MAX_DATA_SIZE    65535   /* default milter command data limit */
29
30 /* These apply to SMFIF_* flags */
31 #define SMFI_V1_ACTS    0x0000000FL     /* The actions of V1 filter */
32 #define SMFI_V2_ACTS    0x0000003FL     /* The actions of V2 filter */
33 #define SMFI_CURR_ACTS  0x000001FFL     /* actions of current version */
34
35 /* address families */
36 #define SMFIA_UNKNOWN           'U'     /* unknown */
37 #define SMFIA_UNIX              'L'     /* unix/local */
38 #define SMFIA_INET              '4'     /* inet */
39 #define SMFIA_INET6             '6'     /* inet6 */
40
41 /* commands: don't use anything smaller than ' ' */
42 #define SMFIC_ABORT             'A'     /* Abort */
43 #define SMFIC_BODY              'B'     /* Body chunk */
44 #define SMFIC_CONNECT           'C'     /* Connection information */
45 #define SMFIC_MACRO             'D'     /* Define macro */
46 #define SMFIC_BODYEOB           'E'     /* final body chunk (End) */
47 #define SMFIC_HELO              'H'     /* HELO/EHLO */
48 #define SMFIC_QUIT_NC           'K'     /* QUIT but new connection follows */
49 #define SMFIC_HEADER            'L'     /* Header */
50 #define SMFIC_MAIL              'M'     /* MAIL from */
51 #define SMFIC_EOH               'N'     /* EOH */
52 #define SMFIC_OPTNEG            'O'     /* Option negotiation */
53 #define SMFIC_QUIT              'Q'     /* QUIT */
54 #define SMFIC_RCPT              'R'     /* RCPT to */
55 #define SMFIC_DATA              'T'     /* DATA */
56 #define SMFIC_UNKNOWN           'U'     /* Any unknown command */
57
58 /* actions (replies) */
59 #define SMFIR_ADDRCPT           '+'     /* add recipient */
60 #define SMFIR_DELRCPT           '-'     /* remove recipient */
61 #define SMFIR_ADDRCPT_PAR       '2'     /* add recipient (incl. ESMTP args) */
62 #define SMFIR_SHUTDOWN          '4'     /* 421: shutdown (internal to MTA) */
63 #define SMFIR_ACCEPT            'a'     /* accept */
64 #define SMFIR_REPLBODY          'b'     /* replace body (chunk) */
65 #define SMFIR_CONTINUE          'c'     /* continue */
66 #define SMFIR_DISCARD           'd'     /* discard */
67 #define SMFIR_CHGFROM           'e'     /* change envelope sender (from) */
68 #define SMFIR_CONN_FAIL         'f'     /* cause a connection failure */
69 #define SMFIR_ADDHEADER         'h'     /* add header */
70 #define SMFIR_INSHEADER         'i'     /* insert header */
71 #define SMFIR_SETSYMLIST        'l'     /* set list of symbols (macros) */
72 #define SMFIR_CHGHEADER         'm'     /* change header */
73 #define SMFIR_PROGRESS          'p'     /* progress */
74 #define SMFIR_QUARANTINE        'q'     /* quarantine */
75 #define SMFIR_REJECT            'r'     /* reject */
76 #define SMFIR_SKIP              's'     /* skip */
77 #define SMFIR_TEMPFAIL          't'     /* tempfail */
78 #define SMFIR_REPLYCODE         'y'     /* reply code etc */
79
80 /* What the MTA can send/filter wants in protocol */
81 #define SMFIP_NOCONNECT 0x00000001L     /* MTA should not send connect info */
82 #define SMFIP_NOHELO    0x00000002L     /* MTA should not send HELO info */
83 #define SMFIP_NOMAIL    0x00000004L     /* MTA should not send MAIL info */
84 #define SMFIP_NORCPT    0x00000008L     /* MTA should not send RCPT info */
85 #define SMFIP_NOBODY    0x00000010L     /* MTA should not send body */
86 #define SMFIP_NOHDRS    0x00000020L     /* MTA should not send headers */
87 #define SMFIP_NOEOH     0x00000040L     /* MTA should not send EOH */
88 #define SMFIP_NR_HDR    0x00000080L     /* No reply for headers */
89 #define SMFIP_NOHREPL   SMFIP_NR_HDR    /* No reply for headers */
90 #define SMFIP_NOUNKNOWN 0x00000100L /* MTA should not send unknown commands */
91 #define SMFIP_NODATA    0x00000200L     /* MTA should not send DATA */
92 #define SMFIP_SKIP      0x00000400L     /* MTA understands SMFIS_SKIP */
93 #define SMFIP_RCPT_REJ  0x00000800L /* MTA should also send rejected RCPTs */
94 #define SMFIP_NR_CONN   0x00001000L     /* No reply for connect */
95 #define SMFIP_NR_HELO   0x00002000L     /* No reply for HELO */
96 #define SMFIP_NR_MAIL   0x00004000L     /* No reply for MAIL */
97 #define SMFIP_NR_RCPT   0x00008000L     /* No reply for RCPT */
98 #define SMFIP_NR_DATA   0x00010000L     /* No reply for DATA */
99 #define SMFIP_NR_UNKN   0x00020000L     /* No reply for UNKN */
100 #define SMFIP_NR_EOH    0x00040000L     /* No reply for eoh */
101 #define SMFIP_NR_BODY   0x00080000L     /* No reply for body chunk */
102 #define SMFIP_HDR_LEADSPC 0x00100000L   /* header value leading space */
103
104 #define SMFI_V1_PROT    0x0000003FL     /* The protocol of V1 filter */
105 #define SMFI_V2_PROT    0x0000007FL     /* The protocol of V2 filter */
106
107 /* all defined protocol bits */
108 #define SMFI_CURR_PROT  0x001FFFFFL
109
110 #endif /* !_LIBMILTER_MFDEF_H */