X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/2c47372fad0f829ddfa29d04095f57a70206469c..7c576fcada992ef799700d2fd1a7753f40f1bb7a:/src/src/macros.h diff --git a/src/src/macros.h b/src/src/macros.h index 20e345573..5c2b0a443 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2017 */ +/* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -85,7 +85,7 @@ as unsigned. */ a no-op once an SSL session is in progress. */ #ifdef SUPPORT_TLS -#define mac_smtp_fflush() if (tls_in.active < 0) fflush(smtp_out); +#define mac_smtp_fflush() if (tls_in.active.sock < 0) fflush(smtp_out); #else #define mac_smtp_fflush() fflush(smtp_out); #endif @@ -469,9 +469,11 @@ enum { Li_outgoing_interface, Li_outgoing_port, Li_pid, + Li_pipelining, Li_proxy, Li_queue_time, Li_queue_time_overall, + Li_receive_time, Li_received_sender, Li_received_recipients, Li_rejected_header, @@ -549,6 +551,9 @@ table exim_errstrings[] in log.c */ #ifdef SUPPORT_I18N # define ERRNO_UTF8_FWD (-49) /* target not supporting SMTPUTF8 */ #endif +#if defined(SUPPORT_TLS) && defined(EXPERIMENTAL_REQUIRETLS) +# define ERRNO_REQUIRETLS (-50) /* REQUIRETLS session not started */ +#endif /* These must be last, so all retry deferments can easily be identified */ @@ -749,7 +754,12 @@ enum { hwhy_unknown, hwhy_retry, hwhy_insecure, hwhy_failed, hwhy_deferred, /* Domain lookup types for routers */ -enum { lk_default, lk_byname, lk_bydns }; +#define LK_DEFAULT BIT(0) +#define LK_BYNAME BIT(1) +#define LK_BYDNS BIT(2) /* those 3 should be mutually exclusive */ + +#define LK_IPV4_ONLY BIT(3) +#define LK_IPV4_PREFER BIT(4) /* Values for the self_code fields */ @@ -818,11 +828,14 @@ enum { /* Flags for host_find_bydns() */ -#define HOST_FIND_BY_SRV 0x0001 -#define HOST_FIND_BY_MX 0x0002 -#define HOST_FIND_BY_A 0x0004 -#define HOST_FIND_QUALIFY_SINGLE 0x0008 -#define HOST_FIND_SEARCH_PARENTS 0x0010 +#define HOST_FIND_BY_SRV BIT(0) +#define HOST_FIND_BY_MX BIT(1) +#define HOST_FIND_BY_A BIT(2) +#define HOST_FIND_BY_AAAA BIT(3) +#define HOST_FIND_QUALIFY_SINGLE BIT(4) +#define HOST_FIND_SEARCH_PARENTS BIT(5) +#define HOST_FIND_IPV4_FIRST BIT(6) +#define HOST_FIND_IPV4_ONLY BIT(7) /* Actions applied to specific messages. */ @@ -855,6 +868,7 @@ enum { #define topt_use_bdat 0x100 /* prepend chunks with RFC3030 BDAT header */ #define topt_output_string 0x200 /* create string rather than write to fd */ #define topt_continuation 0x400 /* do not reset buffer */ +#define topt_not_socket 0x800 /* cannot do socket-only syscalls */ /* Options for smtp_write_command */ @@ -944,6 +958,31 @@ enum { ACL_WHERE_RCPT, /* Some controls are for RCPT only */ ACL_WHERE_UNKNOWN /* Currently used by a ${acl:name} expansion */ }; +#define ACL_BIT_RCPT BIT(ACL_WHERE_RCPT) +#define ACL_BIT_MAIL BIT(ACL_WHERE_MAIL) +#define ACL_BIT_PREDATA BIT(ACL_WHERE_PREDATA) +#define ACL_BIT_MIME BIT(ACL_WHERE_MIME) +#define ACL_BIT_DKIM BIT(ACL_WHERE_DKIM) +#define ACL_BIT_DATA BIT(ACL_WHERE_DATA) +#ifndef DISABLE_PRDR +# define ACL_BIT_PRDR BIT(ACL_WHERE_PRDR) +#endif +#define ACL_BIT_NOTSMTP BIT(ACL_WHERE_NOTSMTP) +#define ACL_BIT_AUTH BIT(ACL_WHERE_AUTH) +#define ACL_BIT_CONNECT BIT(ACL_WHERE_CONNECT) +#define ACL_BIT_ETRN BIT(ACL_WHERE_ETRN) +#define ACL_BIT_EXPN BIT(ACL_WHERE_EXPN) +#define ACL_BIT_HELO BIT(ACL_WHERE_HELO) +#define ACL_BIT_MAILAUTH BIT(ACL_WHERE_MAILAUTH) +#define ACL_BIT_NOTSMTP_START BIT(ACL_WHERE_NOTSMTP_START) +#define ACL_BIT_NOTQUIT BIT(ACL_WHERE_NOTQUIT) +#define ACL_BIT_QUIT BIT(ACL_WHERE_QUIT) +#define ACL_BIT_STARTTLS BIT(ACL_WHERE_STARTTLS) +#define ACL_BIT_VRFY BIT(ACL_WHERE_VRFY) +#define ACL_BIT_DELIVERY BIT(ACL_WHERE_DELIVERY) +#define ACL_BIT_UNKNOWN BIT(ACL_WHERE_UNKNOWN) + + /* Situations for spool_write_header() */ enum { SW_RECEIVING, SW_DELIVERING, SW_MODIFYING }; @@ -979,6 +1018,11 @@ enum { FILTER_UNSET, FILTER_FORWARD, FILTER_EXIM, FILTER_SIEVE }; #define OPTION_PIPE BIT(5) #define OPTION_SIZE BIT(6) #define OPTION_CHUNKING BIT(7) +#define OPTION_REQUIRETLS BIT(8) + +/* Codes for tls_requiretls requests (usually by sender) */ + +#define REQUIRETLS_MSG BIT(0) /* REQUIRETLS onward use */ /* Argument for *_getc */ @@ -993,5 +1037,10 @@ enum { FILTER_UNSET, FILTER_FORWARD, FILTER_EXIM, FILTER_SIEVE }; #define UTF8_VERT_2DASH "\xE2\x95\x8E" +/* Options on tls_close */ +#define TLS_NO_SHUTDOWN 0 +#define TLS_SHUTDOWN_NOWAIT 1 +#define TLS_SHUTDOWN_WAIT 2 + /* End of macros.h */