/*++ /* NAME /* header_body_checks 3 /* SUMMARY /* header/body checks /* SYNOPSIS /* #include <header_body_checks.h> /* /* typedef struct { /* void (*logger) (void *context, const char *action, /* const char *where, const char *line, /* const char *optional_text); /* void (*prepend) (void *context, int rec_type, /* const char *buf, ssize_t len, off_t offset); /* char *(*extend) (void *context, const char *command, /* ssize_t cmd_len, const char *cmd_args, /* const char *where, const char *line, /* ssize_t line_len, off_t offset); /* } HBC_CALL_BACKS; /* /* HBC_CHECKS *hbc_header_checks_create( /* header_checks_name, header_checks_value /* mime_header_checks_name, mime_header_checks_value, /* nested_header_checks_name, nested_header_checks_value, /* call_backs) /* const char *header_checks_name; /* const char *header_checks_value; /* const char *mime_header_checks_name; /* const char *mime_header_checks_value; /* const char *nested_header_checks_name; /* const char *nested_header_checks_value; /* HBC_CALL_BACKS *call_backs; /* /* HBC_CHECKS *hbc_body_checks_create( /* body_checks_name, body_checks_value, /* call_backs) /* const char *body_checks_name; /* const char *body_checks_value; /* HBC_CALL_BACKS *call_backs; /* /* char *hbc_header_checks(context, hbc, header_class, hdr_opts, header) /* void *context; /* HBC_CHECKS *hbc; /* int header_class; /* const HEADER_OPTS *hdr_opts; /* VSTRING *header; /* /* char *hbc_body_checks(context, hbc, body_line, body_line_len) /* void *context; /* HBC_CHECKS *hbc; /* const char *body_line; /* ssize_t body_line_len; /* /* void hbc_header_checks_free(hbc) /* HBC_CHECKS *hbc; /* /* void hbc_body_checks_free(hbc) /* HBC_CHECKS *hbc; /* DESCRIPTION /* This module implements header_checks and body_checks. /* Actions are executed while mail is being delivered. The /* following actions are recognized: INFO, WARN, REPLACE, /* PREPEND, IGNORE, DUNNO, and OK. These actions are safe for /* use in delivery agents. /* /* Other actions may be supplied via the extension mechanism /* described below. For example, actions that change the /* message delivery time or destination. Such actions do not /* make sense in delivery agents, but they can be appropriate /* in, for example, before-queue filters. /* /* hbc_header_checks_create() creates a context for header /* inspection. This function is typically called once during /* program initialization. The result is a null pointer when /* all _value arguments specify zero-length strings; in this /* case, hbc_header_checks() and hbc_header_checks_free() must /* not be called. /* /* hbc_header_checks() inspects the specified logical header. /* The result is either the original header, HBC_CHECKS_STAT_IGNORE /* (meaning: discard the header), HBC_CHECKS_STAT_ERROR, or a /* new header (meaning: replace the header and destroy the new /* header with myfree()). /* /* hbc_header_checks_free() returns memory to the pool. /* /* hbc_body_checks_create(), hbc_body_checks(), hbc_body_free() /* perform similar functions for body lines. /* /* Arguments: /* .IP body_line /* One line of body text. /* .IP body_line_len /* Body line length. /* .IP call_backs /* Table with call-back function pointers. This argument is /* not copied. Note: the description below is not necessarily /* in data structure order. /* .RS /* .IP logger /* Call-back function for logging an action with the action's /* name in lower case, a location within a message ("header" /* or "body"), the content of the header or body line that /* triggered the action, and optional text or a zero-length /* string. This call-back feature must be specified. /* .IP prepend /* Call-back function for the PREPEND action. The arguments /* are the same as those of mime_state(3) body output call-back /* functions. Specify a null pointer to disable this action. /* .IP extend /* Call-back function that logs and executes other actions. /* This function receives as arguments the command name and /* name length, the command arguments if any, the location /* within the message ("header" or "body"), the content and /* length of the header or body line that triggered the action, /* and the input byte offset within the current header or body /* segment. The result value is either the original line /* argument, HBC_CHECKS_STAT_IGNORE (delete the line from the /* input stream) or HBC_CHECKS_STAT_UNKNOWN (the command was /* not recognized). Specify a null pointer to disable this /* feature. /* .RE /* .IP context /* Application context for call-back functions specified with the /* call_backs argument. /* .IP header /* A logical message header. Lines within a multi-line header /* are separated by a newline character. /* .IP "header_checks_name, mime_header_checks_name" /* .IP "nested_header_checks_name, body_checks_name" /* The main.cf configuration parameter names for header and body /* map lists. /* .IP "header_checks_value, mime_header_checks_value" /* .IP "nested_header_checks_value, body_checks_value" /* The values of main.cf configuration parameters for header and body /* map lists. Specify a zero-length string to disable a specific list. /* .IP header_class /* A number in the range MIME_HDR_FIRST..MIME_HDR_LAST. /* .IP hbc /* A handle created with hbc_header_checks_create() or /* hbc_body_checks_create(). /* .IP hdr_opts /* Message header properties. /* SEE ALSO /* msg(3) diagnostics interface /* DIAGNOSTICS /* Fatal errors: memory allocation problem. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /* /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
/* *Errorreporting.
*/ if (err & MIME_ERR_TRUNC_HEADER)
msg_warn("message header length exceeds safety limit"); if (err & MIME_ERR_NESTING)
msg_warn("MIME nesting exceeds safety limit"); if (err & MIME_ERR_8BIT_IN_HEADER)
msg_warn("improper use of 8-bit data in message header"); if (err & MIME_ERR_8BIT_IN_7BIT_BODY)
msg_warn("improper use of 8-bit data in message body"); if (err & MIME_ERR_ENCODING_DOMAIN)
msg_warn("improper message/* or multipart/* encoding domain");
/* *Cleanup.
*/ if (context.header_checks)
hbc_header_checks_free(context.header_checks); if (context.body_checks)
hbc_body_checks_free(context.body_checks);
vstring_free(context.buf);
mime_state_free(mime_state);
vstring_free(buf); exit(0);
}
#endif
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.