static uschar * syslog_facility_str;
-static void fn_smtp_receive_timeout(const uschar *, const uschar *);
+static void fn_smtp_receive_timeout(const uschar *, const uschar *, unsigned);
/*************************************************
* Main configuration options *
{ "timezone", opt_stringptr, &timezone_string },
{ "tls_advertise_hosts", opt_stringptr, &tls_advertise_hosts },
#ifdef SUPPORT_TLS
-# ifdef EXPERIMENTAL_REQUIRETLS
- { "tls_advertise_requiretls", opt_stringptr, &tls_advertise_requiretls },
-# endif
{ "tls_certificate", opt_stringptr, &tls_certificate },
{ "tls_crl", opt_stringptr, &tls_crl },
{ "tls_dh_max_bits", opt_int, &tls_dh_max_bits },
#ifdef MACRO_PREDEF
-static void fn_smtp_receive_timeout(const uschar * name, const uschar * str) {/*Dummy*/}
+static void
+fn_smtp_receive_timeout(const uschar * name, const uschar * str, unsigned flags) {/*Dummy*/}
void
options_main(void)
static int syslog_list_size = sizeof(syslog_list)/sizeof(syslog_fac_item);
+#define opt_fn_print BIT(0)
+#define opt_fn_print_label BIT(1)
/*************************************************
/* Handle conditionals, which are also applied to physical lines. Conditions
are of the form ".ifdef ANYTEXT" and are treated as true if any macro
- expansion occured on the rest of the line. A preliminary test for the leading
+ expansion occurred on the rest of the line. A preliminary test for the leading
'.' saves effort on most lines. */
if (*ss == '.')
* Custom-handler options *
*************************************************/
static void
-fn_smtp_receive_timeout(const uschar * name, const uschar * str)
+fn_smtp_receive_timeout(const uschar * name, const uschar * str, unsigned flags)
{
-if (*str == '$')
+if (flags & opt_fn_print)
+ {
+ if (flags & opt_fn_print_label) printf("%s = ", name);
+ printf("%s\n", smtp_receive_timeout_s
+ ? string_printing2(smtp_receive_timeout_s, FALSE)
+ : readconf_printtime(smtp_receive_timeout));
+ }
+else if (*str == '$')
smtp_receive_timeout_s = string_copy(str);
else
{
inttype = US"octal ";
/* Integer: a simple(ish) case; allow octal and hex formats, and
- suffixes K, M and G. The different types affect output, not input. */
+ suffixes K, M, G, and T. The different types affect output, not input. */
case opt_mkint:
case opt_int:
if (errno != ERANGE && *endptr)
{
- uschar * mp = US"GgMmKk\0"; /* YyZzEePpTtGgMmKk */
+ uschar * mp = US"TtGgMmKk\0"; /* YyZzEePpTtGgMmKk */
if ((mp = Ustrchr(mp, *endptr)))
{
*(int *)ol->value = value;
break;
- /* Integer held in K: again, allow octal and hex formats, and suffixes K, M,
- G and T. */
+ /* Integer held in K: again, allow formats and suffixes as above. */
case opt_Kint:
{
if (errno != ERANGE && *endptr)
{
- uschar * mp = US"EePpTtGgMmKk\0"; /* YyZzEePpTtGgMmKk */
+ uschar * mp = US"ZzEePpTtGgMmKk\0"; /* YyZzEePpTtGgMmKk */
if ((mp = Ustrchr(mp, *endptr)))
{
endptr++;
- do
+ while (*(mp += 2))
{
if (lvalue > EXIM_ARITH_MAX/1024 || lvalue < EXIM_ARITH_MIN/1024)
{
}
lvalue *= 1024;
}
- while (*(mp += 2));
}
else
lvalue = (lvalue + 512)/1024;
case opt_func:
{
void (*fn)() = ol->value;
- fn(name, s);
+ fn(name, s, 0);
break;
}
}
int_eximarith_t x = *((int_eximarith_t *)value);
if (!no_labels) printf("%s = ", name);
if (x == 0) printf("0\n");
+ else if ((x & ((1<<30)-1)) == 0) printf(PR_EXIM_ARITH "T\n", x >> 30);
else if ((x & ((1<<20)-1)) == 0) printf(PR_EXIM_ARITH "G\n", x >> 20);
else if ((x & ((1<<10)-1)) == 0) printf(PR_EXIM_ARITH "M\n", x >> 10);
else printf(PR_EXIM_ARITH "K\n", x);
case opt_bool_set:
printf("%s%s\n", (*((BOOL *)value))? "" : "no_", name);
break;
+
+ case opt_func:
+ {
+ void (*fn)() = ol->value;
+ fn(name, NULL, no_labels ? opt_fn_print : opt_fn_print|opt_fn_print_label);
+ break;
+ }
}
return TRUE;
}