Postfix3.3.1
|
#include <sys_defs.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <limits.h>
#include <msg.h>
#include <mymalloc.h>
#include <split_at.h>
#include <connect.h>
#include <argv.h>
#include <name_mask.h>
#include <name_code.h>
#include <stringops.h>
#include <compat_va_copy.h>
#include <mail_params.h>
#include <mail_proto.h>
#include <rec_type.h>
#include <record.h>
#include <mime_state.h>
#include <is_header.h>
#include <milter.h>
データ構造 | |
struct | MILTER8 |
struct | MILTER_MSG_CONTEXT |
マクロ定義 | |
#define | SHUT_RDWR 2 |
#define | SMFIC_ABORT 'A' /* Abort */ |
#define | SMFIC_BODY 'B' /* Body chunk */ |
#define | SMFIC_CONNECT 'C' /* Connection information */ |
#define | SMFIC_MACRO 'D' /* Define macro */ |
#define | SMFIC_BODYEOB 'E' /* final body chunk (End) */ |
#define | SMFIC_HELO 'H' /* HELO/EHLO */ |
#define | SMFIC_HEADER 'L' /* Header */ |
#define | SMFIC_MAIL 'M' /* MAIL from */ |
#define | SMFIC_EOH 'N' /* EOH */ |
#define | SMFIC_OPTNEG 'O' /* Option negotiation */ |
#define | SMFIC_QUIT 'Q' /* QUIT */ |
#define | SMFIC_RCPT 'R' /* RCPT to */ |
#define | SMFIC_DATA 'T' /* DATA */ |
#define | SMFIC_UNKNOWN 'U' /* Any unknown command */ |
#define | SMFIC_QUIT_NC 'K' /* Quit + new connection */ |
#define | SMFIR_ADDRCPT '+' /* add recipient */ |
#define | SMFIR_DELRCPT '-' /* remove recipient */ |
#define | SMFIR_ACCEPT 'a' /* accept */ |
#define | SMFIR_REPLBODY 'b' /* replace body (chunk) */ |
#define | SMFIR_CONTINUE 'c' /* continue */ |
#define | SMFIR_DISCARD 'd' /* discard */ |
#define | SMFIR_CONN_FAIL 'f' /* cause a connection failure */ |
#define | SMFIR_CHGHEADER 'm' /* change header */ |
#define | SMFIR_PROGRESS 'p' /* progress */ |
#define | SMFIR_REJECT 'r' /* reject */ |
#define | SMFIR_TEMPFAIL 't' /* tempfail */ |
#define | SMFIR_SHUTDOWN '4' /* 421: shutdown (internal to MTA) */ |
#define | SMFIR_ADDHEADER 'h' /* add header */ |
#define | SMFIR_INSHEADER 'i' /* insert header */ |
#define | SMFIR_REPLYCODE 'y' /* reply code etc */ |
#define | SMFIR_QUARANTINE 'q' /* quarantine */ |
#define | SMFIR_SKIP 's' /* skip further events of this type */ |
#define | SMFIR_CHGFROM 'e' /* change sender (incl. ESMTP args) */ |
#define | SMFIR_ADDRCPT_PAR '2' /* add recipient (incl. ESMTP args) */ |
#define | SMFIR_SETSYMLIST 'l' /* set list of symbols (macros) */ |
#define | SMFIP_NOCONNECT (1L<<0) /* filter does not want connect info */ |
#define | SMFIP_NOHELO (1L<<1) /* filter does not want HELO info */ |
#define | SMFIP_NOMAIL (1L<<2) /* filter does not want MAIL info */ |
#define | SMFIP_NORCPT (1L<<3) /* filter does not want RCPT info */ |
#define | SMFIP_NOBODY (1L<<4) /* filter does not want body */ |
#define | SMFIP_NOHDRS (1L<<5) /* filter does not want headers */ |
#define | SMFIP_NOEOH (1L<<6) /* filter does not want EOH */ |
#define | SMFIP_NR_HDR (1L<<7) /* filter won't reply for header */ |
#define | SMFIP_NOHREPL SMFIP_NR_HDR |
#define | SMFIP_NOUNKNOWN (1L<<8) /* filter does not want unknown cmd */ |
#define | SMFIP_NODATA (1L<<9) /* filter does not want DATA */ |
#define | SMFIP_SKIP (1L<<10)/* MTA supports SMFIR_SKIP */ |
#define | SMFIP_RCPT_REJ (1L<<11)/* filter wants rejected RCPTs */ |
#define | SMFIP_NR_CONN (1L<<12)/* filter won't reply for connect */ |
#define | SMFIP_NR_HELO (1L<<13)/* filter won't reply for HELO */ |
#define | SMFIP_NR_MAIL (1L<<14)/* filter won't reply for MAIL */ |
#define | SMFIP_NR_RCPT (1L<<15)/* filter won't reply for RCPT */ |
#define | SMFIP_NR_DATA (1L<<16)/* filter won't reply for DATA */ |
#define | SMFIP_NR_UNKN (1L<<17)/* filter won't reply for UNKNOWN */ |
#define | SMFIP_NR_EOH (1L<<18)/* filter won't reply for eoh */ |
#define | SMFIP_NR_BODY (1L<<19)/* filter won't reply for body chunk */ |
#define | SMFIP_HDR_LEADSPC (1L<<20)/* header value has leading space */ |
#define | SMFIP_NOSEND_MASK |
#define | SMFIP_NOREPLY_MASK |
#define | SMFIF_ADDHDRS (1L<<0) /* filter may add headers */ |
#define | SMFIF_CHGBODY (1L<<1) /* filter may replace body */ |
#define | SMFIF_ADDRCPT (1L<<2) /* filter may add recipients */ |
#define | SMFIF_DELRCPT (1L<<3) /* filter may delete recipients */ |
#define | SMFIF_CHGHDRS (1L<<4) /* filter may change/delete headers */ |
#define | SMFIF_QUARANTINE (1L<<5) /* filter may quarantine envelope */ |
#define | SMFIF_CHGFROM (1L<<6) /* filter may replace sender */ |
#define | SMFIF_ADDRCPT_PAR (1L<<7) /* filter may add recipients + args */ |
#define | SMFIF_SETSYMLIST (1L<<8) /* filter may send macro names */ |
#define | SMFIA_UNKNOWN 'U' /* unknown */ |
#define | SMFIA_UNIX 'L' /* unix/local */ |
#define | SMFIA_INET '4' /* inet */ |
#define | SMFIA_INET6 '6' /* inet6 */ |
#define | SMFIM_CONNECT 0 /* macros for connect */ |
#define | SMFIM_HELO 1 /* macros for HELO */ |
#define | SMFIM_ENVFROM 2 /* macros for MAIL */ |
#define | SMFIM_ENVRCPT 3 /* macros for RCPT */ |
#define | SMFIM_DATA 4 /* macros for DATA */ |
#define | SMFIM_EOM 5 /* macros for end-of-message */ |
#define | SMFIM_EOH 6 /* macros for end-of-header */ |
#define | MILTER8_MACRO_PTR(__macros, __class) ((char **) (((char *) (__macros)) + milter8_macro_offsets[(__class)])) |
#define | MILTER_CHUNK_SIZE 65535 /* body chunk size */ |
#define | LIBMILTER_AUTO_DISCONNECT |
#define | MILTER8_STAT_ERROR 1 /* error, must be non-zero */ |
#define | MILTER8_STAT_CLOSED 2 /* no connection */ |
#define | MILTER8_STAT_READY 3 /* wait for connect event */ |
#define | MILTER8_STAT_ENVELOPE 4 /* in envelope */ |
#define | MILTER8_STAT_MESSAGE 5 /* in message */ |
#define | MILTER8_STAT_ACCEPT_CON 6 /* accept all commands */ |
#define | MILTER8_STAT_ACCEPT_MSG 7 /* accept one message */ |
#define | MILTER8_STAT_REJECT_CON 8 /* reject all commands */ |
#define | MILTER8_DATA_END 0 /* no more arguments */ |
#define | MILTER8_DATA_HLONG 1 /* host long */ |
#define | MILTER8_DATA_BUFFER 2 /* network-formatted buffer */ |
#define | MILTER8_DATA_STRING 3 /* null-terminated string */ |
#define | MILTER8_DATA_NSHORT 4 /* network short */ |
#define | MILTER8_DATA_ARGV 5 /* array of null-terminated strings */ |
#define | MILTER8_DATA_OCTET 6 /* byte */ |
#define | MILTER8_DATA_MORE 7 /* more arguments in next call */ |
#define | XXX_MAX_DATA (INT_MAX / 2) |
#define | XXX_TIMEOUT 10 |
#define | MILTER8_V2_PROTO_MASK |
#define | MILTER8_V3_PROTO_MASK (MILTER8_V2_PROTO_MASK | SMFIP_NOUNKNOWN) |
#define | MILTER8_V4_PROTO_MASK (MILTER8_V3_PROTO_MASK | SMFIP_NODATA) |
#define | MILTER8_V6_PROTO_MASK |
#define | STR(x) vstring_str(x) |
#define | LEN(x) VSTRING_LEN(x) |
#define | DONT_SKIP_REPLY 0 |
#define | IN_CONNECT_EVENT(e) ((e) == SMFIC_CONNECT || (e) == SMFIC_HELO) |
#define | MILTER8_EVENT_BREAK(s) |
#define | MILTER8_HDR_SPACE(m) (((m)->ev_mask & SMFIP_HDR_LEADSPC) ? "" : " ") |
#define | FREE_TRANSPORT_AND_BAIL_OUT(milter, milter_error) |
#define | XXX_UNKNOWN "unknown" |
#define | STR_EQ(x, y) (strcmp((x), (y)) == 0) |
#define | STR_NE(x, y) (strcmp((x), (y)) != 0) |
#define | MILTER8_MESSAGE_DONE(milter, msg_ctx) ((milter)->state != MILTER8_STAT_MESSAGE || (msg_ctx)->resp != 0) |
#define | MAIL_ATTR_MILT_NAME "milter_name" |
#define | MAIL_ATTR_MILT_VERS "milter_version" |
#define | MAIL_ATTR_MILT_ACTS "milter_actions" |
#define | MAIL_ATTR_MILT_EVTS "milter_events" |
#define | MAIL_ATTR_MILT_NPTS "milter_non_events" |
#define | MAIL_ATTR_MILT_STAT "milter_state" |
#define | MAIL_ATTR_MILT_CONN "milter_conn_timeout" |
#define | MAIL_ATTR_MILT_CMD "milter_cmd_timeout" |
#define | MAIL_ATTR_MILT_MSG "milter_msg_timeout" |
#define | MAIL_ATTR_MILT_ACT "milter_action" |
#define | MAIL_ATTR_MILT_MAC "milter_macro_list" |
#define | FREE_MACROS_AND_RETURN(x) |
#define | NO_PROTOCOL ((char *) 0) |
関数 | |
MILTER * | milter8_receive (VSTREAM *stream, MILTERS *parent) |
MILTER * | milter8_create (const char *name, int conn_timeout, int cmd_timeout, int msg_timeout, const char *protocol, const char *def_action, MILTERS *parent) |
#define DONT_SKIP_REPLY 0 |
#define FREE_MACROS_AND_RETURN | ( | x | ) |
#define FREE_TRANSPORT_AND_BAIL_OUT | ( | milter, | |
milter_error | |||
) |
#define IN_CONNECT_EVENT | ( | e | ) | ((e) == SMFIC_CONNECT || (e) == SMFIC_HELO) |
#define LEN | ( | x | ) | VSTRING_LEN(x) |
#define MILTER8_HDR_SPACE | ( | m | ) | (((m)->ev_mask & SMFIP_HDR_LEADSPC) ? "" : " ") |
#define MILTER8_MACRO_PTR | ( | __macros, | |
__class | |||
) | ((char **) (((char *) (__macros)) + milter8_macro_offsets[(__class)])) |
#define MILTER8_MESSAGE_DONE | ( | milter, | |
msg_ctx | |||
) | ((milter)->state != MILTER8_STAT_MESSAGE || (msg_ctx)->resp != 0) |
#define MILTER8_V2_PROTO_MASK |
#define MILTER8_V3_PROTO_MASK (MILTER8_V2_PROTO_MASK | SMFIP_NOUNKNOWN) |
#define MILTER8_V4_PROTO_MASK (MILTER8_V3_PROTO_MASK | SMFIP_NODATA) |
#define MILTER8_V6_PROTO_MASK |
#define NO_PROTOCOL ((char *) 0) |
#define SMFIF_ADDRCPT_PAR (1L<<7) /* filter may add recipients + args */ |
#define SMFIP_NOHREPL SMFIP_NR_HDR |
#define SMFIP_NOREPLY_MASK |
#define SMFIP_NOSEND_MASK |
#define STR | ( | x | ) | vstring_str(x) |
#define STR_EQ | ( | x, | |
y | |||
) | (strcmp((x), (y)) == 0) |
#define STR_NE | ( | x, | |
y | |||
) | (strcmp((x), (y)) != 0) |
#define XXX_UNKNOWN "unknown" |