1N/A/*
1N/A * Copyright (c) 1999-2007 Sendmail, Inc. and its suppliers.
1N/A * All rights reserved.
1N/A *
1N/A * By using this file, you agree to the terms and conditions set
1N/A * forth in the LICENSE file which can be found at the top level of
1N/A * the sendmail distribution.
1N/A *
1N/A *
1N/A * $Id: mfdef.h,v 8.39 2009/11/06 00:57:08 ca Exp $
1N/A */
1N/A
1N/A/*
1N/A * mfdef.h -- Global definitions for mail filter and MTA.
1N/A */
1N/A
1N/A#ifndef _LIBMILTER_MFDEF_H
1N/A#define _LIBMILTER_MFDEF_H
1N/A
1N/A#ifdef __cplusplus
1N/Aextern "C" {
1N/A#endif
1N/A
1N/A#ifndef SMFI_PROT_VERSION
1N/A#define SMFI_PROT_VERSION 6 /* MTA - libmilter protocol version */
1N/A#endif /* SMFI_PROT_VERSION */
1N/A
1N/A/* Shared protocol constants */
1N/A#define MILTER_LEN_BYTES 4 /* length of 32 bit integer in bytes */
1N/A#define MILTER_OPTLEN (MILTER_LEN_BYTES * 3) /* length of options */
1N/A#define MILTER_CHUNK_SIZE 65535 /* body chunk size */
1N/A#define MILTER_MAX_DATA_SIZE 65535 /* default milter command data limit */
1N/A
1N/A#if _FFR_MDS_NEGOTIATE
1N/A#define MILTER_MDS_64K ((64 * 1024) - 1)
1N/A#define MILTER_MDS_256K ((256 * 1024) - 1)
1N/A#define MILTER_MDS_1M ((1024 * 1024) - 1)
1N/A#endif /* _FFR_MDS_NEGOTIATE */
1N/A
1N/A/* These apply to SMFIF_* flags */
1N/A#define SMFI_V1_ACTS 0x0000000FL /* The actions of V1 filter */
1N/A#define SMFI_V2_ACTS 0x0000003FL /* The actions of V2 filter */
1N/A#define SMFI_CURR_ACTS 0x000001FFL /* actions of current version */
1N/A
1N/A/* address families */
1N/A#define SMFIA_UNKNOWN 'U' /* unknown */
1N/A#define SMFIA_UNIX 'L' /* unix/local */
1N/A#define SMFIA_INET '4' /* inet */
1N/A#define SMFIA_INET6 '6' /* inet6 */
1N/A
1N/A/* commands: don't use anything smaller than ' ' */
1N/A#define SMFIC_ABORT 'A' /* Abort */
1N/A#define SMFIC_BODY 'B' /* Body chunk */
1N/A#define SMFIC_CONNECT 'C' /* Connection information */
1N/A#define SMFIC_MACRO 'D' /* Define macro */
1N/A#define SMFIC_BODYEOB 'E' /* final body chunk (End) */
1N/A#define SMFIC_HELO 'H' /* HELO/EHLO */
1N/A#define SMFIC_QUIT_NC 'K' /* QUIT but new connection follows */
1N/A#define SMFIC_HEADER 'L' /* Header */
1N/A#define SMFIC_MAIL 'M' /* MAIL from */
1N/A#define SMFIC_EOH 'N' /* EOH */
1N/A#define SMFIC_OPTNEG 'O' /* Option negotiation */
1N/A#define SMFIC_QUIT 'Q' /* QUIT */
1N/A#define SMFIC_RCPT 'R' /* RCPT to */
1N/A#define SMFIC_DATA 'T' /* DATA */
1N/A#define SMFIC_UNKNOWN 'U' /* Any unknown command */
1N/A
1N/A/* actions (replies) */
1N/A#define SMFIR_ADDRCPT '+' /* add recipient */
1N/A#define SMFIR_DELRCPT '-' /* remove recipient */
1N/A#define SMFIR_ADDRCPT_PAR '2' /* add recipient (incl. ESMTP args) */
1N/A#define SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */
1N/A#define SMFIR_ACCEPT 'a' /* accept */
1N/A#define SMFIR_REPLBODY 'b' /* replace body (chunk) */
1N/A#define SMFIR_CONTINUE 'c' /* continue */
1N/A#define SMFIR_DISCARD 'd' /* discard */
1N/A#define SMFIR_CHGFROM 'e' /* change envelope sender (from) */
1N/A#define SMFIR_CONN_FAIL 'f' /* cause a connection failure */
1N/A#define SMFIR_ADDHEADER 'h' /* add header */
1N/A#define SMFIR_INSHEADER 'i' /* insert header */
1N/A#define SMFIR_SETSYMLIST 'l' /* set list of symbols (macros) */
1N/A#define SMFIR_CHGHEADER 'm' /* change header */
1N/A#define SMFIR_PROGRESS 'p' /* progress */
1N/A#define SMFIR_QUARANTINE 'q' /* quarantine */
1N/A#define SMFIR_REJECT 'r' /* reject */
1N/A#define SMFIR_SKIP 's' /* skip */
1N/A#define SMFIR_TEMPFAIL 't' /* tempfail */
1N/A#define SMFIR_REPLYCODE 'y' /* reply code etc */
1N/A
1N/A/* What the MTA can send/filter wants in protocol */
1N/A#define SMFIP_NOCONNECT 0x00000001L /* MTA should not send connect info */
1N/A#define SMFIP_NOHELO 0x00000002L /* MTA should not send HELO info */
1N/A#define SMFIP_NOMAIL 0x00000004L /* MTA should not send MAIL info */
1N/A#define SMFIP_NORCPT 0x00000008L /* MTA should not send RCPT info */
1N/A#define SMFIP_NOBODY 0x00000010L /* MTA should not send body */
1N/A#define SMFIP_NOHDRS 0x00000020L /* MTA should not send headers */
1N/A#define SMFIP_NOEOH 0x00000040L /* MTA should not send EOH */
1N/A#define SMFIP_NR_HDR 0x00000080L /* No reply for headers */
1N/A#define SMFIP_NOHREPL SMFIP_NR_HDR /* No reply for headers */
1N/A#define SMFIP_NOUNKNOWN 0x00000100L /* MTA should not send unknown commands */
1N/A#define SMFIP_NODATA 0x00000200L /* MTA should not send DATA */
1N/A#define SMFIP_SKIP 0x00000400L /* MTA understands SMFIS_SKIP */
1N/A#define SMFIP_RCPT_REJ 0x00000800L /* MTA should also send rejected RCPTs */
1N/A#define SMFIP_NR_CONN 0x00001000L /* No reply for connect */
1N/A#define SMFIP_NR_HELO 0x00002000L /* No reply for HELO */
1N/A#define SMFIP_NR_MAIL 0x00004000L /* No reply for MAIL */
1N/A#define SMFIP_NR_RCPT 0x00008000L /* No reply for RCPT */
1N/A#define SMFIP_NR_DATA 0x00010000L /* No reply for DATA */
1N/A#define SMFIP_NR_UNKN 0x00020000L /* No reply for UNKN */
1N/A#define SMFIP_NR_EOH 0x00040000L /* No reply for eoh */
1N/A#define SMFIP_NR_BODY 0x00080000L /* No reply for body chunk */
1N/A#define SMFIP_HDR_LEADSPC 0x00100000L /* header value leading space */
1N/A#define SMFIP_MDS_256K 0x10000000L /* MILTER_MAX_DATA_SIZE=256K */
1N/A#define SMFIP_MDS_1M 0x20000000L /* MILTER_MAX_DATA_SIZE=1M */
1N/A/* #define SMFIP_ 0x40000000L reserved: see SMFI_INTERNAL */
1N/A
1N/A#define SMFI_V1_PROT 0x0000003FL /* The protocol of V1 filter */
1N/A#define SMFI_V2_PROT 0x0000007FL /* The protocol of V2 filter */
1N/A
1N/A/* all defined protocol bits */
1N/A#define SMFI_CURR_PROT 0x001FFFFFL
1N/A
1N/A/* internal flags: only used between MTA and libmilter */
1N/A#define SMFI_INTERNAL 0x70000000L
1N/A
1N/A#if _FFR_MILTER_CHECK
1N/A#define SMFIP_TEST 0x80000000L
1N/A#endif /* _FFR_MILTER_CHECK */
1N/A
1N/A#ifdef __cplusplus
1N/A}
1N/A#endif
1N/A
1N/A#endif /* !_LIBMILTER_MFDEF_H */