xref: /freebsd/contrib/sendmail/include/libmilter/mfdef.h (revision 4026605903c0ab8df33c4ae8c419acdb2b652af8)
140266059SGregory Neil Shapiro /*
240266059SGregory Neil Shapiro  * Copyright (c) 1999-2001 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  *
1040266059SGregory Neil Shapiro  *	$Id: mfdef.h,v 8.11 2001/09/12 18:02:19 gshapiro 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 */
2440266059SGregory Neil Shapiro 
2540266059SGregory Neil Shapiro /* These apply to SMFIF_* flags */
2640266059SGregory Neil Shapiro #define SMFI_V1_ACTS	0x0000000FL	/* The actions of V1 filter */
2740266059SGregory Neil Shapiro #if _FFR_QUARANTINE
2840266059SGregory Neil Shapiro # define SMFI_V2_ACTS	0x0000003FL	/* The actions of V2 filter */
2940266059SGregory Neil Shapiro #else /* _FFR_QUARANTINE */
3040266059SGregory Neil Shapiro # define SMFI_V2_ACTS	0x0000001FL	/* The actions of V2 filter */
3140266059SGregory Neil Shapiro #endif /* _FFR_QUARANTINE */
3240266059SGregory Neil Shapiro #define SMFI_CURR_ACTS	SMFI_V2_ACTS	/* The current version */
3340266059SGregory Neil Shapiro 
3440266059SGregory Neil Shapiro /* address families */
3540266059SGregory Neil Shapiro # define SMFIA_UNKNOWN		'U'	/* unknown */
3640266059SGregory Neil Shapiro # define SMFIA_UNIX		'L'	/* unix/local */
3740266059SGregory Neil Shapiro # define SMFIA_INET		'4'	/* inet */
3840266059SGregory Neil Shapiro # define SMFIA_INET6		'6'	/* inet6 */
3940266059SGregory Neil Shapiro 
4040266059SGregory Neil Shapiro /* commands: don't use anything smaller than ' ' */
4140266059SGregory Neil Shapiro # define SMFIC_ABORT		'A'	/* Abort */
4240266059SGregory Neil Shapiro # define SMFIC_BODY		'B'	/* Body chunk */
4340266059SGregory Neil Shapiro # define SMFIC_CONNECT		'C'	/* Connection information */
4440266059SGregory Neil Shapiro # define SMFIC_MACRO		'D'	/* Define macro */
4540266059SGregory Neil Shapiro # define SMFIC_BODYEOB		'E'	/* final body chunk (End) */
4640266059SGregory Neil Shapiro # define SMFIC_HELO		'H'	/* HELO/EHLO */
4740266059SGregory Neil Shapiro # define SMFIC_HEADER		'L'	/* Header */
4840266059SGregory Neil Shapiro # define SMFIC_MAIL		'M'	/* MAIL from */
4940266059SGregory Neil Shapiro # define SMFIC_EOH		'N'	/* EOH */
5040266059SGregory Neil Shapiro # define SMFIC_OPTNEG		'O'	/* Option negotiation */
5140266059SGregory Neil Shapiro # define SMFIC_QUIT		'Q'	/* QUIT */
5240266059SGregory Neil Shapiro # define SMFIC_RCPT		'R'	/* RCPT to */
5340266059SGregory Neil Shapiro 
5440266059SGregory Neil Shapiro /* actions (replies) */
5540266059SGregory Neil Shapiro # define SMFIR_ADDRCPT		'+'	/* add recipient */
5640266059SGregory Neil Shapiro # define SMFIR_DELRCPT		'-'	/* remove recipient */
5740266059SGregory Neil Shapiro # define SMFIR_ACCEPT		'a'	/* accept */
5840266059SGregory Neil Shapiro # define SMFIR_REPLBODY		'b'	/* replace body (chunk) */
5940266059SGregory Neil Shapiro # define SMFIR_CONTINUE		'c'	/* continue */
6040266059SGregory Neil Shapiro # define SMFIR_DISCARD		'd'	/* discard */
6140266059SGregory Neil Shapiro # define SMFIR_CHGHEADER	'm'	/* change header */
6240266059SGregory Neil Shapiro # define SMFIR_PROGRESS		'p'	/* progress */
6340266059SGregory Neil Shapiro # define SMFIR_REJECT		'r'	/* reject */
6440266059SGregory Neil Shapiro # define SMFIR_TEMPFAIL		't'	/* tempfail */
6540266059SGregory Neil Shapiro # define SMFIR_ADDHEADER	'h'	/* add header */
6640266059SGregory Neil Shapiro # define SMFIR_REPLYCODE	'y'	/* reply code etc */
6740266059SGregory Neil Shapiro # if _FFR_QUARANTINE
6840266059SGregory Neil Shapiro #  define SMFIR_QUARANTINE	'q'	/* quarantine */
6940266059SGregory Neil Shapiro # endif /* _FFR_QUARANTINE */
7040266059SGregory Neil Shapiro 
7140266059SGregory Neil Shapiro /* What the MTA can send/filter wants in protocol */
7240266059SGregory Neil Shapiro # define SMFIP_NOCONNECT 0x00000001L	/* MTA should not send connect info */
7340266059SGregory Neil Shapiro # define SMFIP_NOHELO	0x00000002L	/* MTA should not send HELO info */
7440266059SGregory Neil Shapiro # define SMFIP_NOMAIL	0x00000004L	/* MTA should not send MAIL info */
7540266059SGregory Neil Shapiro # define SMFIP_NORCPT	0x00000008L	/* MTA should not send RCPT info */
7640266059SGregory Neil Shapiro # define SMFIP_NOBODY	0x00000010L	/* MTA should not send body */
7740266059SGregory Neil Shapiro # define SMFIP_NOHDRS	0x00000020L	/* MTA should not send headers */
7840266059SGregory Neil Shapiro # define SMFIP_NOEOH	0x00000040L	/* MTA should not send EOH */
7940266059SGregory Neil Shapiro 
8040266059SGregory Neil Shapiro # define SMFI_V1_PROT	0x0000003FL	/* The protocol of V1 filter */
8140266059SGregory Neil Shapiro # define SMFI_V2_PROT	0x0000007FL	/* The protocol of V2 filter */
8240266059SGregory Neil Shapiro # define SMFI_CURR_PROT	SMFI_V2_PROT	/* The current version */
8340266059SGregory Neil Shapiro 
8440266059SGregory Neil Shapiro #endif /* !_LIBMILTER_MFDEF_H */
85