X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Freadconf.c;h=218eff70498bcd532a7f86733cbab360ae7114d5;hb=e41be3f6bf1f53f9e9f858320ad1ac62dc86930c;hp=087ab5b9b0a01706437ea3d3905d5ac990e3213b;hpb=a5f239e4959d4df6a4a341d8855e14d17399d671;p=exim.git diff --git a/src/src/readconf.c b/src/src/readconf.c index 087ab5b9b..218eff704 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -140,6 +140,9 @@ static optionlist optionlist_config[] = { { "acl_smtp_auth", opt_stringptr, &acl_smtp_auth }, { "acl_smtp_connect", opt_stringptr, &acl_smtp_connect }, { "acl_smtp_data", opt_stringptr, &acl_smtp_data }, +#ifdef EXPERIMENTAL_PRDR + { "acl_smtp_data_prdr", opt_stringptr, &acl_smtp_data_prdr }, +#endif #ifndef DISABLE_DKIM { "acl_smtp_dkim", opt_stringptr, &acl_smtp_dkim }, #endif @@ -208,15 +211,20 @@ static optionlist optionlist_config[] = { { "disable_ipv6", opt_bool, &disable_ipv6 }, #ifndef DISABLE_DKIM { "dkim_verify_signers", opt_stringptr, &dkim_verify_signers }, +#endif +#ifdef EXPERIMENTAL_DMARC + { "dmarc_forensic_sender", opt_stringptr, &dmarc_forensic_sender }, + { "dmarc_history_file", opt_stringptr, &dmarc_history_file }, + { "dmarc_tld_file", opt_stringptr, &dmarc_tld_file }, #endif { "dns_again_means_nonexist", opt_stringptr, &dns_again_means_nonexist }, { "dns_check_names_pattern", opt_stringptr, &check_dns_names_pattern }, { "dns_csa_search_limit", opt_int, &dns_csa_search_limit }, { "dns_csa_use_reverse", opt_bool, &dns_csa_use_reverse }, + { "dns_dnssec_ok", opt_int, &dns_dnssec_ok }, { "dns_ipv4_lookup", opt_stringptr, &dns_ipv4_lookup }, { "dns_retrans", opt_time, &dns_retrans }, { "dns_retry", opt_int, &dns_retry }, - { "dns_use_dnssec", opt_int, &dns_use_dnssec }, { "dns_use_edns0", opt_int, &dns_use_edns0 }, /* This option is now a no-op, retained for compability */ { "drop_cr", opt_bool, &drop_cr }, @@ -316,6 +324,9 @@ static optionlist optionlist_config[] = { #endif { "pid_file_path", opt_stringptr, &pid_file_path }, { "pipelining_advertise_hosts", opt_stringptr, &pipelining_advertise_hosts }, +#ifdef EXPERIMENTAL_PRDR + { "prdr_enable", opt_bool, &prdr_enable }, +#endif { "preserve_message_logs", opt_bool, &preserve_message_logs }, { "primary_hostname", opt_stringptr, &primary_hostname }, { "print_topbitchars", opt_bool, &print_topbitchars }, @@ -1374,7 +1385,6 @@ uid_t uid; gid_t gid; BOOL boolvalue = TRUE; BOOL freesptr = TRUE; -BOOL extra_condition = FALSE; optionlist *ol, *ol2; struct passwd *pw; void *reset_point; @@ -1437,16 +1447,9 @@ if (ol == NULL) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, CS unknown_txt, name); } -if ((ol->type & opt_set) != 0) - { - uschar *mname = name; - if (Ustrncmp(mname, "no_", 3) == 0) mname += 3; - if (Ustrcmp(mname, "condition") == 0) - extra_condition = TRUE; - else - log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, - "\"%s\" option set for the second time", mname); - } +if ((ol->type & opt_set) && !(ol->type & (opt_rep_con | opt_rep_str))) + log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, + "\"%s\" option set for the second time", name); ol->type |= opt_set | issecure; type = ol->type & opt_mask; @@ -1530,7 +1533,7 @@ switch (type) str_target = (uschar **)(ol->value); else str_target = (uschar **)((uschar *)data_block + (long int)(ol->value)); - if (extra_condition) + if (ol->type & opt_rep_con) { /* We already have a condition, we're conducting a crude hack to let multiple condition rules be chained together, despite storing them in @@ -1539,9 +1542,10 @@ switch (type) strtemp = string_sprintf("${if and{{bool_lax{%s}}{bool_lax{%s}}}}", saved_condition, sptr); *str_target = string_copy_malloc(strtemp); - /* TODO(pdp): there is a memory leak here when we set 3 or more - conditions; I still don't understand the store mechanism enough - to know what's the safe way to free content from an earlier store. + /* TODO(pdp): there is a memory leak here and just below + when we set 3 or more conditions; I still don't + understand the store mechanism enough to know + what's the safe way to free content from an earlier store. AFAICT, stores stack, so freeing an early stored item also stores all data alloc'd after it. If we knew conditions were adjacent, we could survive that, but we don't. So I *think* we need to take @@ -1552,6 +1556,15 @@ switch (type) Because we only do this once, near process start-up, I'm prepared to let this slide for the time being, even though it rankles. */ } + else if (*str_target && (ol->type & opt_rep_str)) + { + uschar sep = Ustrncmp(name, "headers_add", 11)==0 ? '\n' : ':'; + saved_condition = *str_target; + strtemp = saved_condition + Ustrlen(saved_condition)-1; + if (*strtemp == sep) *strtemp = 0; /* eliminate trailing list-sep */ + strtemp = string_sprintf("%s%c%s", saved_condition, sep, sptr); + *str_target = string_copy_malloc(strtemp); + } else { *str_target = sptr; @@ -3816,7 +3829,7 @@ while ((p = get_config_line()) != NULL) pp = p; while (mac_isgraph(*p)) p++; if (p - pp <= 0) log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, - "missing error type"); + "missing error type in retry rule"); /* Test error names for things we understand. */ @@ -3959,27 +3972,15 @@ return acl_line; /* Now the main function: -Arguments: - skip TRUE when this Exim process is doing something that will - not need the ACL data - +Arguments: none Returns: nothing */ static void -readconf_acl(BOOL skip) +readconf_acl(void) { uschar *p; -/* Not receiving messages, don't need to parse the ACL data */ - -if (skip) - { - DEBUG(D_acl) debug_printf("skipping ACL configuration - not needed\n"); - while ((p = get_config_line()) != NULL); - return; - } - /* Read each ACL and add it into the tree. Macro (re)definitions are allowed between ACLs. */ @@ -4064,9 +4065,7 @@ Because it may confuse people as to whether the names are singular or plural, we add "s" if it's missing. There is always enough room in next_section for this. This function is basically just a switch. -Arguments: - skip_acl TRUE if ACL information is not needed - +Arguments: none Returns: nothing */ @@ -4080,7 +4079,7 @@ static uschar *section_list[] = { US"transports"}; void -readconf_rest(BOOL skip_acl) +readconf_rest(void) { int had = 0; @@ -4113,7 +4112,7 @@ while(next_section[0] != 0) switch(mid) { - case 0: readconf_acl(skip_acl); break; + case 0: readconf_acl(); break; case 1: auths_init(); break; case 2: local_scan_init(); break; case 3: readconf_retries(); break;