140266059SGregory Neil Shapiro /* 24e4196cbSGregory Neil Shapiro * Copyright (c) 1999-2005 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 * 104e4196cbSGregory Neil Shapiro * $Id: mfdef.h,v 8.22 2005/08/05 21:49:04 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 */ 644e4196cbSGregory Neil Shapiro # define SMFIR_CONN_FAIL 'f' /* cause a connection failure */ 6540266059SGregory Neil Shapiro # define SMFIR_CHGHEADER 'm' /* change header */ 6640266059SGregory Neil Shapiro # define SMFIR_PROGRESS 'p' /* progress */ 6740266059SGregory Neil Shapiro # define SMFIR_REJECT 'r' /* reject */ 6840266059SGregory Neil Shapiro # define SMFIR_TEMPFAIL 't' /* tempfail */ 6913bd1963SGregory Neil Shapiro # define SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */ 7040266059SGregory Neil Shapiro # define SMFIR_ADDHEADER 'h' /* add header */ 71e92d3f3fSGregory Neil Shapiro # define SMFIR_INSHEADER 'i' /* insert header */ 7240266059SGregory Neil Shapiro # define SMFIR_REPLYCODE 'y' /* reply code etc */ 7340266059SGregory Neil Shapiro # define SMFIR_QUARANTINE 'q' /* quarantine */ 7440266059SGregory Neil Shapiro 7540266059SGregory Neil Shapiro /* What the MTA can send/filter wants in protocol */ 7640266059SGregory Neil Shapiro # define SMFIP_NOCONNECT 0x00000001L /* MTA should not send connect info */ 7740266059SGregory Neil Shapiro # define SMFIP_NOHELO 0x00000002L /* MTA should not send HELO info */ 7840266059SGregory Neil Shapiro # define SMFIP_NOMAIL 0x00000004L /* MTA should not send MAIL info */ 7940266059SGregory Neil Shapiro # define SMFIP_NORCPT 0x00000008L /* MTA should not send RCPT info */ 8040266059SGregory Neil Shapiro # define SMFIP_NOBODY 0x00000010L /* MTA should not send body */ 8140266059SGregory Neil Shapiro # define SMFIP_NOHDRS 0x00000020L /* MTA should not send headers */ 8240266059SGregory Neil Shapiro # define SMFIP_NOEOH 0x00000040L /* MTA should not send EOH */ 83e92d3f3fSGregory Neil Shapiro # if _FFR_MILTER_NOHDR_RESP 84e92d3f3fSGregory Neil Shapiro # define SMFIP_NOHREPL 0x00000080L /* No reply for headers */ 85e92d3f3fSGregory Neil Shapiro # endif /* _FFR_MILTER_NOHDR_RESP */ 864e4196cbSGregory Neil Shapiro # define SMFIP_NOUNKNOWN 0x00000100L /* MTA should not send unknown command */ 874e4196cbSGregory Neil Shapiro # define SMFIP_NODATA 0x00000200L /* MTA should not send DATA */ 8840266059SGregory Neil Shapiro 8940266059SGregory Neil Shapiro # define SMFI_V1_PROT 0x0000003FL /* The protocol of V1 filter */ 9040266059SGregory Neil Shapiro # define SMFI_V2_PROT 0x0000007FL /* The protocol of V2 filter */ 914e4196cbSGregory Neil Shapiro 924e4196cbSGregory Neil Shapiro /* Note: the "current" version is now determined dynamically in milter.c */ 93e92d3f3fSGregory Neil Shapiro # if _FFR_MILTER_NOHDR_RESP 944e4196cbSGregory Neil Shapiro # define SMFI_CURR_PROT 0x000000FFL 95e92d3f3fSGregory Neil Shapiro # else /* _FFR_MILTER_NOHDR_RESP */ 964e4196cbSGregory Neil Shapiro # define SMFI_CURR_PROT SMFI_V2_PROT 97e92d3f3fSGregory Neil Shapiro # endif /* _FFR_MILTER_NOHDR_RESP */ 9840266059SGregory Neil Shapiro 9940266059SGregory Neil Shapiro #endif /* !_LIBMILTER_MFDEF_H */ 100