xref: /freebsd/contrib/sendmail/include/libmilter/mfdef.h (revision e92d3f3ffe83a6ed7eaafac70da9cf4fafe13243)
140266059SGregory Neil Shapiro /*
2e92d3f3fSGregory Neil Shapiro  * Copyright (c) 1999-2004 Sendmail, Inc. and its suppliers.
340266059SGregory Neil Shapiro  *	All rights reserved.
440266059SGregory Neil Shapiro  *
540266059SGregory Neil Shapiro  * By using this file, you agree to the terms and conditions set
640266059SGregory Neil Shapiro  * forth in the LICENSE file which can be found at the top level of
740266059SGregory Neil Shapiro  * the sendmail distribution.
840266059SGregory Neil Shapiro  *
940266059SGregory Neil Shapiro  *
10e92d3f3fSGregory Neil Shapiro  *	$Id: mfdef.h,v 8.21 2004/07/07 21:41:31 ca Exp $
1140266059SGregory Neil Shapiro  */
1240266059SGregory Neil Shapiro 
1340266059SGregory Neil Shapiro /*
1440266059SGregory Neil Shapiro **  mfdef.h -- Global definitions for mail filter and MTA.
1540266059SGregory Neil Shapiro */
1640266059SGregory Neil Shapiro 
1740266059SGregory Neil Shapiro #ifndef _LIBMILTER_MFDEF_H
1840266059SGregory Neil Shapiro # define _LIBMILTER_MFDEF_H	1
1940266059SGregory Neil Shapiro 
2040266059SGregory Neil Shapiro /* Shared protocol constants */
2140266059SGregory Neil Shapiro # define MILTER_LEN_BYTES	4	/* length of 32 bit integer in bytes */
2240266059SGregory Neil Shapiro # define MILTER_OPTLEN	(MILTER_LEN_BYTES * 3) /* length of options */
2340266059SGregory Neil Shapiro # define MILTER_CHUNK_SIZE	65535	/* body chunk size */
24e92d3f3fSGregory Neil Shapiro # define MILTER_MAX_DATA_SIZE	65535	/* default milter command data limit */
2540266059SGregory Neil Shapiro 
2640266059SGregory Neil Shapiro /* These apply to SMFIF_* flags */
2740266059SGregory Neil Shapiro #define SMFI_V1_ACTS	0x0000000FL	/* The actions of V1 filter */
2840266059SGregory Neil Shapiro #define SMFI_V2_ACTS	0x0000003FL	/* The actions of V2 filter */
2940266059SGregory Neil Shapiro #define SMFI_CURR_ACTS	SMFI_V2_ACTS	/* The current version */
3040266059SGregory Neil Shapiro 
3140266059SGregory Neil Shapiro /* address families */
3240266059SGregory Neil Shapiro # define SMFIA_UNKNOWN		'U'	/* unknown */
3340266059SGregory Neil Shapiro # define SMFIA_UNIX		'L'	/* unix/local */
3440266059SGregory Neil Shapiro # define SMFIA_INET		'4'	/* inet */
3540266059SGregory Neil Shapiro # define SMFIA_INET6		'6'	/* inet6 */
3640266059SGregory Neil Shapiro 
3740266059SGregory Neil Shapiro /* commands: don't use anything smaller than ' ' */
3840266059SGregory Neil Shapiro # define SMFIC_ABORT		'A'	/* Abort */
3940266059SGregory Neil Shapiro # define SMFIC_BODY		'B'	/* Body chunk */
4040266059SGregory Neil Shapiro # define SMFIC_CONNECT		'C'	/* Connection information */
4140266059SGregory Neil Shapiro # define SMFIC_MACRO		'D'	/* Define macro */
4240266059SGregory Neil Shapiro # define SMFIC_BODYEOB		'E'	/* final body chunk (End) */
4340266059SGregory Neil Shapiro # define SMFIC_HELO		'H'	/* HELO/EHLO */
4440266059SGregory Neil Shapiro # define SMFIC_HEADER		'L'	/* Header */
4540266059SGregory Neil Shapiro # define SMFIC_MAIL		'M'	/* MAIL from */
4640266059SGregory Neil Shapiro # define SMFIC_EOH		'N'	/* EOH */
4740266059SGregory Neil Shapiro # define SMFIC_OPTNEG		'O'	/* Option negotiation */
4840266059SGregory Neil Shapiro # define SMFIC_QUIT		'Q'	/* QUIT */
4940266059SGregory Neil Shapiro # define SMFIC_RCPT		'R'	/* RCPT to */
50e92d3f3fSGregory Neil Shapiro # if SMFI_VERSION > 3
51e92d3f3fSGregory Neil Shapiro #  define SMFIC_DATA		'T'	/* DATA */
52e92d3f3fSGregory Neil Shapiro # endif /* SMFI_VERSION > 3 */
53e92d3f3fSGregory Neil Shapiro # if SMFI_VERSION > 2
54e92d3f3fSGregory Neil Shapiro #  define SMFIC_UNKNOWN		'U'	/* Any unknown command */
55e92d3f3fSGregory Neil Shapiro # endif /* SMFI_VERSION > 2 */
5640266059SGregory Neil Shapiro 
5740266059SGregory Neil Shapiro /* actions (replies) */
5840266059SGregory Neil Shapiro # define SMFIR_ADDRCPT		'+'	/* add recipient */
5940266059SGregory Neil Shapiro # define SMFIR_DELRCPT		'-'	/* remove recipient */
6040266059SGregory Neil Shapiro # define SMFIR_ACCEPT		'a'	/* accept */
6140266059SGregory Neil Shapiro # define SMFIR_REPLBODY		'b'	/* replace body (chunk) */
6240266059SGregory Neil Shapiro # define SMFIR_CONTINUE		'c'	/* continue */
6340266059SGregory Neil Shapiro # define SMFIR_DISCARD		'd'	/* discard */
6440266059SGregory Neil Shapiro # define SMFIR_CHGHEADER	'm'	/* change header */
6540266059SGregory Neil Shapiro # define SMFIR_PROGRESS		'p'	/* progress */
6640266059SGregory Neil Shapiro # define SMFIR_REJECT		'r'	/* reject */
6740266059SGregory Neil Shapiro # define SMFIR_TEMPFAIL		't'	/* tempfail */
6813bd1963SGregory Neil Shapiro # define SMFIR_SHUTDOWN		'4'	/* 421: shutdown (internal to MTA) */
6940266059SGregory Neil Shapiro # define SMFIR_ADDHEADER	'h'	/* add header */
70e92d3f3fSGregory Neil Shapiro # define SMFIR_INSHEADER	'i'	/* insert header */
7140266059SGregory Neil Shapiro # define SMFIR_REPLYCODE	'y'	/* reply code etc */
7240266059SGregory Neil Shapiro # define SMFIR_QUARANTINE	'q'	/* quarantine */
7340266059SGregory Neil Shapiro 
7440266059SGregory Neil Shapiro /* What the MTA can send/filter wants in protocol */
7540266059SGregory Neil Shapiro # define SMFIP_NOCONNECT 0x00000001L	/* MTA should not send connect info */
7640266059SGregory Neil Shapiro # define SMFIP_NOHELO	0x00000002L	/* MTA should not send HELO info */
7740266059SGregory Neil Shapiro # define SMFIP_NOMAIL	0x00000004L	/* MTA should not send MAIL info */
7840266059SGregory Neil Shapiro # define SMFIP_NORCPT	0x00000008L	/* MTA should not send RCPT info */
7940266059SGregory Neil Shapiro # define SMFIP_NOBODY	0x00000010L	/* MTA should not send body */
8040266059SGregory Neil Shapiro # define SMFIP_NOHDRS	0x00000020L	/* MTA should not send headers */
8140266059SGregory Neil Shapiro # define SMFIP_NOEOH	0x00000040L	/* MTA should not send EOH */
82e92d3f3fSGregory Neil Shapiro # if _FFR_MILTER_NOHDR_RESP
83e92d3f3fSGregory Neil Shapiro #  define SMFIP_NOHREPL  0x00000080L	/* No reply for headers */
84e92d3f3fSGregory Neil Shapiro # endif /* _FFR_MILTER_NOHDR_RESP */
8540266059SGregory Neil Shapiro 
8640266059SGregory Neil Shapiro # define SMFI_V1_PROT	0x0000003FL	/* The protocol of V1 filter */
8740266059SGregory Neil Shapiro # define SMFI_V2_PROT	0x0000007FL	/* The protocol of V2 filter */
88e92d3f3fSGregory Neil Shapiro # if _FFR_MILTER_NOHDR_RESP
89e92d3f3fSGregory Neil Shapiro #  define SMFI_CURR_PROT 0x000000FFL	/* The current version */
90e92d3f3fSGregory Neil Shapiro # else /* _FFR_MILTER_NOHDR_RESP */
9140266059SGregory Neil Shapiro #  define SMFI_CURR_PROT SMFI_V2_PROT	/* The current version */
92e92d3f3fSGregory Neil Shapiro # endif /* _FFR_MILTER_NOHDR_RESP */
9340266059SGregory Neil Shapiro 
9440266059SGregory Neil Shapiro #endif /* !_LIBMILTER_MFDEF_H */
95