xref: /freebsd/contrib/sendmail/include/libmilter/mfdef.h (revision d0cef73d40a409e3116f095b83633b1364e95741)
140266059SGregory Neil Shapiro /*
2d0cef73dSGregory Neil Shapiro  * Copyright (c) 1999-2007 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  *
10d0cef73dSGregory Neil Shapiro  *	$Id: mfdef.h,v 8.38 2007/03/27 18:53:48 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 
20d0cef73dSGregory Neil Shapiro #ifndef SMFI_PROT_VERSION
21d0cef73dSGregory Neil Shapiro # define SMFI_PROT_VERSION	6	/* MTA - libmilter protocol version */
22d0cef73dSGregory Neil Shapiro #endif /* SMFI_PROT_VERSION */
23d0cef73dSGregory Neil Shapiro 
2440266059SGregory Neil Shapiro /* Shared protocol constants */
2540266059SGregory Neil Shapiro #define MILTER_LEN_BYTES	4	/* length of 32 bit integer in bytes */
2640266059SGregory Neil Shapiro #define MILTER_OPTLEN	(MILTER_LEN_BYTES * 3) /* length of options */
2740266059SGregory Neil Shapiro #define MILTER_CHUNK_SIZE	65535	/* body chunk size */
28e92d3f3fSGregory Neil Shapiro #define MILTER_MAX_DATA_SIZE	65535	/* default milter command data limit */
2940266059SGregory Neil Shapiro 
3040266059SGregory Neil Shapiro /* These apply to SMFIF_* flags */
3140266059SGregory Neil Shapiro #define SMFI_V1_ACTS	0x0000000FL	/* The actions of V1 filter */
3240266059SGregory Neil Shapiro #define SMFI_V2_ACTS	0x0000003FL	/* The actions of V2 filter */
33d0cef73dSGregory Neil Shapiro #define SMFI_CURR_ACTS	0x000001FFL	/* actions of current version */
3440266059SGregory Neil Shapiro 
3540266059SGregory Neil Shapiro /* address families */
3640266059SGregory Neil Shapiro #define SMFIA_UNKNOWN		'U'	/* unknown */
3740266059SGregory Neil Shapiro #define SMFIA_UNIX		'L'	/* unix/local */
3840266059SGregory Neil Shapiro #define SMFIA_INET		'4'	/* inet */
3940266059SGregory Neil Shapiro #define SMFIA_INET6		'6'	/* inet6 */
4040266059SGregory Neil Shapiro 
4140266059SGregory Neil Shapiro /* commands: don't use anything smaller than ' ' */
4240266059SGregory Neil Shapiro #define SMFIC_ABORT		'A'	/* Abort */
4340266059SGregory Neil Shapiro #define SMFIC_BODY		'B'	/* Body chunk */
4440266059SGregory Neil Shapiro #define SMFIC_CONNECT		'C'	/* Connection information */
4540266059SGregory Neil Shapiro #define SMFIC_MACRO		'D'	/* Define macro */
4640266059SGregory Neil Shapiro #define SMFIC_BODYEOB		'E'	/* final body chunk (End) */
4740266059SGregory Neil Shapiro #define SMFIC_HELO		'H'	/* HELO/EHLO */
48d0cef73dSGregory Neil Shapiro #define SMFIC_QUIT_NC		'K'	/* QUIT but new connection follows */
4940266059SGregory Neil Shapiro #define SMFIC_HEADER		'L'	/* Header */
5040266059SGregory Neil Shapiro #define SMFIC_MAIL		'M'	/* MAIL from */
5140266059SGregory Neil Shapiro #define SMFIC_EOH		'N'	/* EOH */
5240266059SGregory Neil Shapiro #define SMFIC_OPTNEG		'O'	/* Option negotiation */
5340266059SGregory Neil Shapiro #define SMFIC_QUIT		'Q'	/* QUIT */
5440266059SGregory Neil Shapiro #define SMFIC_RCPT		'R'	/* RCPT to */
55e92d3f3fSGregory Neil Shapiro #define SMFIC_DATA		'T'	/* DATA */
56e92d3f3fSGregory Neil Shapiro #define SMFIC_UNKNOWN		'U'	/* Any unknown command */
5740266059SGregory Neil Shapiro 
5840266059SGregory Neil Shapiro /* actions (replies) */
5940266059SGregory Neil Shapiro #define SMFIR_ADDRCPT		'+'	/* add recipient */
6040266059SGregory Neil Shapiro #define SMFIR_DELRCPT		'-'	/* remove recipient */
61d0cef73dSGregory Neil Shapiro #define SMFIR_ADDRCPT_PAR	'2'	/* add recipient (incl. ESMTP args) */
62d0cef73dSGregory Neil Shapiro #define SMFIR_SHUTDOWN		'4'	/* 421: shutdown (internal to MTA) */
6340266059SGregory Neil Shapiro #define SMFIR_ACCEPT		'a'	/* accept */
6440266059SGregory Neil Shapiro #define SMFIR_REPLBODY		'b'	/* replace body (chunk) */
6540266059SGregory Neil Shapiro #define SMFIR_CONTINUE		'c'	/* continue */
6640266059SGregory Neil Shapiro #define SMFIR_DISCARD		'd'	/* discard */
67d0cef73dSGregory Neil Shapiro #define SMFIR_CHGFROM		'e'	/* change envelope sender (from) */
684e4196cbSGregory Neil Shapiro #define SMFIR_CONN_FAIL		'f'	/* cause a connection failure */
6940266059SGregory Neil Shapiro #define SMFIR_ADDHEADER		'h'	/* add header */
70e92d3f3fSGregory Neil Shapiro #define SMFIR_INSHEADER		'i'	/* insert header */
71d0cef73dSGregory Neil Shapiro #define SMFIR_SETSYMLIST	'l'	/* set list of symbols (macros) */
72d0cef73dSGregory Neil Shapiro #define SMFIR_CHGHEADER		'm'	/* change header */
73d0cef73dSGregory Neil Shapiro #define SMFIR_PROGRESS		'p'	/* progress */
7440266059SGregory Neil Shapiro #define SMFIR_QUARANTINE	'q'	/* quarantine */
75d0cef73dSGregory Neil Shapiro #define SMFIR_REJECT		'r'	/* reject */
76d0cef73dSGregory Neil Shapiro #define SMFIR_SKIP		's'	/* skip */
77d0cef73dSGregory Neil Shapiro #define SMFIR_TEMPFAIL		't'	/* tempfail */
78d0cef73dSGregory Neil Shapiro #define SMFIR_REPLYCODE		'y'	/* reply code etc */
7940266059SGregory Neil Shapiro 
8040266059SGregory Neil Shapiro /* What the MTA can send/filter wants in protocol */
8140266059SGregory Neil Shapiro #define SMFIP_NOCONNECT 0x00000001L	/* MTA should not send connect info */
8240266059SGregory Neil Shapiro #define SMFIP_NOHELO	0x00000002L	/* MTA should not send HELO info */
8340266059SGregory Neil Shapiro #define SMFIP_NOMAIL	0x00000004L	/* MTA should not send MAIL info */
8440266059SGregory Neil Shapiro #define SMFIP_NORCPT	0x00000008L	/* MTA should not send RCPT info */
8540266059SGregory Neil Shapiro #define SMFIP_NOBODY	0x00000010L	/* MTA should not send body */
8640266059SGregory Neil Shapiro #define SMFIP_NOHDRS	0x00000020L	/* MTA should not send headers */
8740266059SGregory Neil Shapiro #define SMFIP_NOEOH	0x00000040L	/* MTA should not send EOH */
88d0cef73dSGregory Neil Shapiro #define SMFIP_NR_HDR	0x00000080L	/* No reply for headers */
89d0cef73dSGregory Neil Shapiro #define SMFIP_NOHREPL	SMFIP_NR_HDR	/* No reply for headers */
90d0cef73dSGregory Neil Shapiro #define SMFIP_NOUNKNOWN 0x00000100L /* MTA should not send unknown commands */
914e4196cbSGregory Neil Shapiro #define SMFIP_NODATA    0x00000200L	/* MTA should not send DATA */
92d0cef73dSGregory Neil Shapiro #define SMFIP_SKIP	0x00000400L	/* MTA understands SMFIS_SKIP */
93d0cef73dSGregory Neil Shapiro #define SMFIP_RCPT_REJ	0x00000800L /* MTA should also send rejected RCPTs */
94d0cef73dSGregory Neil Shapiro #define SMFIP_NR_CONN	0x00001000L	/* No reply for connect */
95d0cef73dSGregory Neil Shapiro #define SMFIP_NR_HELO	0x00002000L	/* No reply for HELO */
96d0cef73dSGregory Neil Shapiro #define SMFIP_NR_MAIL	0x00004000L	/* No reply for MAIL */
97d0cef73dSGregory Neil Shapiro #define SMFIP_NR_RCPT	0x00008000L	/* No reply for RCPT */
98d0cef73dSGregory Neil Shapiro #define SMFIP_NR_DATA	0x00010000L	/* No reply for DATA */
99d0cef73dSGregory Neil Shapiro #define SMFIP_NR_UNKN	0x00020000L	/* No reply for UNKN */
100d0cef73dSGregory Neil Shapiro #define SMFIP_NR_EOH	0x00040000L	/* No reply for eoh */
101d0cef73dSGregory Neil Shapiro #define SMFIP_NR_BODY	0x00080000L	/* No reply for body chunk */
102d0cef73dSGregory Neil Shapiro #define SMFIP_HDR_LEADSPC 0x00100000L	/* header value leading space */
10340266059SGregory Neil Shapiro 
10440266059SGregory Neil Shapiro #define SMFI_V1_PROT	0x0000003FL	/* The protocol of V1 filter */
10540266059SGregory Neil Shapiro #define SMFI_V2_PROT	0x0000007FL	/* The protocol of V2 filter */
1064e4196cbSGregory Neil Shapiro 
107d0cef73dSGregory Neil Shapiro /* all defined protocol bits */
108d0cef73dSGregory Neil Shapiro #define SMFI_CURR_PROT	0x001FFFFFL
10940266059SGregory Neil Shapiro 
11040266059SGregory Neil Shapiro #endif /* !_LIBMILTER_MFDEF_H */
111