mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-22 01:49:47 +00:00
postfix-3.10-20241010
This commit is contained in:
parent
a269182156
commit
a5b1b93841
@ -28341,3 +28341,56 @@ Apologies for any names omitted.
|
|||||||
|
|
||||||
Cleanup (no code change): regenerated HTML manpages that
|
Cleanup (no code change): regenerated HTML manpages that
|
||||||
weren't updated because of a simplistic make(1) dependency.
|
weren't updated because of a simplistic make(1) dependency.
|
||||||
|
|
||||||
|
20241010
|
||||||
|
|
||||||
|
Cleanup (no code change): reformatted source files that
|
||||||
|
diverged from Postfix style, complicating code maintenance.
|
||||||
|
The only object file change is in tls_dane.o, because
|
||||||
|
OPENSSL_free() has a line number argument. Other object
|
||||||
|
files are unchanged. Files: bounce/bounce_notify_util_tester.c,
|
||||||
|
bounce/bounce_one_service.c, cleanup/cleanup.c,
|
||||||
|
cleanup/cleanup_api.c, cleanup/cleanup_envelope.c,
|
||||||
|
cleanup/cleanup_out_recipient.c, cleanup/cleanup_rewrite.c,
|
||||||
|
dns/dns.h, dns/dns_lookup.c, dns/dns_rr_filter.c, dns/dns_sec.c,
|
||||||
|
global/bounce_log.h, global/cleanup_user.h, global/clnt_stream.h,
|
||||||
|
global/compat_level.c, global/compat_level.h, global/conv_time.c,
|
||||||
|
global/db_common.h, global/dot_lockfile_as.c,
|
||||||
|
global/header_body_checks.c, global/info_log_addr_form.c,
|
||||||
|
global/is_header.c, global/mail_addr_map.c,
|
||||||
|
global/mail_command_server.c, global/mail_conf.c,
|
||||||
|
global/mail_conf_raw.c, global/mail_conf_str.c, global/mail_copy.c,
|
||||||
|
global/mail_params.c, global/mail_proto.h, global/mail_queue.h,
|
||||||
|
global/mail_trigger.c, global/maillog_client.c,
|
||||||
|
global/mkmap_proxy.c, global/own_inet_addr.c,
|
||||||
|
global/quote_821_local.c, global/quote_821_local.h,
|
||||||
|
global/quote_822_local.c, global/quote_822_local.h,
|
||||||
|
global/rec_type.h, global/recdump.c, global/sent.h,
|
||||||
|
global/server_acl.c, global/smtputf8.c, global/smtputf8.h,
|
||||||
|
global/tok822_tree.c, global/user_acl.h,
|
||||||
|
global/valid_mailhost_addr.c, global/xtext.c, local/alias.c,
|
||||||
|
local/command.c, master/master.c, master/master.h,
|
||||||
|
master/master_listen.c, master/master_proto.h,
|
||||||
|
master/master_service.c, master/master_watch.c, milter/milter8.c,
|
||||||
|
milter/test-milter.c, oqmgr/qmgr_active.c, oqmgr/qmgr_entry.c,
|
||||||
|
pipe/pipe.c, postfix/postfix.c, postscreen/postscreen_dnsbl.c,
|
||||||
|
posttls-finger/posttls-finger.c, qmgr/qmgr_active.c,
|
||||||
|
qmgr/qmgr_entry.c, qmqpd/qmqpd_peer.c, smtp/smtp.h,
|
||||||
|
smtp/smtp_addr.c, smtp/smtp_tlsrpt.c, smtp/smtp_unalias.c,
|
||||||
|
smtpd/smtpd_milter.h, smtpd/smtpd_resolve.h, tls/tls_client.c,
|
||||||
|
tls/tls_dane.c, tls/tls_dh.c, tls/tls_misc.c,
|
||||||
|
tls/tls_proxy_client_print.c, tls/tls_server.c, util/alldig.c,
|
||||||
|
util/argv_split.c, util/balpar.c, util/byte_mask.c,
|
||||||
|
util/cidr_match.h, util/dict.h, util/dict_cdb.h,
|
||||||
|
util/dict_stream.c, util/dup2_pass_on_exec.c, util/duplex_pipe.c,
|
||||||
|
util/exec_command.c, util/find_inet.c, util/format_tv.c,
|
||||||
|
util/hash_fnv.c, util/host_port.c, util/inet_addr_sizes.c,
|
||||||
|
util/inet_connect.c, util/load_file.h, util/load_lib.h,
|
||||||
|
util/mac_expand.h, util/midna_domain.h, util/mkmap_cdb.c,
|
||||||
|
util/mvect.c, util/myaddrinfo.h, util/name_mask.c,
|
||||||
|
util/open_limit.c, util/parse_utf8_char.h, util/posix_signals.c,
|
||||||
|
util/sane_strtol.c, util/set_eugid.c, util/slmdb.c,
|
||||||
|
util/sock_addr.c, util/strcasecmp.c, util/stream_connect.c,
|
||||||
|
util/stream_recv_fd.c, util/stream_test.c,
|
||||||
|
util/unix_dgram_connect.c, util/unix_dgram_listen.c,
|
||||||
|
util/vbuf.c.
|
||||||
|
@ -1652,3 +1652,4 @@ mailto
|
|||||||
ipaddr
|
ipaddr
|
||||||
STS
|
STS
|
||||||
hs
|
hs
|
||||||
|
ccformat
|
||||||
|
@ -133,3 +133,8 @@ proto proto mysql_table proto pgsql_table proto ldap_table
|
|||||||
Files src tls tls h src tls tls_dh c src tls tls_misc c
|
Files src tls tls h src tls tls_dh c src tls tls_misc c
|
||||||
proto TLSRPT_README html proto postconf proto smtp smtp c
|
proto TLSRPT_README html proto postconf proto smtp smtp c
|
||||||
proto aliases cleanup cleanup c local local c smtpd smtpd c
|
proto aliases cleanup cleanup c local local c smtpd smtpd c
|
||||||
|
bounce bounce_one_service c cleanup cleanup c
|
||||||
|
dns dns h dns dns_lookup c dns dns_rr_filter c dns dns_sec c
|
||||||
|
local command c master master c master master h
|
||||||
|
pipe pipe c postfix postfix c postscreen postscreen_dnsbl c
|
||||||
|
qmgr qmgr_entry c qmqpd qmqpd_peer c smtp smtp h
|
||||||
|
@ -60,7 +60,7 @@ static void test_driver(int argc, char **argv)
|
|||||||
if (chdir(var_queue_dir) < 0)
|
if (chdir(var_queue_dir) < 0)
|
||||||
msg_fatal("chdir %s: %m", var_queue_dir);
|
msg_fatal("chdir %s: %m", var_queue_dir);
|
||||||
|
|
||||||
bounce_hfrom_format =
|
bounce_hfrom_format =
|
||||||
hfrom_format_parse(VAR_HFROM_FORMAT, var_hfrom_format);
|
hfrom_format_parse(VAR_HFROM_FORMAT, var_hfrom_format);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -218,7 +218,7 @@ int bounce_one_service(int flags, char *queue_name, char *queue_id,
|
|||||||
#define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE (notify_mask & MAIL_ERROR_BOUNCE)
|
#define SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE (notify_mask & MAIL_ERROR_BOUNCE)
|
||||||
|
|
||||||
if (bounce_status == 0 && SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE
|
if (bounce_status == 0 && SEND_POSTMASTER_SINGLE_BOUNCE_NOTICE
|
||||||
&& strcasecmp_utf8(orig_sender, mail_addr_double_bounce()) != 0) {
|
&& strcasecmp_utf8(orig_sender, mail_addr_double_bounce()) != 0) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send the text with reason for the bounce, and the headers of
|
* Send the text with reason for the bounce, and the headers of
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
/* .IP \(bu
|
/* .IP \(bu
|
||||||
/* Eliminate duplicate envelope recipient addresses.
|
/* Eliminate duplicate envelope recipient addresses.
|
||||||
/* .br
|
/* .br
|
||||||
/* This is enabled with the \fBduplicate_filter_limit\fR
|
/* This is enabled with the \fBduplicate_filter_limit\fR
|
||||||
/* parameter setting.
|
/* parameter setting.
|
||||||
/* .IP \(bu
|
/* .IP \(bu
|
||||||
/* Remove message headers: \fBBcc\fR, \fBContent-Length\fR,
|
/* Remove message headers: \fBBcc\fR, \fBContent-Length\fR,
|
||||||
|
@ -261,8 +261,8 @@ int cleanup_flush(CLEANUP_STATE *state)
|
|||||||
* (mail submitted with the Postfix sendmail command, mail forwarded by
|
* (mail submitted with the Postfix sendmail command, mail forwarded by
|
||||||
* the local(8) delivery agent, or mail re-queued with "postsuper -r"),
|
* the local(8) delivery agent, or mail re-queued with "postsuper -r"),
|
||||||
* send a bounce notification, reset the error flags in case of success,
|
* send a bounce notification, reset the error flags in case of success,
|
||||||
* and request deletion of the incoming queue file and of the
|
* and request deletion of the incoming queue file and of the optional
|
||||||
* optional DSN SUCCESS records from virtual alias expansion.
|
* DSN SUCCESS records from virtual alias expansion.
|
||||||
*
|
*
|
||||||
* XXX It would make no sense to knowingly report success after we already
|
* XXX It would make no sense to knowingly report success after we already
|
||||||
* have bounced all recipients, especially because the information in the
|
* have bounced all recipients, especially because the information in the
|
||||||
|
@ -385,7 +385,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type == REC_TYPE_FROM) {
|
if (type == REC_TYPE_FROM) {
|
||||||
off_t after_sender_offs;
|
off_t after_sender_offs;
|
||||||
|
|
||||||
/* Allow only one instance. */
|
/* Allow only one instance. */
|
||||||
if (state->sender != 0) {
|
if (state->sender != 0) {
|
||||||
|
@ -218,9 +218,9 @@ void cleanup_out_recipient(CLEANUP_STATE *state,
|
|||||||
* in the expansion because that results in multiple verify(8) updates
|
* in the expansion because that results in multiple verify(8) updates
|
||||||
* for one verify(8) request.
|
* for one verify(8) request.
|
||||||
*
|
*
|
||||||
* Multiple verify(8) updates for one verify(8) request would overwrite
|
* Multiple verify(8) updates for one verify(8) request would overwrite each
|
||||||
* each other's status, and if the last status update is "undeliverable",
|
* other's status, and if the last status update is "undeliverable", then
|
||||||
* then the whole alias is flagged as undeliverable.
|
* the whole alias is flagged as undeliverable.
|
||||||
*/
|
*/
|
||||||
else {
|
else {
|
||||||
RECIPIENT rcpt;
|
RECIPIENT rcpt;
|
||||||
|
@ -90,7 +90,7 @@ int cleanup_rewrite_external(const char *context_name, VSTRING *result,
|
|||||||
|
|
||||||
/* cleanup_rewrite_tree - rewrite address node */
|
/* cleanup_rewrite_tree - rewrite address node */
|
||||||
|
|
||||||
int cleanup_rewrite_tree(const char *context_name, TOK822 *tree)
|
int cleanup_rewrite_tree(const char *context_name, TOK822 *tree)
|
||||||
{
|
{
|
||||||
VSTRING *dst = vstring_alloc(100);
|
VSTRING *dst = vstring_alloc(100);
|
||||||
VSTRING *src = vstring_alloc(100);
|
VSTRING *src = vstring_alloc(100);
|
||||||
|
@ -165,8 +165,8 @@ typedef struct DNS_RR {
|
|||||||
unsigned short flags; /* DNS_RR_FLAG_XX, see below */
|
unsigned short flags; /* DNS_RR_FLAG_XX, see below */
|
||||||
struct DNS_RR *next; /* linkage */
|
struct DNS_RR *next; /* linkage */
|
||||||
size_t data_len; /* actual data size */
|
size_t data_len; /* actual data size */
|
||||||
char *data; /* a bunch of data */
|
char *data; /* a bunch of data */
|
||||||
/* Add new fields at the end, for ABI forward compatibility. */
|
/* Add new fields at the end, for ABI forward compatibility. */
|
||||||
} DNS_RR;
|
} DNS_RR;
|
||||||
|
|
||||||
#define DNS_RR_FLAG_TRUNCATED (1<<0)
|
#define DNS_RR_FLAG_TRUNCATED (1<<0)
|
||||||
|
@ -838,7 +838,7 @@ static int dns_get_rr(DNS_RR **list, const char *orig_name, DNS_REPLY *reply,
|
|||||||
msg_info("frag_len=%d text=\"%.*s\"",
|
msg_info("frag_len=%d text=\"%.*s\"",
|
||||||
(int) frag_len, (int) frag_len, (char *) src);
|
(int) frag_len, (int) frag_len, (char *) src);
|
||||||
if (frag_len > reply->end - src
|
if (frag_len > reply->end - src
|
||||||
|| frag_len >= ((unsigned char *) ltemp + sizeof(ltemp)) - dst) {
|
|| frag_len >= ((unsigned char *) ltemp + sizeof(ltemp)) - dst) {
|
||||||
msg_warn("extract_answer: bad TXT string length: %d", frag_len);
|
msg_warn("extract_answer: bad TXT string length: %d", frag_len);
|
||||||
return (DNS_RETRY);
|
return (DNS_RETRY);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ static DNS_RR *dns_rr_action(const char *cmd, DNS_RR *rr, const char *rr_text)
|
|||||||
msg_info("ignoring DNS RR: %s", rr_text);
|
msg_info("ignoring DNS RR: %s", rr_text);
|
||||||
return (0);
|
return (0);
|
||||||
} else {
|
} else {
|
||||||
msg_warn("%s: unknown DNS filter action: \"%s\"",
|
msg_warn("%s: unknown DNS filter action: \"%s\"",
|
||||||
dns_rr_filter_maps->title, cmd);
|
dns_rr_filter_maps->title, cmd);
|
||||||
return (dns_rr_filter_error);
|
return (dns_rr_filter_error);
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ void dns_sec_probe(int rflags)
|
|||||||
default:
|
default:
|
||||||
if (!DNS_SEC_STATS_TEST(DNS_SEC_FLAG_AVAILABLE))
|
if (!DNS_SEC_STATS_TEST(DNS_SEC_FLAG_AVAILABLE))
|
||||||
msg_warn("reason: " VAR_DNSSEC_PROBE
|
msg_warn("reason: " VAR_DNSSEC_PROBE
|
||||||
" '%s' received a response that is not DNSSEC validated",
|
" '%s' received a response that is not DNSSEC validated",
|
||||||
var_dnssec_probe);
|
var_dnssec_probe);
|
||||||
if (rrlist)
|
if (rrlist)
|
||||||
dns_rr_free(rrlist);
|
dns_rr_free(rrlist);
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
VSTREAM *fp; /* open file */
|
VSTREAM *fp; /* open file */
|
||||||
VSTRING *buf; /* I/O buffer */
|
VSTRING *buf; /* I/O buffer */
|
||||||
char *compat_status; /* old logfile compatibility */
|
char *compat_status; /* old logfile compatibility */
|
||||||
char *compat_action; /* old logfile compatibility */
|
char *compat_action; /* old logfile compatibility */
|
||||||
} BOUNCE_LOG;
|
} BOUNCE_LOG;
|
||||||
|
|
||||||
extern BOUNCE_LOG *bounce_log_open(const char *, const char *, int, mode_t);
|
extern BOUNCE_LOG *bounce_log_open(const char *, const char *, int, mode_t);
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define CLEANUP_FLAG_AUTOUTF8 (1<<9) /* Autodetect SMTPUTF8 */
|
#define CLEANUP_FLAG_AUTOUTF8 (1<<9) /* Autodetect SMTPUTF8 */
|
||||||
|
|
||||||
#define CLEANUP_FLAG_FILTER_ALL (CLEANUP_FLAG_FILTER | CLEANUP_FLAG_MILTER)
|
#define CLEANUP_FLAG_FILTER_ALL (CLEANUP_FLAG_FILTER | CLEANUP_FLAG_MILTER)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These are normally set when receiving mail from outside.
|
* These are normally set when receiving mail from outside.
|
||||||
*/
|
*/
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* External interface.
|
* External interface.
|
||||||
*/
|
*/
|
||||||
typedef struct CLNT_STREAM CLNT_STREAM;
|
typedef struct CLNT_STREAM CLNT_STREAM;
|
||||||
typedef int (*CLNT_STREAM_HANDSHAKE_FN)(VSTREAM *);
|
typedef int (*CLNT_STREAM_HANDSHAKE_FN) (VSTREAM *);
|
||||||
|
|
||||||
extern CLNT_STREAM *clnt_stream_create(const char *, const char *, int, int,
|
extern CLNT_STREAM *clnt_stream_create(const char *, const char *, int, int,
|
||||||
CLNT_STREAM_HANDSHAKE_FN);
|
CLNT_STREAM_HANDSHAKE_FN);
|
||||||
|
@ -227,35 +227,35 @@ const char *compat_level_to_string(long compat_level,
|
|||||||
* Sanity check.
|
* Sanity check.
|
||||||
*/
|
*/
|
||||||
if (compat_level < 0) {
|
if (compat_level < 0) {
|
||||||
msg_fn("%s: bad compatibility level: %ld", myname, compat_level);
|
msg_fn("%s: bad compatibility level: %ld", myname, compat_level);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compatibility levels 0..2 have no minor or patch level.
|
* Compatibility levels 0..2 have no minor or patch level.
|
||||||
*/
|
*/
|
||||||
if (buf == 0)
|
if (buf == 0)
|
||||||
buf = vstring_alloc(10);
|
buf = vstring_alloc(10);
|
||||||
major = DECODE_MAJOR(compat_level);
|
major = DECODE_MAJOR(compat_level);
|
||||||
if (!GOOD_MAJOR(major)) {
|
if (!GOOD_MAJOR(major)) {
|
||||||
msg_fn("%s: bad compatibility major level: %ld", myname, compat_level);
|
msg_fn("%s: bad compatibility major level: %ld", myname, compat_level);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
vstring_sprintf(buf, "%ld", major);
|
vstring_sprintf(buf, "%ld", major);
|
||||||
if (major > 2) {
|
if (major > 2) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expect that major.minor will be common.
|
* Expect that major.minor will be common.
|
||||||
*/
|
*/
|
||||||
minor = DECODE_MINOR(compat_level);
|
minor = DECODE_MINOR(compat_level);
|
||||||
vstring_sprintf_append(buf, ".%ld", minor);
|
vstring_sprintf_append(buf, ".%ld", minor);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expect that major.minor.patch will be rare.
|
* Expect that major.minor.patch will be rare.
|
||||||
*/
|
*/
|
||||||
patch = DECODE_PATCH(compat_level);
|
patch = DECODE_PATCH(compat_level);
|
||||||
if (patch)
|
if (patch)
|
||||||
vstring_sprintf_append(buf, ".%ld", patch);
|
vstring_sprintf_append(buf, ".%ld", patch);
|
||||||
}
|
}
|
||||||
return (vstring_str(buf));
|
return (vstring_str(buf));
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ extern long compat_level_from_string(const char *,
|
|||||||
extern long compat_level_from_numbers(long, long, long,
|
extern long compat_level_from_numbers(long, long, long,
|
||||||
void PRINTFLIKE(1, 2) (*) (const char *,...));
|
void PRINTFLIKE(1, 2) (*) (const char *,...));
|
||||||
extern const char *compat_level_to_string(long,
|
extern const char *compat_level_to_string(long,
|
||||||
void PRINTFLIKE(1, 2) (*) (const char *,...));
|
void PRINTFLIKE(1, 2) (*) (const char *,...));
|
||||||
|
|
||||||
#define compat_level_from_major(major, msg_fn) \
|
#define compat_level_from_major(major, msg_fn) \
|
||||||
compat_level_from_major_minor((major), 0, (msg_fn))
|
compat_level_from_major_minor((major), 0, (msg_fn))
|
||||||
|
@ -73,7 +73,7 @@ int conv_time(const char *strval, int *timval, int def_unit)
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
intval = longval = strtol(strval, &end, 10);
|
intval = longval = strtol(strval, &end, 10);
|
||||||
if (*strval == 0 || errno == ERANGE || longval != intval || intval < 0
|
if (*strval == 0 || errno == ERANGE || longval != intval || intval < 0
|
||||||
/* || (*end != 0 && end[1] != 0) */)
|
/* || (*end != 0 && end[1] != 0) */ )
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
switch (*end ? *end : def_unit) {
|
switch (*end ? *end : def_unit) {
|
||||||
|
@ -11,21 +11,21 @@
|
|||||||
/* DESCRIPTION
|
/* DESCRIPTION
|
||||||
/* .nf
|
/* .nf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* External interface.
|
* External interface.
|
||||||
*/
|
*/
|
||||||
#include "dict.h"
|
#include "dict.h"
|
||||||
#include "string_list.h"
|
#include "string_list.h"
|
||||||
|
|
||||||
typedef void (*db_quote_callback_t)(DICT *, const char *, VSTRING *);
|
typedef void (*db_quote_callback_t) (DICT *, const char *, VSTRING *);
|
||||||
|
|
||||||
extern int db_common_parse(DICT *, void **, const char *, int);
|
extern int db_common_parse(DICT *, void **, const char *, int);
|
||||||
extern void *db_common_alloc(DICT *);
|
extern void *db_common_alloc(DICT *);
|
||||||
extern void db_common_parse_domain(CFG_PARSER *, void *);
|
extern void db_common_parse_domain(CFG_PARSER *, void *);
|
||||||
extern int db_common_dict_partial(void *);
|
extern int db_common_dict_partial(void *);
|
||||||
extern int db_common_expand(void *, const char *, const char *,
|
extern int db_common_expand(void *, const char *, const char *,
|
||||||
const char *, VSTRING *, db_quote_callback_t);
|
const char *, VSTRING *, db_quote_callback_t);
|
||||||
extern int db_common_check_domain(void *, const char *);
|
extern int db_common_check_domain(void *, const char *);
|
||||||
extern void db_common_free_ctx(void *);
|
extern void db_common_free_ctx(void *);
|
||||||
extern void db_common_sql_build_query(VSTRING *query, CFG_PARSER *parser);
|
extern void db_common_sql_build_query(VSTRING *query, CFG_PARSER *parser);
|
||||||
@ -55,4 +55,3 @@ extern void db_common_sql_build_query(VSTRING *query, CFG_PARSER *parser);
|
|||||||
/*--*/
|
/*--*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ int dot_lockfile_as(const char *path, VSTRING *why, uid_t euid, gid_t egid)
|
|||||||
|
|
||||||
/* dot_unlockfile_as - dotlock file as user */
|
/* dot_unlockfile_as - dotlock file as user */
|
||||||
|
|
||||||
void dot_unlockfile_as(const char *path, uid_t euid, gid_t egid)
|
void dot_unlockfile_as(const char *path, uid_t euid, gid_t egid)
|
||||||
{
|
{
|
||||||
uid_t saved_euid = geteuid();
|
uid_t saved_euid = geteuid();
|
||||||
gid_t saved_egid = getegid();
|
gid_t saved_egid = getegid();
|
||||||
|
@ -295,7 +295,7 @@ static char *hbc_action(void *context, HBC_CALL_BACKS *cb,
|
|||||||
if (STREQUAL(cmd, "IGNORE", cmd_len))
|
if (STREQUAL(cmd, "IGNORE", cmd_len))
|
||||||
/* XXX Not logged for compatibility with cleanup(8). */
|
/* XXX Not logged for compatibility with cleanup(8). */
|
||||||
return (HBC_CHECKS_STAT_IGNORE);
|
return (HBC_CHECKS_STAT_IGNORE);
|
||||||
|
|
||||||
if (STREQUAL(cmd, "DUNNO", cmd_len) /* preferred */
|
if (STREQUAL(cmd, "DUNNO", cmd_len) /* preferred */
|
||||||
||STREQUAL(cmd, "OK", cmd_len)) /* compatibility */
|
||STREQUAL(cmd, "OK", cmd_len)) /* compatibility */
|
||||||
return ((char *) line);
|
return ((char *) line);
|
||||||
|
@ -72,6 +72,7 @@ static void info_log_addr_form_init(void)
|
|||||||
INFO_LOG_ADDR_FORM_NAME_INTERNAL, INFO_LOG_ADDR_FORM_VAL_INTERNAL,
|
INFO_LOG_ADDR_FORM_NAME_INTERNAL, INFO_LOG_ADDR_FORM_VAL_INTERNAL,
|
||||||
0, INFO_LOG_ADDR_FORM_VAL_NOT_SET,
|
0, INFO_LOG_ADDR_FORM_VAL_NOT_SET,
|
||||||
};
|
};
|
||||||
|
|
||||||
info_log_addr_form_form = name_code(info_log_addr_form_table,
|
info_log_addr_form_form = name_code(info_log_addr_form_table,
|
||||||
NAME_CODE_FLAG_NONE,
|
NAME_CODE_FLAG_NONE,
|
||||||
var_info_log_addr_form);
|
var_info_log_addr_form);
|
||||||
|
@ -62,7 +62,7 @@ ssize_t is_header_buf(const char *str, ssize_t str_len)
|
|||||||
* XXX Don't run off the end in case some non-standard iscntrl()
|
* XXX Don't run off the end in case some non-standard iscntrl()
|
||||||
* implementation considers null a non-control character...
|
* implementation considers null a non-control character...
|
||||||
*/
|
*/
|
||||||
for (len = 0, state = INIT, cp = CU_CHAR_PTR(str); /* see below */; cp++) {
|
for (len = 0, state = INIT, cp = CU_CHAR_PTR(str); /* see below */ ; cp++) {
|
||||||
if (str_len != IS_HEADER_NULL_TERMINATED && str_len-- <= 0)
|
if (str_len != IS_HEADER_NULL_TERMINATED && str_len-- <= 0)
|
||||||
return (0);
|
return (0);
|
||||||
switch (c = *cp) {
|
switch (c = *cp) {
|
||||||
|
@ -359,12 +359,12 @@ static MAIL_ADDR_MAP_TEST pass_tests[] = {
|
|||||||
{"\"a@a\"@example.net"}, 1,
|
{"\"a@a\"@example.net"}, 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"12 external -external-> external, extension, propagation",
|
"12 external -external-> external, extension, propagation",
|
||||||
"inline:{ aa@example.com=bb@example.com }",
|
"inline:{ aa@example.com=bb@example.com }",
|
||||||
DO_PROPAGATE_UNMATCHED_EXTENSION, DOT_RECIPIENT_DELIMITER,
|
DO_PROPAGATE_UNMATCHED_EXTENSION, DOT_RECIPIENT_DELIMITER,
|
||||||
MA_FORM_EXTERNAL, MA_FORM_EXTERNAL, MA_FORM_EXTERNAL,
|
MA_FORM_EXTERNAL, MA_FORM_EXTERNAL, MA_FORM_EXTERNAL,
|
||||||
"aa.ext@example.com",
|
"aa.ext@example.com",
|
||||||
{"bb.ext@example.com"}, 1,
|
{"bb.ext@example.com"}, 1,
|
||||||
},
|
},
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
/* System library. */
|
/* System library. */
|
||||||
|
|
||||||
#include <sys_defs.h>
|
#include <sys_defs.h>
|
||||||
#include <stdlib.h> /* 44BSD stdarg.h uses abort() */
|
#include <stdlib.h> /* 44BSD stdarg.h uses abort() */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
/* mail_conf_checkdir - authorize non-default directory */
|
/* mail_conf_checkdir - authorize non-default directory */
|
||||||
|
|
||||||
void mail_conf_checkdir(const char *config_dir)
|
void mail_conf_checkdir(const char *config_dir)
|
||||||
{
|
{
|
||||||
VSTRING *buf;
|
VSTRING *buf;
|
||||||
VSTREAM *fp;
|
VSTREAM *fp;
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
/* check_mail_conf_raw - validate string length */
|
/* check_mail_conf_raw - validate string length */
|
||||||
|
|
||||||
static void check_mail_conf_raw(const char *name, const char *strval,
|
static void check_mail_conf_raw(const char *name, const char *strval,
|
||||||
int min, int max)
|
int min, int max)
|
||||||
{
|
{
|
||||||
ssize_t len = strlen(strval);
|
ssize_t len = strlen(strval);
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ static void check_mail_conf_raw(const char *name, const char *strval,
|
|||||||
/* get_mail_conf_raw - evaluate string-valued configuration variable */
|
/* get_mail_conf_raw - evaluate string-valued configuration variable */
|
||||||
|
|
||||||
char *get_mail_conf_raw(const char *name, const char *defval,
|
char *get_mail_conf_raw(const char *name, const char *defval,
|
||||||
int min, int max)
|
int min, int max)
|
||||||
{
|
{
|
||||||
const char *strval;
|
const char *strval;
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ char *get_mail_conf_raw(const char *name, const char *defval,
|
|||||||
typedef const char *(*stupid_indent_str) (void);
|
typedef const char *(*stupid_indent_str) (void);
|
||||||
|
|
||||||
char *get_mail_conf_raw_fn(const char *name, stupid_indent_str defval,
|
char *get_mail_conf_raw_fn(const char *name, stupid_indent_str defval,
|
||||||
int min, int max)
|
int min, int max)
|
||||||
{
|
{
|
||||||
const char *strval;
|
const char *strval;
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ void get_mail_conf_raw_table(const CONFIG_RAW_TABLE *table)
|
|||||||
if (table->target[0])
|
if (table->target[0])
|
||||||
myfree(table->target[0]);
|
myfree(table->target[0]);
|
||||||
table->target[0] = get_mail_conf_raw(table->name, table->defval,
|
table->target[0] = get_mail_conf_raw(table->name, table->defval,
|
||||||
table->min, table->max);
|
table->min, table->max);
|
||||||
table++;
|
table++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ void get_mail_conf_raw_fn_table(const CONFIG_RAW_FN_TABLE *table)
|
|||||||
if (table->target[0])
|
if (table->target[0])
|
||||||
myfree(table->target[0]);
|
myfree(table->target[0]);
|
||||||
table->target[0] = get_mail_conf_raw_fn(table->name, table->defval,
|
table->target[0] = get_mail_conf_raw_fn(table->name, table->defval,
|
||||||
table->min, table->max);
|
table->min, table->max);
|
||||||
table++;
|
table++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
/* void check_mail_conf_str(name, strval, min, max)
|
/* void check_mail_conf_str(name, strval, min, max)
|
||||||
/* const char *name;
|
/* const char *name;
|
||||||
/* const char *strval;
|
/* const char *strval;
|
||||||
/* int min;
|
/* int min;
|
||||||
/* int max;
|
/* int max;
|
||||||
/* DESCRIPTION
|
/* DESCRIPTION
|
||||||
/* This module implements support for string-valued global
|
/* This module implements support for string-valued global
|
||||||
|
@ -265,8 +265,8 @@ int mail_copy(const char *sender,
|
|||||||
* while fflush and fsync() succeed. Think of remote file systems such as
|
* while fflush and fsync() succeed. Think of remote file systems such as
|
||||||
* AFS that copy the file back to the server upon close. Oh well, no
|
* AFS that copy the file back to the server upon close. Oh well, no
|
||||||
* point optimizing the error case. XXX On systems that use flock()
|
* point optimizing the error case. XXX On systems that use flock()
|
||||||
* locking, we must truncate the file before closing it (and losing
|
* locking, we must truncate the file before closing it (and losing the
|
||||||
* the exclusive lock).
|
* exclusive lock).
|
||||||
*/
|
*/
|
||||||
read_error = vstream_ferror(src);
|
read_error = vstream_ferror(src);
|
||||||
write_error = vstream_fflush(dst);
|
write_error = vstream_fflush(dst);
|
||||||
|
@ -521,7 +521,7 @@ static void check_mail_owner(void)
|
|||||||
msg_fatal("file %s/%s: parameter %s: user %s has the same"
|
msg_fatal("file %s/%s: parameter %s: user %s has the same"
|
||||||
" user ID %ld as user %s",
|
" user ID %ld as user %s",
|
||||||
var_config_dir, MAIN_CONF_FILE,
|
var_config_dir, MAIN_CONF_FILE,
|
||||||
VAR_MAIL_OWNER, var_mail_owner,
|
VAR_MAIL_OWNER, var_mail_owner,
|
||||||
(long) var_owner_uid, pwd->pw_name);
|
(long) var_owner_uid, pwd->pw_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ static void check_sgid_group(void)
|
|||||||
msg_fatal("file %s/%s: parameter %s: group %s has the same"
|
msg_fatal("file %s/%s: parameter %s: group %s has the same"
|
||||||
" group ID %ld as group %s",
|
" group ID %ld as group %s",
|
||||||
var_config_dir, MAIN_CONF_FILE,
|
var_config_dir, MAIN_CONF_FILE,
|
||||||
VAR_SGID_GROUP, var_sgid_group,
|
VAR_SGID_GROUP, var_sgid_group,
|
||||||
(long) var_sgid_gid, grp->gr_name);
|
(long) var_sgid_gid, grp->gr_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
#define MAIL_PROTO_QMQP "QMQP"
|
#define MAIL_PROTO_QMQP "QMQP"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Names of services: these are the names of the UNIX-domain socket or
|
* Names of services: these are the names of the UNIX-domain socket or FIFO
|
||||||
* FIFO that a service listens on.
|
* that a service listens on.
|
||||||
*/
|
*/
|
||||||
#define MAIL_SERVICE_BOUNCE "bounce"
|
#define MAIL_SERVICE_BOUNCE "bounce"
|
||||||
#define MAIL_SERVICE_CLEANUP "cleanup"
|
#define MAIL_SERVICE_CLEANUP "cleanup"
|
||||||
|
@ -93,7 +93,7 @@ extern int mail_queue_id_ok(const char *);
|
|||||||
* - the inode number (base 51 encoded so that it contains no 'z').
|
* - the inode number (base 51 encoded so that it contains no 'z').
|
||||||
*/
|
*/
|
||||||
#define MQID_LG_SEC_BASE 52 /* seconds safe alphabet base */
|
#define MQID_LG_SEC_BASE 52 /* seconds safe alphabet base */
|
||||||
#define MQID_LG_SEC_PAD 6 /* seconds minimum field width */
|
#define MQID_LG_SEC_PAD 6 /* seconds minimum field width */
|
||||||
#define MQID_LG_USEC_BASE 52 /* microseconds safe alphabet base */
|
#define MQID_LG_USEC_BASE 52 /* microseconds safe alphabet base */
|
||||||
#define MQID_LG_USEC_PAD 4 /* microseconds exact field width */
|
#define MQID_LG_USEC_PAD 4 /* microseconds exact field width */
|
||||||
#define MQID_LG_TIME_PAD (MQID_LG_SEC_PAD + MQID_LG_USEC_PAD)
|
#define MQID_LG_TIME_PAD (MQID_LG_SEC_PAD + MQID_LG_USEC_PAD)
|
||||||
|
@ -82,7 +82,7 @@ int mail_trigger(const char *class, const char *service,
|
|||||||
*/
|
*/
|
||||||
path = mail_pathname(class, service);
|
path = mail_pathname(class, service);
|
||||||
if ((status = stat(path, &st)) < 0) {
|
if ((status = stat(path, &st)) < 0) {
|
||||||
msg_warn("unable to look up %s: %m", path);
|
msg_warn("unable to look up %s: %m", path);
|
||||||
} else if (S_ISFIFO(st.st_mode)) {
|
} else if (S_ISFIFO(st.st_mode)) {
|
||||||
status = fifo_trigger(path, req_buf, req_len, var_trigger_timeout);
|
status = fifo_trigger(path, req_buf, req_len, var_trigger_timeout);
|
||||||
if (status < 0 && S_ISSOCK(st.st_mode))
|
if (status < 0 && S_ISSOCK(st.st_mode))
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* Patches change both the patchlevel and the release date. Snapshots have no
|
* Patches change both the patchlevel and the release date. Snapshots have no
|
||||||
* patchlevel; they change the release date only.
|
* patchlevel; they change the release date only.
|
||||||
*/
|
*/
|
||||||
#define MAIL_RELEASE_DATE "20240930"
|
#define MAIL_RELEASE_DATE "20241010"
|
||||||
#define MAIL_VERSION_NUMBER "3.10"
|
#define MAIL_VERSION_NUMBER "3.10"
|
||||||
|
|
||||||
#ifdef SNAPSHOT
|
#ifdef SNAPSHOT
|
||||||
|
@ -238,8 +238,8 @@ void maillog_client_init(const char *progname, int flags)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* var_postlog_service == 0, therefore var_maillog_file == 0.
|
* var_postlog_service == 0, therefore var_maillog_file == 0.
|
||||||
* logger_mode == MAILLOG_CLIENT_MODE_POSTLOG && var_maillog_file ==
|
* logger_mode == MAILLOG_CLIENT_MODE_POSTLOG && var_maillog_file
|
||||||
* 0, therefore import_service_path != 0.
|
* == 0, therefore import_service_path != 0.
|
||||||
*/
|
*/
|
||||||
service_path = import_service_path;
|
service_path = import_service_path;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
MKMAP *mkmap_proxy_open(const char *unused_path)
|
MKMAP *mkmap_proxy_open(const char *unused_path)
|
||||||
{
|
{
|
||||||
MKMAP *mkmap = (MKMAP *) mymalloc(sizeof(*mkmap));
|
MKMAP *mkmap = (MKMAP *) mymalloc(sizeof(*mkmap));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in the generic members.
|
* Fill in the generic members.
|
||||||
|
@ -191,7 +191,7 @@ static void own_inet_addr_init(INET_ADDR_LIST *addr_list,
|
|||||||
|
|
||||||
/* own_inet_addr - is this my own internet address */
|
/* own_inet_addr - is this my own internet address */
|
||||||
|
|
||||||
int own_inet_addr(struct sockaddr * addr)
|
int own_inet_addr(struct sockaddr *addr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ static void proxy_inet_addr_init(INET_ADDR_LIST *addr_list)
|
|||||||
|
|
||||||
/* proxy_inet_addr - is this my proxy internet address */
|
/* proxy_inet_addr - is this my proxy internet address */
|
||||||
|
|
||||||
int proxy_inet_addr(struct sockaddr * addr)
|
int proxy_inet_addr(struct sockaddr *addr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ static VSTRING *make_821_quoted_string(VSTRING *dst, const char *local_part,
|
|||||||
|
|
||||||
VSTRING *quote_821_local_flags(VSTRING *dst, const char *addr, int flags)
|
VSTRING *quote_821_local_flags(VSTRING *dst, const char *addr, int flags)
|
||||||
{
|
{
|
||||||
const char *at;
|
const char *at;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* According to RFC 821, a local-part is a dot-string or a quoted-string.
|
* According to RFC 821, a local-part is a dot-string or a quoted-string.
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
* External interface.
|
* External interface.
|
||||||
*/
|
*/
|
||||||
extern VSTRING *quote_821_local_flags(VSTRING *, const char *, int);
|
extern VSTRING *quote_821_local_flags(VSTRING *, const char *, int);
|
||||||
|
|
||||||
#define quote_821_local(dst, src) \
|
#define quote_821_local(dst, src) \
|
||||||
quote_821_local_flags((dst), (src), QUOTE_FLAG_8BITCLEAN)
|
quote_821_local_flags((dst), (src), QUOTE_FLAG_8BITCLEAN)
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ int main(int unused_argc, char **argv)
|
|||||||
flags = quote_flags_from_string(cmd);
|
flags = quote_flags_from_string(cmd);
|
||||||
quote_822_local_flags(out, bp, flags);
|
quote_822_local_flags(out, bp, flags);
|
||||||
vstream_printf("'%s' quoted flags=%s '%s'\n",
|
vstream_printf("'%s' quoted flags=%s '%s'\n",
|
||||||
bp, quote_flags_to_string((VSTRING *) 0, flags), STR(out));
|
bp, quote_flags_to_string((VSTRING *) 0, flags), STR(out));
|
||||||
} else if (strcmp(cmd, "unquote") == 0) {
|
} else if (strcmp(cmd, "unquote") == 0) {
|
||||||
unquote_822_local(out, bp);
|
unquote_822_local(out, bp);
|
||||||
vstream_printf("'%s' unquoted '%s'\n", bp, STR(out));
|
vstream_printf("'%s' unquoted '%s'\n", bp, STR(out));
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
extern VSTRING *quote_822_local_flags(VSTRING *, const char *, int);
|
extern VSTRING *quote_822_local_flags(VSTRING *, const char *, int);
|
||||||
extern VSTRING *unquote_822_local(VSTRING *, const char *);
|
extern VSTRING *unquote_822_local(VSTRING *, const char *);
|
||||||
|
|
||||||
#define quote_822_local(dst, src) \
|
#define quote_822_local(dst, src) \
|
||||||
quote_822_local_flags((dst), (src), QUOTE_FLAG_DEFAULT)
|
quote_822_local_flags((dst), (src), QUOTE_FLAG_DEFAULT)
|
||||||
|
|
||||||
|
@ -177,7 +177,8 @@
|
|||||||
* See also: REC_TYPE_SIZE_FORMAT above.
|
* See also: REC_TYPE_SIZE_FORMAT above.
|
||||||
*/
|
*/
|
||||||
#define REC_TYPE_PTR_FORMAT "%15ld"
|
#define REC_TYPE_PTR_FORMAT "%15ld"
|
||||||
#define REC_TYPE_PTR_PAYL_SIZE 15 /* Payload only, excludes record header. */
|
#define REC_TYPE_PTR_PAYL_SIZE 15 /* Payload only, excludes record
|
||||||
|
* header. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Programmatic interface.
|
* Programmatic interface.
|
||||||
|
@ -46,7 +46,7 @@ int main(int unused_argc, char **argv)
|
|||||||
|
|
||||||
while (offset = vstream_ftell(VSTREAM_IN),
|
while (offset = vstream_ftell(VSTREAM_IN),
|
||||||
((type = rec_get(VSTREAM_IN, buf, 0)) != REC_TYPE_EOF
|
((type = rec_get(VSTREAM_IN, buf, 0)) != REC_TYPE_EOF
|
||||||
&& type != REC_TYPE_ERROR)) {
|
&& type != REC_TYPE_ERROR)) {
|
||||||
vstream_fprintf(VSTREAM_OUT, "%15s|%4ld|%3ld|%s\n",
|
vstream_fprintf(VSTREAM_OUT, "%15s|%4ld|%3ld|%s\n",
|
||||||
rec_type_name(type), offset,
|
rec_type_name(type), offset,
|
||||||
(long) VSTRING_LEN(buf), vstring_str(buf));
|
(long) VSTRING_LEN(buf), vstring_str(buf));
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
*/
|
*/
|
||||||
#define SENT_FLAG_NONE (0)
|
#define SENT_FLAG_NONE (0)
|
||||||
|
|
||||||
extern int sent(int, const char *, MSG_STATS *, RECIPIENT *, const char *,
|
extern int sent(int, const char *, MSG_STATS *, RECIPIENT *, const char *,
|
||||||
DSN *);
|
DSN *);
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
/* .ad
|
/* .ad
|
||||||
|
@ -112,7 +112,7 @@ void server_acl_pre_jail_init(const char *mynetworks, const char *origin)
|
|||||||
if (warn_compat_break_mynetworks_style)
|
if (warn_compat_break_mynetworks_style)
|
||||||
server_acl_mynetworks_host =
|
server_acl_mynetworks_host =
|
||||||
addr_match_list_init(origin, MATCH_FLAG_RETURN
|
addr_match_list_init(origin, MATCH_FLAG_RETURN
|
||||||
| match_parent_style(origin), mynetworks_host());
|
| match_parent_style(origin), mynetworks_host());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* server_acl_parse - parse access list */
|
/* server_acl_parse - parse access list */
|
||||||
@ -240,7 +240,7 @@ int server_acl_eval(const char *client_addr, SERVER_ACL * intern_acl,
|
|||||||
#include <vstring_vstream.h>
|
#include <vstring_vstream.h>
|
||||||
#include <name_code.h>
|
#include <name_code.h>
|
||||||
#include <split_at.h>
|
#include <split_at.h>
|
||||||
|
|
||||||
char *var_server_acl = "";
|
char *var_server_acl = "";
|
||||||
|
|
||||||
#define UPDATE_VAR(s,v) do { if (*(s)) myfree(s); (s) = mystrdup(v); } while (0)
|
#define UPDATE_VAR(s,v) do { if (*(s)) myfree(s); (s) = mystrdup(v); } while (0)
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
/* .IP MAIL_SRC_MASK_FORWARD
|
/* .IP MAIL_SRC_MASK_FORWARD
|
||||||
/* Local forwarding or aliasing.
|
/* Local forwarding or aliasing.
|
||||||
/* .IP MAIL_SRC_MASK_BOUNCE
|
/* .IP MAIL_SRC_MASK_BOUNCE
|
||||||
/* Submission by the bounce(8) daemon.
|
/* Submission by the bounce(8) daemon.
|
||||||
/* .IP MAIL_SRC_MASK_NOTIFY
|
/* .IP MAIL_SRC_MASK_NOTIFY
|
||||||
/* Postmaster notification from the smtp(8) or smtpd(8) daemon.
|
/* Postmaster notification from the smtp(8) or smtpd(8) daemon.
|
||||||
/* .IP MAIL_SRC_MASK_VERIFY
|
/* .IP MAIL_SRC_MASK_VERIFY
|
||||||
|
@ -14,21 +14,21 @@
|
|||||||
/*
|
/*
|
||||||
* Avoiding chicken-and-egg problems during the initial SMTPUTF8 roll-out in
|
* Avoiding chicken-and-egg problems during the initial SMTPUTF8 roll-out in
|
||||||
* environments with pre-existing mail flows that contain UTF8.
|
* environments with pre-existing mail flows that contain UTF8.
|
||||||
*
|
*
|
||||||
* Prior to SMTPUTF8, mail flows that contain UTF8 worked because the vast
|
* Prior to SMTPUTF8, mail flows that contain UTF8 worked because the vast
|
||||||
* majority of MTAs is perfectly capable of handling UTF8 in address
|
* majority of MTAs is perfectly capable of handling UTF8 in address
|
||||||
* localparts (and in headers), even if pre-SMTPUTF8 standards do not
|
* localparts (and in headers), even if pre-SMTPUTF8 standards do not
|
||||||
* support this practice.
|
* support this practice.
|
||||||
*
|
*
|
||||||
* When turning on Postfix SMTPUTF8 support for the first time, we don't want
|
* When turning on Postfix SMTPUTF8 support for the first time, we don't want
|
||||||
* to suddenly break pre-existing mail flows that contain UTF8 because 1) a
|
* to suddenly break pre-existing mail flows that contain UTF8 because 1) a
|
||||||
* client does not request SMTPUTF8 support, and because 2) a down-stream
|
* client does not request SMTPUTF8 support, and because 2) a down-stream
|
||||||
* MTA does not announce SMTPUTF8 support.
|
* MTA does not announce SMTPUTF8 support.
|
||||||
*
|
*
|
||||||
* While 1) is easy enough to avoid (keep accepting UTF8 in address localparts
|
* While 1) is easy enough to avoid (keep accepting UTF8 in address localparts
|
||||||
* just like Postfix has always done), 2) presents a thornier problem. The
|
* just like Postfix has always done), 2) presents a thornier problem. The
|
||||||
* root cause of that problem is the need for SMTPUTF8 autodetection.
|
* root cause of that problem is the need for SMTPUTF8 autodetection.
|
||||||
*
|
*
|
||||||
* What is SMTPUTF8 autodetection? Postfix cannot rely solely on the sender's
|
* What is SMTPUTF8 autodetection? Postfix cannot rely solely on the sender's
|
||||||
* declaration that a message requires SMTPUTF8 support, because UTF8 may be
|
* declaration that a message requires SMTPUTF8 support, because UTF8 may be
|
||||||
* introduced during local processing (for example, the client hostname in
|
* introduced during local processing (for example, the client hostname in
|
||||||
@ -36,21 +36,21 @@
|
|||||||
* incomplete address, address rewriting, alias expansion, automatic BCC
|
* incomplete address, address rewriting, alias expansion, automatic BCC
|
||||||
* recipients, local forwarding, and changes made by header checks or Milter
|
* recipients, local forwarding, and changes made by header checks or Milter
|
||||||
* applications).
|
* applications).
|
||||||
*
|
*
|
||||||
* In summary, after local processing has happened, Postfix may decide that a
|
* In summary, after local processing has happened, Postfix may decide that a
|
||||||
* message requires SMTPUTF8 support, even when that message initially did
|
* message requires SMTPUTF8 support, even when that message initially did
|
||||||
* not require SMTPUTF8 support. This could make the message undeliverable
|
* not require SMTPUTF8 support. This could make the message undeliverable
|
||||||
* to destinations that do not support SMTPUTF8. In an environment with
|
* to destinations that do not support SMTPUTF8. In an environment with
|
||||||
* pre-existing mail flows that contain UTF8, we want to avoid disrupting
|
* pre-existing mail flows that contain UTF8, we want to avoid disrupting
|
||||||
* those mail flows when rolling out SMTPUTF8 support.
|
* those mail flows when rolling out SMTPUTF8 support.
|
||||||
*
|
*
|
||||||
* For the vast majority of sites, the simplest solution is to autodetect
|
* For the vast majority of sites, the simplest solution is to autodetect
|
||||||
* SMTPUTF8 support only for Postfix sendmail command-line submissions, at
|
* SMTPUTF8 support only for Postfix sendmail command-line submissions, at
|
||||||
* least as long as SMTPUTF8 support has not yet achieved wold domination.
|
* least as long as SMTPUTF8 support has not yet achieved wold domination.
|
||||||
*
|
*
|
||||||
* However, sites that add UTF8 content via local processing (see above) should
|
* However, sites that add UTF8 content via local processing (see above) should
|
||||||
* autodetect SMTPUTF8 support for all email.
|
* autodetect SMTPUTF8 support for all email.
|
||||||
*
|
*
|
||||||
* smtputf8_autodetect() uses the setting of the smtputf8_autodetect_classes
|
* smtputf8_autodetect() uses the setting of the smtputf8_autodetect_classes
|
||||||
* parameter, and the mail source classes defined in mail_params.h.
|
* parameter, and the mail source classes defined in mail_params.h.
|
||||||
*/
|
*/
|
||||||
|
@ -263,7 +263,7 @@ TOK822 *tok822_free_tree(TOK822 *tp)
|
|||||||
{
|
{
|
||||||
TOK822 *next;
|
TOK822 *next;
|
||||||
|
|
||||||
for (/* void */; tp != 0; tp = next) {
|
for ( /* void */ ; tp != 0; tp = next) {
|
||||||
if (tp->head)
|
if (tp->head)
|
||||||
tok822_free_tree(tp->head);
|
tok822_free_tree(tp->head);
|
||||||
next = tp->next;
|
next = tp->next;
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
/*
|
/*
|
||||||
* System library
|
* System library
|
||||||
*/
|
*/
|
||||||
#include <unistd.h> /* getuid()/geteuid() */
|
#include <unistd.h> /* getuid()/geteuid() */
|
||||||
#include <sys/types.h> /* uid_t */
|
#include <sys/types.h> /* uid_t */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utility library.
|
* Utility library.
|
||||||
|
@ -92,7 +92,7 @@ int valid_mailhost_literal(const char *addr, int gripe)
|
|||||||
const char *myname = "valid_mailhost_literal";
|
const char *myname = "valid_mailhost_literal";
|
||||||
MAI_HOSTADDR_STR hostaddr;
|
MAI_HOSTADDR_STR hostaddr;
|
||||||
const char *last;
|
const char *last;
|
||||||
size_t address_bytes;
|
size_t address_bytes;
|
||||||
|
|
||||||
if (*addr != '[') {
|
if (*addr != '[') {
|
||||||
if (gripe)
|
if (gripe)
|
||||||
|
@ -134,6 +134,7 @@ VSTRING *xtext_unquote_append(VSTRING *unquoted, const char *quoted)
|
|||||||
VSTRING_TERMINATE(unquoted);
|
VSTRING_TERMINATE(unquoted);
|
||||||
return (unquoted);
|
return (unquoted);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* xtext_unquote - quoted data to unquoted */
|
/* xtext_unquote - quoted data to unquoted */
|
||||||
|
|
||||||
VSTRING *xtext_unquote(VSTRING *unquoted, const char *quoted)
|
VSTRING *xtext_unquote(VSTRING *unquoted, const char *quoted)
|
||||||
|
@ -129,10 +129,11 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr,
|
|||||||
*
|
*
|
||||||
* We cannot do duplicate elimination here. Sendmail compatibility requires
|
* We cannot do duplicate elimination here. Sendmail compatibility requires
|
||||||
* that we allow multiple deliveries to the same alias, even recursively!
|
* that we allow multiple deliveries to the same alias, even recursively!
|
||||||
* For example, we must deliver to mailbox any messages that are addressed
|
* For example, we must deliver to mailbox any messages that are
|
||||||
* to the alias of a user that lists that same alias in her own .forward
|
* addressed to the alias of a user that lists that same alias in her own
|
||||||
* file. Yuck! This is just an example of some really perverse semantics
|
* .forward file. Yuck! This is just an example of some really perverse
|
||||||
* that people will expect Postfix to implement just like sendmail.
|
* semantics that people will expect Postfix to implement just like
|
||||||
|
* sendmail.
|
||||||
*
|
*
|
||||||
* We can recognize one special case: when an alias includes its own name,
|
* We can recognize one special case: when an alias includes its own name,
|
||||||
* deliver to the user instead, just like sendmail. Otherwise, we just
|
* deliver to the user instead, just like sendmail. Otherwise, we just
|
||||||
|
@ -171,7 +171,7 @@ int deliver_command(LOCAL_STATE state, USER_ATTR usr_attr, const char *comma
|
|||||||
argv_add(env, "ORIGINAL_RECIPIENT", state.msg_attr.rcpt.orig_addr,
|
argv_add(env, "ORIGINAL_RECIPIENT", state.msg_attr.rcpt.orig_addr,
|
||||||
ARGV_END);
|
ARGV_END);
|
||||||
if (state.request->dsn_envid[0])
|
if (state.request->dsn_envid[0])
|
||||||
argv_add(env, "ENVID", state.request->dsn_envid, ARGV_END);
|
argv_add(env, "ENVID", state.request->dsn_envid, ARGV_END);
|
||||||
|
|
||||||
#define EXPORT_REQUEST(name, value) \
|
#define EXPORT_REQUEST(name, value) \
|
||||||
if ((value)[0]) argv_add(env, (name), (value), ARGV_END);
|
if ((value)[0]) argv_add(env, (name), (value), ARGV_END);
|
||||||
|
@ -420,8 +420,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If started from a terminal, get rid of any tty association. This also
|
* If started from a terminal, get rid of any tty association. This also
|
||||||
* means that all errors and warnings must go to the syslog daemon.
|
* means that all errors and warnings must go to the syslog daemon. Some
|
||||||
* Some new world has no terminals and prefers logging to stdout.
|
* new world has no terminals and prefers logging to stdout.
|
||||||
*/
|
*/
|
||||||
if (master_detach)
|
if (master_detach)
|
||||||
for (fd = 0; fd < 3; fd++) {
|
for (fd = 0; fd < 3; fd++) {
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
* when idle for a configurable amount of time, or after servicing a
|
* when idle for a configurable amount of time, or after servicing a
|
||||||
* configurable number of requests; the master process spawns new processes
|
* configurable number of requests; the master process spawns new processes
|
||||||
* on demand up to a configurable concurrency limit and/or periodically.
|
* on demand up to a configurable concurrency limit and/or periodically.
|
||||||
*
|
*
|
||||||
* The canonical service name is what we use internally, so that we correctly
|
* The canonical service name is what we use internally, so that we correctly
|
||||||
* handle a request to "reload" after someone changes "smtp" into "25".
|
* handle a request to "reload" after someone changes "smtp" into "25".
|
||||||
*
|
*
|
||||||
* We use the external service name from master.cf when reporting problems, so
|
* We use the external service name from master.cf when reporting problems, so
|
||||||
* that the user can figure out what we are talking about. Of course we also
|
* that the user can figure out what we are talking about. Of course we also
|
||||||
* include the canonical service name so that the UNIX-domain smtp service
|
* include the canonical service name so that the UNIX-domain smtp service
|
||||||
@ -141,8 +141,8 @@ extern void master_start_service(MASTER_SERV *);
|
|||||||
extern void master_stop_service(MASTER_SERV *);
|
extern void master_stop_service(MASTER_SERV *);
|
||||||
extern void master_restart_service(MASTER_SERV *, int);
|
extern void master_restart_service(MASTER_SERV *, int);
|
||||||
|
|
||||||
#define DO_CONF_RELOAD 1 /* config files were reloaded */
|
#define DO_CONF_RELOAD 1 /* config files were reloaded */
|
||||||
#define NO_CONF_RELOAD 0 /* no config file was reloaded */
|
#define NO_CONF_RELOAD 0 /* no config file was reloaded */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* master_events.c
|
* master_events.c
|
||||||
|
@ -153,7 +153,7 @@ void master_listen_init(MASTER_SERV *serv)
|
|||||||
set_eugid(var_owner_uid, var_owner_gid);
|
set_eugid(var_owner_uid, var_owner_gid);
|
||||||
serv->listen_fd[0] =
|
serv->listen_fd[0] =
|
||||||
LOCAL_LISTEN(serv->name, serv->max_proc > var_proc_limit ?
|
LOCAL_LISTEN(serv->name, serv->max_proc > var_proc_limit ?
|
||||||
serv->max_proc : var_proc_limit, NON_BLOCKING);
|
serv->max_proc : var_proc_limit, NON_BLOCKING);
|
||||||
close_on_exec(serv->listen_fd[0], CLOSE_ON_EXEC);
|
close_on_exec(serv->listen_fd[0], CLOSE_ON_EXEC);
|
||||||
set_ugid(getuid(), getgid());
|
set_ugid(getuid(), getgid());
|
||||||
break;
|
break;
|
||||||
|
@ -72,4 +72,3 @@ extern int master_notify(int, unsigned, int); /* encapsulate status msg */
|
|||||||
/* 111 8th Avenue
|
/* 111 8th Avenue
|
||||||
/* New York, NY 10011, USA
|
/* New York, NY 10011, USA
|
||||||
/*--*/
|
/*--*/
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
/* master_restart_service() requests all running child processes to
|
/* master_restart_service() requests all running child processes to
|
||||||
/* commit suicide. The conf_reload argument is either DO_CONF_RELOAD
|
/* commit suicide. The conf_reload argument is either DO_CONF_RELOAD
|
||||||
/* (configuration files were reloaded, re-evaluate the child process
|
/* (configuration files were reloaded, re-evaluate the child process
|
||||||
/* creation policy) or NO_CONF_RELOAD.
|
/* creation policy) or NO_CONF_RELOAD.
|
||||||
/* DIAGNOSTICS
|
/* DIAGNOSTICS
|
||||||
/* BUGS
|
/* BUGS
|
||||||
/* SEE ALSO
|
/* SEE ALSO
|
||||||
|
@ -100,8 +100,8 @@ void master_str_watch(const MASTER_STR_WATCH *str_watch_table)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the backed up parameter value, or update it if this
|
* Initialize the backed up parameter value, or update it if this
|
||||||
* parameter supports updates after initialization. Optionally
|
* parameter supports updates after initialization. Optionally notify
|
||||||
* notify the application that this parameter has changed.
|
* the application that this parameter has changed.
|
||||||
*/
|
*/
|
||||||
if (wp->backup[0] == 0) {
|
if (wp->backup[0] == 0) {
|
||||||
if (wp->notify != 0)
|
if (wp->notify != 0)
|
||||||
@ -138,8 +138,8 @@ void master_int_watch(MASTER_INT_WATCH *int_watch_table)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the backed up parameter value, or update if it this
|
* Initialize the backed up parameter value, or update if it this
|
||||||
* parameter supports updates after initialization. Optionally
|
* parameter supports updates after initialization. Optionally notify
|
||||||
* notify the application that this parameter has changed.
|
* the application that this parameter has changed.
|
||||||
*/
|
*/
|
||||||
if ((wp->flags & MASTER_WATCH_FLAG_ISSET) == 0) {
|
if ((wp->flags & MASTER_WATCH_FLAG_ISSET) == 0) {
|
||||||
if (wp->notify != 0)
|
if (wp->notify != 0)
|
||||||
|
@ -1157,7 +1157,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
|
|||||||
if (edit_resp == 0)
|
if (edit_resp == 0)
|
||||||
edit_resp = parent->repl_body(parent->chg_context,
|
edit_resp = parent->repl_body(parent->chg_context,
|
||||||
MILTER_BODY_END,
|
MILTER_BODY_END,
|
||||||
/* unused*/ 0,
|
/* unused */ 0,
|
||||||
(VSTRING *) 0);
|
(VSTRING *) 0);
|
||||||
body_edit_lockout = 1;
|
body_edit_lockout = 1;
|
||||||
vstring_free(body_line_buf);
|
vstring_free(body_line_buf);
|
||||||
@ -1553,7 +1553,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
|
|||||||
body_line_buf = vstring_alloc(var_line_limit);
|
body_line_buf = vstring_alloc(var_line_limit);
|
||||||
edit_resp = parent->repl_body(parent->chg_context,
|
edit_resp = parent->repl_body(parent->chg_context,
|
||||||
MILTER_BODY_START,
|
MILTER_BODY_START,
|
||||||
/* unused */ 0,
|
/* unused */ 0,
|
||||||
(VSTRING *) 0);
|
(VSTRING *) 0);
|
||||||
}
|
}
|
||||||
/* Extract lines from the on-the-wire CRLF format. */
|
/* Extract lines from the on-the-wire CRLF format. */
|
||||||
|
@ -227,7 +227,7 @@ static int test_reply(SMFICTX *ctx, int code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static sfsistat test_connect(SMFICTX *ctx, char *name, struct sockaddr * sa)
|
static sfsistat test_connect(SMFICTX *ctx, char *name, struct sockaddr *sa)
|
||||||
{
|
{
|
||||||
const char *print_addr;
|
const char *print_addr;
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
@ -235,7 +235,7 @@ int qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
|
|||||||
*/
|
*/
|
||||||
#define QMGR_FLUSH_AFTER (QMGR_FLUSH_EACH | QMGR_FLUSH_DFXP)
|
#define QMGR_FLUSH_AFTER (QMGR_FLUSH_EACH | QMGR_FLUSH_DFXP)
|
||||||
#define MAYBE_FLUSH_AFTER(mode) \
|
#define MAYBE_FLUSH_AFTER(mode) \
|
||||||
(((mode) & MAIL_QUEUE_STAT_UNTHROTTLE) ? QMGR_FLUSH_AFTER : 0)
|
(((mode) & MAIL_QUEUE_STAT_UNTHROTTLE) ? QMGR_FLUSH_AFTER : 0)
|
||||||
#define MAYBE_FORCE_EXPIRE(mode) \
|
#define MAYBE_FORCE_EXPIRE(mode) \
|
||||||
(((mode) & MAIL_QUEUE_STAT_EXPIRE) ? QMGR_FORCE_EXPIRE : 0)
|
(((mode) & MAIL_QUEUE_STAT_EXPIRE) ? QMGR_FORCE_EXPIRE : 0)
|
||||||
#define MAYBE_UPDATE_MODE(mode) \
|
#define MAYBE_UPDATE_MODE(mode) \
|
||||||
|
@ -331,8 +331,7 @@ QMGR_ENTRY *qmgr_entry_create(QMGR_QUEUE *queue, QMGR_MESSAGE *message)
|
|||||||
*
|
*
|
||||||
* XXX At this point in the code, the busy reference count is still less
|
* XXX At this point in the code, the busy reference count is still less
|
||||||
* than the concurrency limit (otherwise this code would not be invoked
|
* than the concurrency limit (otherwise this code would not be invoked
|
||||||
* in the first place) so we have to make some awkward adjustments
|
* in the first place) so we have to make some awkward adjustments below.
|
||||||
* below.
|
|
||||||
*
|
*
|
||||||
* XXX The queue length test below looks at the active queue share of an
|
* XXX The queue length test below looks at the active queue share of an
|
||||||
* individual destination. This catches the case where mail for one
|
* individual destination. This catches the case where mail for one
|
||||||
|
@ -551,7 +551,7 @@
|
|||||||
#define PIPE_DICT_SASL_USERNAME "sasl_username" /* key */
|
#define PIPE_DICT_SASL_USERNAME "sasl_username" /* key */
|
||||||
#define PIPE_DICT_SASL_SENDER "sasl_sender" /* key */
|
#define PIPE_DICT_SASL_SENDER "sasl_sender" /* key */
|
||||||
#define PIPE_DICT_QUEUE_ID "queue_id" /* key */
|
#define PIPE_DICT_QUEUE_ID "queue_id" /* key */
|
||||||
#define PIPE_DICT_ENVID "envid" /* key */
|
#define PIPE_DICT_ENVID "envid" /* key */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flags used to pass back the type of special parameter found by
|
* Flags used to pass back the type of special parameter found by
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
/* when running as PID 1.
|
/* when running as PID 1.
|
||||||
/* This command requires that multi-instance support is
|
/* This command requires that multi-instance support is
|
||||||
/* disabled (i.e. the multi_instance_directories parameter
|
/* disabled (i.e. the multi_instance_directories parameter
|
||||||
/* value must be empty).
|
/* value must be empty).
|
||||||
/*
|
/*
|
||||||
/* When running Postfix inside a container, see MAILLOG_README
|
/* When running Postfix inside a container, see MAILLOG_README
|
||||||
/* for logging to stdout. Postfix logs to syslog by default,
|
/* for logging to stdout. Postfix logs to syslog by default,
|
||||||
|
@ -231,7 +231,7 @@ static void psc_dnsbl_add_site(const char *site)
|
|||||||
int weight;
|
int weight;
|
||||||
HTABLE_INFO *ht;
|
HTABLE_INFO *ht;
|
||||||
char *parse_err;
|
char *parse_err;
|
||||||
const char *safe_dnsbl;
|
const char *safe_dnsbl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse the required DNSBL domain name, the optional reply filter and
|
* Parse the required DNSBL domain name, the optional reply filter and
|
||||||
|
@ -901,7 +901,7 @@ static int starttls(STATE *state)
|
|||||||
state->tls_context = tls_proxy_context_receive(state->stream);
|
state->tls_context = tls_proxy_context_receive(state->stream);
|
||||||
if (state->tls_context) {
|
if (state->tls_context) {
|
||||||
if (state->log_mask &
|
if (state->log_mask &
|
||||||
(TLS_LOG_CERTMATCH | TLS_LOG_VERBOSE | TLS_LOG_PEERCERT)) {
|
(TLS_LOG_CERTMATCH | TLS_LOG_VERBOSE | TLS_LOG_PEERCERT)) {
|
||||||
if (state->tls_context->stoc_rpk)
|
if (state->tls_context->stoc_rpk)
|
||||||
msg_info("%s: pkey_fingerprint=%s", state->namaddrport,
|
msg_info("%s: pkey_fingerprint=%s", state->namaddrport,
|
||||||
state->tls_context->peer_pkey_fprint);
|
state->tls_context->peer_pkey_fprint);
|
||||||
@ -2147,8 +2147,8 @@ static void parse_match(STATE *state, int argc, char *argv[])
|
|||||||
int smtp_mode = 1;
|
int smtp_mode = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DANE match names are configured late, once the TLSA records are in hand.
|
* DANE match names are configured late, once the TLSA records are in
|
||||||
* For now, prepare to fall back to "secure".
|
* hand. For now, prepare to fall back to "secure".
|
||||||
*/
|
*/
|
||||||
switch (state->level) {
|
switch (state->level) {
|
||||||
default:
|
default:
|
||||||
|
@ -235,7 +235,7 @@ int qmgr_active_feed(QMGR_SCAN *scan_info, const char *queue_id)
|
|||||||
*/
|
*/
|
||||||
#define QMGR_FLUSH_AFTER (QMGR_FLUSH_EACH | QMGR_FLUSH_DFXP)
|
#define QMGR_FLUSH_AFTER (QMGR_FLUSH_EACH | QMGR_FLUSH_DFXP)
|
||||||
#define MAYBE_FLUSH_AFTER(mode) \
|
#define MAYBE_FLUSH_AFTER(mode) \
|
||||||
(((mode) & MAIL_QUEUE_STAT_UNTHROTTLE) ? QMGR_FLUSH_AFTER : 0)
|
(((mode) & MAIL_QUEUE_STAT_UNTHROTTLE) ? QMGR_FLUSH_AFTER : 0)
|
||||||
#define MAYBE_FORCE_EXPIRE(mode) \
|
#define MAYBE_FORCE_EXPIRE(mode) \
|
||||||
(((mode) & MAIL_QUEUE_STAT_EXPIRE) ? QMGR_FORCE_EXPIRE : 0)
|
(((mode) & MAIL_QUEUE_STAT_EXPIRE) ? QMGR_FORCE_EXPIRE : 0)
|
||||||
#define MAYBE_UPDATE_MODE(mode) \
|
#define MAYBE_UPDATE_MODE(mode) \
|
||||||
|
@ -392,8 +392,7 @@ QMGR_ENTRY *qmgr_entry_create(QMGR_PEER *peer, QMGR_MESSAGE *message)
|
|||||||
*
|
*
|
||||||
* XXX At this point in the code, the busy reference count is still less
|
* XXX At this point in the code, the busy reference count is still less
|
||||||
* than the concurrency limit (otherwise this code would not be invoked
|
* than the concurrency limit (otherwise this code would not be invoked
|
||||||
* in the first place) so we have to make some awkward adjustments
|
* in the first place) so we have to make some awkward adjustments below.
|
||||||
* below.
|
|
||||||
*
|
*
|
||||||
* XXX The queue length test below looks at the active queue share of an
|
* XXX The queue length test below looks at the active queue share of an
|
||||||
* individual destination. This catches the case where mail for one
|
* individual destination. This catches the case where mail for one
|
||||||
|
@ -199,10 +199,10 @@ void qmqpd_peer_init(QMQPD_STATE *state)
|
|||||||
/*
|
/*
|
||||||
* Following RFC 2821 section 4.1.3, an IPv6 address literal gets
|
* Following RFC 2821 section 4.1.3, an IPv6 address literal gets
|
||||||
* a prefix of 'IPv6:'. We do this consistently for all IPv6
|
* a prefix of 'IPv6:'. We do this consistently for all IPv6
|
||||||
* addresses that appear in headers or envelopes. The fact
|
* addresses that appear in headers or envelopes. The fact that
|
||||||
* that valid_mailhost_addr() enforces the form helps of course.
|
* valid_mailhost_addr() enforces the form helps of course. We
|
||||||
* We use the form without IPV6: prefix when doing access
|
* use the form without IPV6: prefix when doing access control,
|
||||||
* control, or when accessing the connection cache.
|
* or when accessing the connection cache.
|
||||||
*/
|
*/
|
||||||
else {
|
else {
|
||||||
state->addr = mystrdup(client_addr.buf);
|
state->addr = mystrdup(client_addr.buf);
|
||||||
|
@ -519,8 +519,8 @@ extern HBC_CALL_BACKS smtp_hbc_callbacks[];
|
|||||||
(session->expire_time = (when))
|
(session->expire_time = (when))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Encapsulate the following so that we don't expose details of
|
* Encapsulate the following so that we don't expose details of connection
|
||||||
* connection management and error handling to the SMTP protocol engine.
|
* management and error handling to the SMTP protocol engine.
|
||||||
*/
|
*/
|
||||||
#ifdef USE_SASL_AUTH
|
#ifdef USE_SASL_AUTH
|
||||||
#define HAVE_SASL_CREDENTIALS \
|
#define HAVE_SASL_CREDENTIALS \
|
||||||
|
@ -262,7 +262,7 @@ static DNS_RR *smtp_addr_one(DNS_RR *addr_list, const char *host, int res_opt,
|
|||||||
msg_fatal("host %s: conversion error for address family "
|
msg_fatal("host %s: conversion error for address family "
|
||||||
"%d: %m", host, res0->ai_addr->sa_family);
|
"%d: %m", host, res0->ai_addr->sa_family);
|
||||||
addr_list = dns_rr_append(addr_list, addr);
|
addr_list = dns_rr_append(addr_list, addr);
|
||||||
if (DNS_RR_IS_TRUNCATED(addr_list))
|
if (DNS_RR_IS_TRUNCATED(addr_list))
|
||||||
break;
|
break;
|
||||||
if (msg_verbose) {
|
if (msg_verbose) {
|
||||||
MAI_HOSTADDR_STR hostaddr_str;
|
MAI_HOSTADDR_STR hostaddr_str;
|
||||||
@ -867,7 +867,7 @@ DNS_RR *smtp_service_addr(const char *name, const char *service, DNS_RR **mxrr,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Only if we're not falling back.
|
* Only if we're not falling back.
|
||||||
*/
|
*/
|
||||||
else {
|
else {
|
||||||
*found_myself |= (self != 0);
|
*found_myself |= (self != 0);
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ void smtp_tlsrpt_create_wrapper(SMTP_STATE *state, const char *domain)
|
|||||||
/* rpt_socket_name= */ var_smtp_tlsrpt_sockname,
|
/* rpt_socket_name= */ var_smtp_tlsrpt_sockname,
|
||||||
/* rpt_policy_domain= */ adomain,
|
/* rpt_policy_domain= */ adomain,
|
||||||
/* rpt_policy_string= */ rr->data,
|
/* rpt_policy_string= */ rr->data,
|
||||||
/* skip_reused_hs = */ var_smtp_tlsrpt_skip_reused_hs);
|
/* skip_reused_hs = */ var_smtp_tlsrpt_skip_reused_hs);
|
||||||
dns_rr_free(rr);
|
dns_rr_free(rr);
|
||||||
} else {
|
} else {
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
|
@ -86,11 +86,11 @@ const char *smtp_unalias_name(const char *name)
|
|||||||
if ((result = htable_find(cache, name)) == 0) {
|
if ((result = htable_find(cache, name)) == 0) {
|
||||||
fqdn = vstring_alloc(10);
|
fqdn = vstring_alloc(10);
|
||||||
if (dns_lookup_l(name, smtp_unalias_flags, (DNS_RR **) 0, fqdn,
|
if (dns_lookup_l(name, smtp_unalias_flags, (DNS_RR **) 0, fqdn,
|
||||||
(VSTRING *) 0, DNS_REQ_FLAG_NONE, T_MX, T_A,
|
(VSTRING *) 0, DNS_REQ_FLAG_NONE, T_MX, T_A,
|
||||||
#ifdef HAS_IPV6
|
#ifdef HAS_IPV6
|
||||||
T_AAAA,
|
T_AAAA,
|
||||||
#endif
|
#endif
|
||||||
0) != DNS_OK)
|
0) != DNS_OK)
|
||||||
vstring_strcpy(fqdn, name);
|
vstring_strcpy(fqdn, name);
|
||||||
htable_enter(cache, name, result = vstring_export(fqdn));
|
htable_enter(cache, name, result = vstring_export(fqdn));
|
||||||
}
|
}
|
||||||
|
@ -24,4 +24,3 @@ extern const char *smtpd_milter_eval(const char *, void *);
|
|||||||
/* P.O. Box 704
|
/* P.O. Box 704
|
||||||
/* Yorktown Heights, NY 10598, USA
|
/* Yorktown Heights, NY 10598, USA
|
||||||
/*--*/
|
/*--*/
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* External interface.
|
* External interface.
|
||||||
*/
|
*/
|
||||||
extern void smtpd_resolve_init(int);
|
extern void smtpd_resolve_init(int);
|
||||||
extern const RESOLVE_REPLY *smtpd_resolve_addr(const char*, const char *);
|
extern const RESOLVE_REPLY *smtpd_resolve_addr(const char *, const char *);
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
/* .ad
|
/* .ad
|
||||||
|
@ -844,34 +844,34 @@ TLS_APPL_STATE *tls_client_init(const TLS_CLIENT_INIT_PROPS *props)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable support for client->server raw public keys, provided we actually
|
* Enable support for client->server raw public keys, provided we
|
||||||
* have keys to send. They'll only be used if the server also enables
|
* actually have keys to send. They'll only be used if the server also
|
||||||
* client RPKs.
|
* enables client RPKs.
|
||||||
*
|
*
|
||||||
* XXX: When the server requests client auth, the TLS 1.2 protocol does not
|
* XXX: When the server requests client auth, the TLS 1.2 protocol does not
|
||||||
* provide an unambiguous mechanism for the client to not send an RPK (as
|
* provide an unambiguous mechanism for the client to not send an RPK (as
|
||||||
* it can with client X.509 certs or TLS 1.3). This is why we don't just
|
* it can with client X.509 certs or TLS 1.3). This is why we don't just
|
||||||
* enable client RPK also with no keys in hand.
|
* enable client RPK also with no keys in hand.
|
||||||
*
|
*
|
||||||
* A very unlikely scenario is that the server allows clients to not send
|
* A very unlikely scenario is that the server allows clients to not send
|
||||||
* keys, but only accepts keys for a set of algorithms we don't have. Then
|
* keys, but only accepts keys for a set of algorithms we don't have.
|
||||||
* we still can't send a key, but have agreed to RPK. OpenSSL will attempt
|
* Then we still can't send a key, but have agreed to RPK. OpenSSL will
|
||||||
* to send an empty RPK even with TLS 1.2 (and will accept such a message),
|
* attempt to send an empty RPK even with TLS 1.2 (and will accept such a
|
||||||
* but other implementations may be more strict.
|
* message), but other implementations may be more strict.
|
||||||
*
|
*
|
||||||
* We could limit client RPK support to connections that support only TLS
|
* We could limit client RPK support to connections that support only TLS
|
||||||
* 1.3 and up, but that's practical only decades in the future, and the
|
* 1.3 and up, but that's practical only decades in the future, and the
|
||||||
* risk scenario is contrived and very unlikely.
|
* risk scenario is contrived and very unlikely.
|
||||||
*/
|
*/
|
||||||
if (SSL_CTX_get0_certificate(client_ctx) != NULL &&
|
if (SSL_CTX_get0_certificate(client_ctx) != NULL &&
|
||||||
SSL_CTX_get0_privatekey(client_ctx) != NULL)
|
SSL_CTX_get0_privatekey(client_ctx) != NULL)
|
||||||
tls_enable_client_rpk(client_ctx, NULL);
|
tls_enable_client_rpk(client_ctx, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* With OpenSSL 1.0.2 and later the client EECDH curve list becomes
|
* With OpenSSL 1.0.2 and later the client EECDH curve list becomes
|
||||||
* configurable with the preferred curve negotiated via the supported
|
* configurable with the preferred curve negotiated via the supported
|
||||||
* curves extension. With OpenSSL 3.0 and TLS 1.3, the same applies
|
* curves extension. With OpenSSL 3.0 and TLS 1.3, the same applies to
|
||||||
* to the FFDHE groups which become part of a unified "groups" list.
|
* the FFDHE groups which become part of a unified "groups" list.
|
||||||
*/
|
*/
|
||||||
tls_auto_groups(client_ctx, var_tls_eecdh_auto, var_tls_ffdhe_auto);
|
tls_auto_groups(client_ctx, var_tls_eecdh_auto, var_tls_ffdhe_auto);
|
||||||
|
|
||||||
|
@ -459,7 +459,6 @@ void tls_dane_add_fpt_digests(TLS_DANE *dane, int pkey_only,
|
|||||||
msg_warn("malformed fingerprint value: %.384s", values->argv[i]);
|
msg_warn("malformed fingerprint value: %.384s", values->argv[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define USTR_LEN(raw) (unsigned char *) STR(raw), VSTRING_LEN(raw)
|
#define USTR_LEN(raw) (unsigned char *) STR(raw), VSTRING_LEN(raw)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -474,7 +473,7 @@ void tls_dane_add_fpt_digests(TLS_DANE *dane, int pkey_only,
|
|||||||
* some other cert digest). No such attacks are known at this time,
|
* some other cert digest). No such attacks are known at this time,
|
||||||
* and it is expected that if any are found they would work within as
|
* and it is expected that if any are found they would work within as
|
||||||
* well as across the cert/pkey data types.
|
* well as across the cert/pkey data types.
|
||||||
*
|
*
|
||||||
* That said, when `pkey_only` is true, we match only public keys.
|
* That said, when `pkey_only` is true, we match only public keys.
|
||||||
*
|
*
|
||||||
* The private-use matching type "255" is mapped to the configured
|
* The private-use matching type "255" is mapped to the configured
|
||||||
@ -488,7 +487,6 @@ void tls_dane_add_fpt_digests(TLS_DANE *dane, int pkey_only,
|
|||||||
tlsa_info("fingerprint", "digest as private-use TLSA record",
|
tlsa_info("fingerprint", "digest as private-use TLSA record",
|
||||||
3, 0, 255, USTR_LEN(raw));
|
3, 0, 255, USTR_LEN(raw));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The public key match is unconditional */
|
/* The public key match is unconditional */
|
||||||
dane->tlsa = tlsa_prepend(dane->tlsa, 3, 1, 255, USTR_LEN(raw));
|
dane->tlsa = tlsa_prepend(dane->tlsa, 3, 1, 255, USTR_LEN(raw));
|
||||||
if (log_mask & (TLS_LOG_VERBOSE | TLS_LOG_DANE))
|
if (log_mask & (TLS_LOG_VERBOSE | TLS_LOG_DANE))
|
||||||
@ -820,10 +818,11 @@ int tls_dane_enable(TLS_SESS_STATE *TLScontext)
|
|||||||
tp->mtype, tp->data, tp->length);
|
tp->mtype, tp->data, tp->length);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
++usable;
|
++usable;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable use of RFC7250 raw public keys if any TLSA record
|
* Disable use of RFC7250 raw public keys if any TLSA record
|
||||||
* depends on X.509 certificates. Only DANE-EE(3) SPKI(1) records
|
* depends on X.509 certificates. Only DANE-EE(3) SPKI(1)
|
||||||
* can get by with just a public key.
|
* records can get by with just a public key.
|
||||||
*/
|
*/
|
||||||
if (tp->usage != DNS_TLSA_USAGE_DOMAIN_ISSUED_CERTIFICATE
|
if (tp->usage != DNS_TLSA_USAGE_DOMAIN_ISSUED_CERTIFICATE
|
||||||
|| tp->selector != DNS_TLSA_SELECTOR_SUBJECTPUBLICKEYINFO)
|
|| tp->selector != DNS_TLSA_SELECTOR_SUBJECTPUBLICKEYINFO)
|
||||||
|
@ -305,11 +305,11 @@ void tls_tmp_dh(SSL_CTX *ctx, int useauto)
|
|||||||
/* ------------------------------------- Common API */
|
/* ------------------------------------- Common API */
|
||||||
|
|
||||||
#define AG_STAT_OK (0)
|
#define AG_STAT_OK (0)
|
||||||
#define AG_STAT_NO_GROUP (-1) /* no usable group, may retry */
|
#define AG_STAT_NO_GROUP (-1) /* no usable group, may retry */
|
||||||
#define AG_STAT_NO_RETRY (-2) /* other error, don't retry */
|
#define AG_STAT_NO_RETRY (-2) /* other error, don't retry */
|
||||||
|
|
||||||
static int setup_auto_groups(SSL_CTX *ctx, const char *origin,
|
static int setup_auto_groups(SSL_CTX *ctx, const char *origin,
|
||||||
const char *eecdh,
|
const char *eecdh,
|
||||||
const char *ffdhe)
|
const char *ffdhe)
|
||||||
{
|
{
|
||||||
#ifndef OPENSSL_NO_ECDH
|
#ifndef OPENSSL_NO_ECDH
|
||||||
@ -325,17 +325,17 @@ static int setup_auto_groups(SSL_CTX *ctx, const char *origin,
|
|||||||
tls_print_errors();
|
tls_print_errors();
|
||||||
return (AG_STAT_NO_RETRY);
|
return (AG_STAT_NO_RETRY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!names)
|
if (!names)
|
||||||
names = vstring_alloc(sizeof DEF_TLS_EECDH_AUTO +
|
names = vstring_alloc(sizeof DEF_TLS_EECDH_AUTO +
|
||||||
sizeof DEF_TLS_FFDHE_AUTO);
|
sizeof DEF_TLS_FFDHE_AUTO);
|
||||||
VSTRING_RESET(names);
|
VSTRING_RESET(names);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OpenSSL does not tolerate duplicate groups in the requested list.
|
* OpenSSL does not tolerate duplicate groups in the requested list.
|
||||||
* Deduplicate case-insensitively, just in case OpenSSL some day supports
|
* Deduplicate case-insensitively, just in case OpenSSL some day supports
|
||||||
* case-insensitive group lookup. Deduplicate only verified extant groups
|
* case-insensitive group lookup. Deduplicate only verified extant
|
||||||
* we're going to ask OpenSSL to use.
|
* groups we're going to ask OpenSSL to use.
|
||||||
*
|
*
|
||||||
* OpenSSL 3.3 supports "?<name>" as a syntax for optionally ignoring
|
* OpenSSL 3.3 supports "?<name>" as a syntax for optionally ignoring
|
||||||
* unsupported groups, so we could skip checking against the throw-away
|
* unsupported groups, so we could skip checking against the throw-away
|
||||||
* CTX when linked against 3.3 or higher, but the cost savings don't
|
* CTX when linked against 3.3 or higher, but the cost savings don't
|
||||||
@ -358,11 +358,12 @@ static int setup_auto_groups(SSL_CTX *ctx, const char *origin,
|
|||||||
SETUP_AG_RETURN(AG_STAT_NO_GROUP);
|
SETUP_AG_RETURN(AG_STAT_NO_GROUP);
|
||||||
}
|
}
|
||||||
for (; group != 0; group = mystrtok(&groups, GROUPS_SEP)) {
|
for (; group != 0; group = mystrtok(&groups, GROUPS_SEP)) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Validate the group name by trying it as the group for a throw-away
|
* Validate the group name by trying it as the group for a throw-away
|
||||||
* SSL context. This way, we can ask for new groups that may not yet be
|
* SSL context. This way, we can ask for new groups that may not yet
|
||||||
* supported by the underlying OpenSSL runtime. Unsupported groups are
|
* be supported by the underlying OpenSSL runtime. Unsupported
|
||||||
* silently ignored.
|
* groups are silently ignored.
|
||||||
*/
|
*/
|
||||||
ERR_set_mark();
|
ERR_set_mark();
|
||||||
if (SSL_CTX_set1_curves_list(tmpctx, group) > 0 &&
|
if (SSL_CTX_set1_curves_list(tmpctx, group) > 0 &&
|
||||||
@ -412,7 +413,7 @@ void tls_auto_groups(SSL_CTX *ctx, const char *eecdh, const char *ffdhe)
|
|||||||
* group selection is mere performance tuning and not security critical.
|
* group selection is mere performance tuning and not security critical.
|
||||||
* All the groups supported for negotiation should be strong enough.
|
* All the groups supported for negotiation should be strong enough.
|
||||||
*/
|
*/
|
||||||
for (origin = "configured"; /* void */ ; /* void */) {
|
for (origin = "configured"; /* void */ ; /* void */ ) {
|
||||||
switch (setup_auto_groups(ctx, origin, eecdh, ffdhe)) {
|
switch (setup_auto_groups(ctx, origin, eecdh, ffdhe)) {
|
||||||
case AG_STAT_OK:
|
case AG_STAT_OK:
|
||||||
return;
|
return;
|
||||||
|
@ -1080,11 +1080,11 @@ void tls_get_signature_params(TLS_SESS_STATE *TLScontext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* On the client side, a TLS 1.3 KEM has no server key, just ciphertext to
|
* On the client side, a TLS 1.3 KEM has no server key, just ciphertext
|
||||||
* decapsulate, but, as of OpenSSL 3.0, the client can still obtain the
|
* to decapsulate, but, as of OpenSSL 3.0, the client can still obtain
|
||||||
* negotiated group name directly. We nevertheless still try to get the
|
* the negotiated group name directly. We nevertheless still try to get
|
||||||
* group details from the peer key first, which works with OpenSSL 1.1.1
|
* the group details from the peer key first, which works with OpenSSL
|
||||||
* and retains the original output format for the (EC)DH groups.
|
* 1.1.1 and retains the original output format for the (EC)DH groups.
|
||||||
*/
|
*/
|
||||||
if (!kex_name)
|
if (!kex_name)
|
||||||
kex_name = TLS_GROUP_NAME(ssl);
|
kex_name = TLS_GROUP_NAME(ssl);
|
||||||
@ -1252,10 +1252,10 @@ void tls_log_summary(TLS_ROLE role, TLS_USAGE usage, TLS_SESS_STATE *ctx)
|
|||||||
ctx->srvr_sig_name);
|
ctx->srvr_sig_name);
|
||||||
if (ctx->srvr_sig_curve && *ctx->srvr_sig_curve)
|
if (ctx->srvr_sig_curve && *ctx->srvr_sig_curve)
|
||||||
vstring_sprintf_append(msg, " (%s%s)", ctx->srvr_sig_curve,
|
vstring_sprintf_append(msg, " (%s%s)", ctx->srvr_sig_curve,
|
||||||
ctx->stoc_rpk ? " raw public key" : "");
|
ctx->stoc_rpk ? " raw public key" : "");
|
||||||
else if (ctx->srvr_sig_bits > 0)
|
else if (ctx->srvr_sig_bits > 0)
|
||||||
vstring_sprintf_append(msg, " (%d bit%s)", ctx->srvr_sig_bits,
|
vstring_sprintf_append(msg, " (%d bit%s)", ctx->srvr_sig_bits,
|
||||||
ctx->stoc_rpk ? " raw public key" : "s");
|
ctx->stoc_rpk ? " raw public key" : "s");
|
||||||
else if (ctx->stoc_rpk)
|
else if (ctx->stoc_rpk)
|
||||||
vstring_sprintf_append(msg, " (raw public key)");
|
vstring_sprintf_append(msg, " (raw public key)");
|
||||||
if (ctx->srvr_sig_dgst && *ctx->srvr_sig_dgst)
|
if (ctx->srvr_sig_dgst && *ctx->srvr_sig_dgst)
|
||||||
@ -1267,10 +1267,10 @@ void tls_log_summary(TLS_ROLE role, TLS_USAGE usage, TLS_SESS_STATE *ctx)
|
|||||||
ctx->clnt_sig_name);
|
ctx->clnt_sig_name);
|
||||||
if (ctx->clnt_sig_curve && *ctx->clnt_sig_curve)
|
if (ctx->clnt_sig_curve && *ctx->clnt_sig_curve)
|
||||||
vstring_sprintf_append(msg, " (%s%s)", ctx->clnt_sig_curve,
|
vstring_sprintf_append(msg, " (%s%s)", ctx->clnt_sig_curve,
|
||||||
ctx->ctos_rpk ? " raw public key" : "");
|
ctx->ctos_rpk ? " raw public key" : "");
|
||||||
else if (ctx->clnt_sig_bits > 0)
|
else if (ctx->clnt_sig_bits > 0)
|
||||||
vstring_sprintf_append(msg, " (%d bit%s)", ctx->clnt_sig_bits,
|
vstring_sprintf_append(msg, " (%d bit%s)", ctx->clnt_sig_bits,
|
||||||
ctx->ctos_rpk ? " raw public key" : "s");
|
ctx->ctos_rpk ? " raw public key" : "s");
|
||||||
else if (ctx->ctos_rpk)
|
else if (ctx->ctos_rpk)
|
||||||
vstring_sprintf_append(msg, " (raw public key)");
|
vstring_sprintf_append(msg, " (raw public key)");
|
||||||
if (ctx->clnt_sig_dgst && *ctx->clnt_sig_dgst)
|
if (ctx->clnt_sig_dgst && *ctx->clnt_sig_dgst)
|
||||||
@ -1465,16 +1465,16 @@ void tls_check_version(void)
|
|||||||
* later minor numbers starting with 3.0.0.
|
* later minor numbers starting with 3.0.0.
|
||||||
*/
|
*/
|
||||||
if (hdr_info.major >= 3) {
|
if (hdr_info.major >= 3) {
|
||||||
warn_compat = lib_info.major != hdr_info.major
|
warn_compat = lib_info.major != hdr_info.major
|
||||||
|| lib_info.minor < hdr_info.minor;
|
|| lib_info.minor < hdr_info.minor;
|
||||||
} else if (hdr_info.major == 1 && hdr_info.minor != 0) {
|
} else if (hdr_info.major == 1 && hdr_info.minor != 0) {
|
||||||
warn_compat = lib_info.major != hdr_info.major
|
warn_compat = lib_info.major != hdr_info.major
|
||||||
|| lib_info.minor != hdr_info.minor
|
|| lib_info.minor != hdr_info.minor
|
||||||
|| lib_info.micro < hdr_info.micro;
|
|| lib_info.micro < hdr_info.micro;
|
||||||
} else {
|
} else {
|
||||||
warn_compat = lib_info.major != hdr_info.major
|
warn_compat = lib_info.major != hdr_info.major
|
||||||
|| lib_info.minor != hdr_info.minor
|
|| lib_info.minor != hdr_info.minor
|
||||||
|| lib_info.micro != hdr_info.micro;
|
|| lib_info.micro != hdr_info.micro;
|
||||||
}
|
}
|
||||||
if (warn_compat)
|
if (warn_compat)
|
||||||
msg_warn("run-time library vs. compile-time header version mismatch: "
|
msg_warn("run-time library vs. compile-time header version mismatch: "
|
||||||
|
@ -347,7 +347,7 @@ int tls_proxy_client_start_print(ATTR_PRINT_COMMON_FN print_fn,
|
|||||||
(const void *) props->tlsrpt),
|
(const void *) props->tlsrpt),
|
||||||
#endif
|
#endif
|
||||||
SEND_ATTR_STR(TLS_ATTR_FFAIL_TYPE,
|
SEND_ATTR_STR(TLS_ATTR_FFAIL_TYPE,
|
||||||
STRING_OR_EMPTY(props->ffail_type)),
|
STRING_OR_EMPTY(props->ffail_type)),
|
||||||
ATTR_TYPE_END);
|
ATTR_TYPE_END);
|
||||||
/* Do not flush the stream. */
|
/* Do not flush the stream. */
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
|
@ -168,10 +168,12 @@
|
|||||||
static const char server_session_id_context[] = "Postfix/TLS";
|
static const char server_session_id_context[] = "Postfix/TLS";
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_TLSEXT
|
#ifndef OPENSSL_NO_TLSEXT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We retain the cipher handle for the lifetime of the process.
|
* We retain the cipher handle for the lifetime of the process.
|
||||||
*/
|
*/
|
||||||
static const EVP_CIPHER *tkt_cipher;
|
static const EVP_CIPHER *tkt_cipher;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GET_SID(s, v, lptr) ((v) = SSL_SESSION_get_id((s), (lptr)))
|
#define GET_SID(s, v, lptr) ((v) = SSL_SESSION_get_id((s), (lptr)))
|
||||||
@ -691,10 +693,10 @@ TLS_APPL_STATE *tls_server_init(const TLS_SERVER_INIT_PROPS *props)
|
|||||||
tls_tmp_dh(sni_ctx, 1);
|
tls_tmp_dh(sni_ctx, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable EECDH if available, errors are not fatal, we just keep going with
|
* Enable EECDH if available, errors are not fatal, we just keep going
|
||||||
* any remaining key-exchange algorithms. With OpenSSL 3.0 and TLS 1.3,
|
* with any remaining key-exchange algorithms. With OpenSSL 3.0 and TLS
|
||||||
* the same applies to the FFDHE groups which become part of a unified
|
* 1.3, the same applies to the FFDHE groups which become part of a
|
||||||
* "groups" list.
|
* unified "groups" list.
|
||||||
*/
|
*/
|
||||||
tls_auto_groups(server_ctx, var_tls_eecdh_auto, var_tls_ffdhe_auto);
|
tls_auto_groups(server_ctx, var_tls_eecdh_auto, var_tls_ffdhe_auto);
|
||||||
tls_auto_groups(sni_ctx, var_tls_eecdh_auto, var_tls_ffdhe_auto);
|
tls_auto_groups(sni_ctx, var_tls_eecdh_auto, var_tls_ffdhe_auto);
|
||||||
@ -874,7 +876,8 @@ TLS_SESS_STATE *tls_server_start(const TLS_SERVER_START_PROPS *props)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When encryption is mandatory use the 80-bit plus OpenSSL security level.
|
* When encryption is mandatory use the 80-bit plus OpenSSL security
|
||||||
|
* level.
|
||||||
*/
|
*/
|
||||||
if (props->requirecert)
|
if (props->requirecert)
|
||||||
SSL_set_security_level(TLScontext->con, 1);
|
SSL_set_security_level(TLScontext->con, 1);
|
||||||
@ -1054,7 +1057,7 @@ TLS_SESS_STATE *tls_server_post_accept(TLS_SESS_STATE *TLScontext)
|
|||||||
* way to associate DANE TLSA RRs with clients just yet, we just
|
* way to associate DANE TLSA RRs with clients just yet, we just
|
||||||
* make the fingerprint available to the access(5) layer.
|
* make the fingerprint available to the access(5) layer.
|
||||||
*/
|
*/
|
||||||
TLScontext->peer_status |= TLS_CRED_FLAG_RPK;
|
TLScontext->peer_status |= TLS_CRED_FLAG_RPK;
|
||||||
TLScontext->peer_pkey_fprint =
|
TLScontext->peer_pkey_fprint =
|
||||||
tls_pkey_fprint(pkey, TLScontext->mdalg);
|
tls_pkey_fprint(pkey, TLScontext->mdalg);
|
||||||
if (TLScontext->log_mask & (TLS_LOG_VERBOSE | TLS_LOG_PEERCERT))
|
if (TLScontext->log_mask & (TLS_LOG_VERBOSE | TLS_LOG_PEERCERT))
|
||||||
|
@ -60,14 +60,14 @@ int alldig(const char *string)
|
|||||||
|
|
||||||
/* allalnum - return true if string is all alphanum */
|
/* allalnum - return true if string is all alphanum */
|
||||||
|
|
||||||
int allalnum(const char *string)
|
int allalnum(const char *string)
|
||||||
{
|
{
|
||||||
const char *cp;
|
const char *cp;
|
||||||
|
|
||||||
if (*string == 0)
|
if (*string == 0)
|
||||||
return (0);
|
return (0);
|
||||||
for (cp = string; *cp != 0; cp++)
|
for (cp = string; *cp != 0; cp++)
|
||||||
if (!ISALNUM(*cp))
|
if (!ISALNUM(*cp))
|
||||||
return (0);
|
return (0);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
/* input after at most \fIcount\fR -1 times and leaves the
|
/* input after at most \fIcount\fR -1 times and leaves the
|
||||||
/* remainder, if any, in the last array element. It is an error
|
/* remainder, if any, in the last array element. It is an error
|
||||||
/* to specify a count < 1.
|
/* to specify a count < 1.
|
||||||
/*
|
/*
|
||||||
/* argv_split_append() performs the same operation as argv_split(),
|
/* argv_split_append() performs the same operation as argv_split(),
|
||||||
/* but appends the result to an existing string array.
|
/* but appends the result to an existing string array.
|
||||||
/* SEE ALSO
|
/* SEE ALSO
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
/* const char *string;
|
/* const char *string;
|
||||||
/* const char *parens;
|
/* const char *parens;
|
||||||
/* DESCRIPTION
|
/* DESCRIPTION
|
||||||
/* balpar() determines the length of a string enclosed in
|
/* balpar() determines the length of a string enclosed in
|
||||||
/* the specified parentheses, zero in case of error.
|
/* the specified parentheses, zero in case of error.
|
||||||
/* SEE ALSO
|
/* SEE ALSO
|
||||||
/* A balpar() routine appears in Brian W. Kernighan, P.J. Plauger:
|
/* A balpar() routine appears in Brian W. Kernighan, P.J. Plauger:
|
||||||
|
@ -291,7 +291,7 @@ int main(int argc, char **argv)
|
|||||||
vstream_printf("%s -> 0x%x -> %s\n",
|
vstream_printf("%s -> 0x%x -> %s\n",
|
||||||
STR(in_buf), demo_mask,
|
STR(in_buf), demo_mask,
|
||||||
demo_str ? demo_str : "(null)");
|
demo_str ? demo_str : "(null)");
|
||||||
demo_mask <<=1;
|
demo_mask <<= 1;
|
||||||
demo_str = str_byte_mask_opt(out_buf, "mask", demo_table,
|
demo_str = str_byte_mask_opt(out_buf, "mask", demo_table,
|
||||||
demo_mask, out_feature_mask);
|
demo_mask, out_feature_mask);
|
||||||
vstream_printf("0x%x -> %s\n",
|
vstream_printf("0x%x -> %s\n",
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
* strings should be.
|
* strings should be.
|
||||||
*/
|
*/
|
||||||
#ifdef HAS_IPV6
|
#ifdef HAS_IPV6
|
||||||
# define CIDR_MATCH_ABYTES MAI_V6ADDR_BYTES
|
#define CIDR_MATCH_ABYTES MAI_V6ADDR_BYTES
|
||||||
#else
|
#else
|
||||||
# define CIDR_MATCH_ABYTES MAI_V4ADDR_BYTES
|
#define CIDR_MATCH_ABYTES MAI_V4ADDR_BYTES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -325,7 +325,7 @@ extern const char *dict_file_lookup(DICT *dict, const char *);
|
|||||||
* dict_stream(3)
|
* dict_stream(3)
|
||||||
*/
|
*/
|
||||||
extern VSTREAM *dict_stream_open(const char *dict_type, const char *mapname,
|
extern VSTREAM *dict_stream_open(const char *dict_type, const char *mapname,
|
||||||
int open_flags, int dict_flags, struct stat * st, VSTRING **why);
|
int open_flags, int dict_flags, struct stat * st, VSTRING **why);
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
/* .ad
|
/* .ad
|
||||||
|
@ -41,4 +41,4 @@ extern MKMAP *mkmap_cdb_open(const char *);
|
|||||||
/* New York, NY 10011, USA
|
/* New York, NY 10011, USA
|
||||||
/*--*/
|
/*--*/
|
||||||
|
|
||||||
#endif /* _DICT_CDB_H_INCLUDED_ */
|
#endif /* _DICT_CDB_H_INCLUDED_ */
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
/* content as specified above.
|
/* content as specified above.
|
||||||
/* .IP st
|
/* .IP st
|
||||||
/* File metadata with the file owner, or fake metadata with the
|
/* File metadata with the file owner, or fake metadata with the
|
||||||
/* real UID and GID of the dict_stream_open() caller. This is
|
/* real UID and GID of the dict_stream_open() caller. This is
|
||||||
/* used for "taint" tracking (zero=trusted, non-zero=untrusted).
|
/* used for "taint" tracking (zero=trusted, non-zero=untrusted).
|
||||||
/* IP why
|
/* IP why
|
||||||
/* Pointer to pointer to error message storage. dict_stream_open()
|
/* Pointer to pointer to error message storage. dict_stream_open()
|
||||||
|
@ -49,14 +49,14 @@ int main(int unused_argc, char **unused_argv)
|
|||||||
DO((res = fcntl(3, F_GETFD, 0)));
|
DO((res = fcntl(3, F_GETFD, 0)));
|
||||||
if (res & 1)
|
if (res & 1)
|
||||||
printf(
|
printf(
|
||||||
"Yes, a newly dup2()ed file-descriptor has the close-on-exec \
|
"Yes, a newly dup2()ed file-descriptor has the close-on-exec \
|
||||||
flag cloned.\n\
|
flag cloned.\n\
|
||||||
THIS VIOLATES Posix1003.1 section 6.2.1.2 or 6.5.2.2!\n\
|
THIS VIOLATES Posix1003.1 section 6.2.1.2 or 6.5.2.2!\n\
|
||||||
You should #define DUP2_DUPS_CLOSE_ON_EXEC in sys_defs.h \
|
You should #define DUP2_DUPS_CLOSE_ON_EXEC in sys_defs.h \
|
||||||
for your OS.\n");
|
for your OS.\n");
|
||||||
else
|
else
|
||||||
printf(
|
printf(
|
||||||
"No, a newly dup2()ed file-descriptor has the close-on-exec \
|
"No, a newly dup2()ed file-descriptor has the close-on-exec \
|
||||||
flag cleared.\n\
|
flag cleared.\n\
|
||||||
This complies with Posix1003.1 section 6.2.1.2 and 6.5.2.2!\n");
|
This complies with Posix1003.1 section 6.2.1.2 and 6.5.2.2!\n");
|
||||||
|
|
||||||
|
@ -46,4 +46,3 @@ int duplex_pipe(int *fds)
|
|||||||
return (sane_socketpair(AF_UNIX, SOCK_STREAM, 0, fds));
|
return (sane_socketpair(AF_UNIX, SOCK_STREAM, 0, fds));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ" SPACE_TAB;
|
|||||||
&& command[strspn(command, SPACE_TAB)] != 0) {
|
&& command[strspn(command, SPACE_TAB)] != 0) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No shell meta characters found, so we can try to avoid the overhead
|
* No shell meta characters found, so we can try to avoid the
|
||||||
* of running a shell. Just split the command on whitespace and exec
|
* overhead of running a shell. Just split the command on whitespace
|
||||||
* the result directly.
|
* and exec the result directly.
|
||||||
*/
|
*/
|
||||||
argv = argv_split(command, SPACE_TAB);
|
argv = argv_split(command, SPACE_TAB);
|
||||||
(void) execvp(argv->argv[0], argv->argv);
|
(void) execvp(argv->argv[0], argv->argv);
|
||||||
|
@ -192,7 +192,8 @@ struct test_case test_cases[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
struct test_case *tp;
|
struct test_case *tp;
|
||||||
struct association *ap;
|
struct association *ap;
|
||||||
int pass = 0;
|
int pass = 0;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
/* The maximal number of all digits after the decimal point.
|
/* The maximal number of all digits after the decimal point.
|
||||||
/* Specify a number in the range 0..6.
|
/* Specify a number in the range 0..6.
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
/* .ad
|
/* .ad
|
||||||
/* .fi
|
/* .fi
|
||||||
/* The Secure Mailer license must be distributed with this
|
/* The Secure Mailer license must be distributed with this
|
||||||
/* software.
|
/* software.
|
||||||
|
@ -192,8 +192,8 @@ int main(void)
|
|||||||
test_failed = 0;
|
test_failed = 0;
|
||||||
if ((hval = hash_fnvz(tp->str)) != tp->hval) {
|
if ((hval = hash_fnvz(tp->str)) != tp->hval) {
|
||||||
msg_warn("hash_fnv(\"%s\") want %lu, got: %lu",
|
msg_warn("hash_fnv(\"%s\") want %lu, got: %lu",
|
||||||
tp->str, (unsigned long) tp->hval,
|
tp->str, (unsigned long) tp->hval,
|
||||||
(unsigned long) hval);
|
(unsigned long) hval);
|
||||||
test_failed = 1;
|
test_failed = 1;
|
||||||
}
|
}
|
||||||
if (test_failed) {
|
if (test_failed) {
|
||||||
|
@ -157,7 +157,7 @@ const char *host_port(char *buf, char **host, char *def_host,
|
|||||||
* Final sanity checks. We're still sloppy, allowing bare numerical
|
* Final sanity checks. We're still sloppy, allowing bare numerical
|
||||||
* network addresses instead of requiring proper [ipaddress] forms.
|
* network addresses instead of requiring proper [ipaddress] forms.
|
||||||
*/
|
*/
|
||||||
if (*host != def_host
|
if (*host != def_host
|
||||||
&& !valid_utf8_hostname(util_utf8_enable, *host, DONT_GRIPE)
|
&& !valid_utf8_hostname(util_utf8_enable, *host, DONT_GRIPE)
|
||||||
&& !valid_hostaddr(*host, DONT_GRIPE))
|
&& !valid_hostaddr(*host, DONT_GRIPE))
|
||||||
return ("valid hostname or network address required");
|
return ("valid hostname or network address required");
|
||||||
|
@ -64,9 +64,9 @@ static const INET_ADDR_SIZES table[] = {
|
|||||||
|
|
||||||
/* inet_addr_sizes - get address size metrics for address family */
|
/* inet_addr_sizes - get address size metrics for address family */
|
||||||
|
|
||||||
const INET_ADDR_SIZES *inet_addr_sizes(int af)
|
const INET_ADDR_SIZES *inet_addr_sizes(int af)
|
||||||
{
|
{
|
||||||
const INET_ADDR_SIZES *sp;
|
const INET_ADDR_SIZES *sp;
|
||||||
|
|
||||||
for (sp = table; /* see below */ ; sp++) {
|
for (sp = table; /* see below */ ; sp++) {
|
||||||
if (sp >= table + sizeof(table) / sizeof(*table))
|
if (sp >= table + sizeof(table) / sizeof(*table))
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user