1 /* $NetBSD: header_body_checks.h,v 1.3 2023/12/23 20:30:43 christos Exp $ */ 2 3 #ifndef _HBC_H_INCLUDED_ 4 #define _HBC_H_INCLUDED_ 5 6 /*++ 7 /* NAME 8 /* header_body_checks 3h 9 /* SUMMARY 10 /* delivery agent header/body checks 11 /* SYNOPSIS 12 /* #include <header_body_checks.h> 13 /* DESCRIPTION 14 /* .nf 15 16 /* 17 * Global library. 18 */ 19 #include <mime_state.h> 20 #include <maps.h> 21 22 /* 23 * Postfix < 2.5 compatibility. 24 */ 25 #ifndef MIME_HDR_FIRST 26 #define MIME_HDR_FIRST (1) 27 #define MIME_HDR_LAST (3) 28 #endif 29 30 /* 31 * External interface. 32 */ 33 typedef struct { 34 const char *map_class; /* parameter name */ 35 MAPS *maps; /* map handle */ 36 } HBC_MAP_INFO; 37 38 typedef struct { 39 void (*logger) (void *, const char *, const char *, const char *, const char *); 40 void (*prepend) (void *, int, const char *, ssize_t, off_t); 41 char *(*extend) (void *, const char *, ssize_t, const char *, const char *, const char *, ssize_t, off_t); 42 } HBC_CALL_BACKS; 43 44 typedef struct { 45 HBC_CALL_BACKS *call_backs; 46 HBC_MAP_INFO map_info[1]; /* actually, a bunch */ 47 } HBC_CHECKS; 48 49 #define HBC_CHECKS_STAT_IGNORE ((char *) 0) 50 #define HBC_CHECKS_STAT_ERROR (&hbc_checks_error) 51 #define HBC_CHECKS_STAT_UNKNOWN (&hbc_checks_unknown) 52 53 extern HBC_CHECKS *hbc_header_checks_create(const char *, const char *, 54 const char *, const char *, 55 const char *, const char *, 56 HBC_CALL_BACKS *); 57 extern HBC_CHECKS *hbc_body_checks_create(const char *, const char *, 58 HBC_CALL_BACKS *); 59 extern char *hbc_header_checks(void *, HBC_CHECKS *, int, const HEADER_OPTS *, 60 VSTRING *, off_t); 61 extern char *hbc_body_checks(void *, HBC_CHECKS *, const char *, ssize_t, off_t); 62 63 #define hbc_header_checks_free(hbc) _hbc_checks_free((hbc), HBC_HEADER_SIZE) 64 #define hbc_body_checks_free(hbc) _hbc_checks_free((hbc), 1) 65 66 /* 67 * The following are NOT part of the external API. 68 */ 69 #define HBC_HEADER_SIZE (MIME_HDR_LAST - MIME_HDR_FIRST + 1) 70 extern void _hbc_checks_free(HBC_CHECKS *, ssize_t); 71 extern char hbc_checks_error; 72 extern const char hbc_checks_unknown; 73 74 /* LICENSE 75 /* .ad 76 /* .fi 77 /* The Secure Mailer license must be distributed with this software. 78 /* AUTHOR(S) 79 /* Wietse Venema 80 /* IBM T.J. Watson Research 81 /* P.O. Box 704 82 /* Yorktown Heights, NY 10598, USA 83 /* 84 /* Wietse Venema 85 /* Google, Inc. 86 /* 111 8th Avenue 87 /* New York, NY 10011, USA 88 /*--*/ 89 90 #endif 91