mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-30 13:48:06 +00:00
snapshot-20001215
This commit is contained in:
parent
8f4f370bed
commit
0aa30ec7f7
@ -4630,12 +4630,30 @@ Apologies for any names omitted.
|
||||
|
||||
Bugfix: dict_ldap did not properly initialize a handle
|
||||
after connection timeout. Problem reported by Alain Thivillon.
|
||||
did not take his patch because I have no means to verify
|
||||
the code. File: util/dict_ldap.c.
|
||||
File: util/dict_ldap.c.
|
||||
|
||||
20001214
|
||||
|
||||
Feature: local_transport and default_transport now also
|
||||
understand the transport[:destination] notation, so that
|
||||
transport parameters are similar again. File:
|
||||
all transport config parameters are similar again. File:
|
||||
trivial-rewrite/resolve.c, trivial-rewrite/transport.c.
|
||||
|
||||
Code cleanup: mailbox_transport and fallback_transport no
|
||||
longer allow the user to omit the transport part of a
|
||||
transport:destination specification. That just did not make
|
||||
any sense at all. The :destination part is still optional.
|
||||
File: global/deliver_pass.c.
|
||||
|
||||
Feature: most time-related configuration parameters take
|
||||
a one-letter suffix that specifies the time unit: s
|
||||
(second), m (minutes), h (hours), d (days), w (weeks).
|
||||
"postconf -d" output includes the default time unit. Files:
|
||||
many.
|
||||
|
||||
Code cleanup: in a CONFIG_TIME_TABLE, the default time unit
|
||||
is now always the last character of a default time value.
|
||||
It is no longer necessary to specify the default time unit
|
||||
separately. This change means that it is not longer possible
|
||||
to specify default values in the form of function calls.
|
||||
Files: global/mail_conf_time.c, and user code.
|
||||
|
@ -1,3 +1,21 @@
|
||||
Major changes with snapshot-20001215
|
||||
====================================
|
||||
|
||||
This release involves little change in functionality and a lot of
|
||||
small changes to lots of files. The code is put out as a separate
|
||||
snapshot release so that I have a tested baseline for further work.
|
||||
|
||||
All time-related configuration parameters now accept a one-letter
|
||||
suffix to indicate the time unit (s: second, m: minute, h: hour,
|
||||
d: day, w: week). The exceptions are the LDAP and MYSQL modules
|
||||
which are maintained separately.
|
||||
|
||||
The local_transport and default_transport configuration parameters
|
||||
can now be specified in transport:destination notation, just like
|
||||
the mailbox_transport and fallback_transport parameters. The
|
||||
:destination part is optional. This change makes the relayhost
|
||||
parameter obsolescent.
|
||||
|
||||
Incompatible changes with snapshot-20001210
|
||||
===========================================
|
||||
|
||||
|
@ -143,11 +143,15 @@ Instead of dGVzdAB0ZXN0AHRlc3RwYXNz, specify the base64 encoded
|
||||
form of username\0username\0password (the \0 is a null byte). The
|
||||
example above is for a user named `test' with password `testpass'.
|
||||
|
||||
You can use e. g.: printf 'username\0username\0password' | mmencode
|
||||
or perl -MMIME::Base64 -e 'print
|
||||
encode_base64("username\0username\0password");'
|
||||
to get this output (MIME::Base64 is available from CPAN in case you
|
||||
don't have it).
|
||||
In order to generate base64 encoded authentication information you
|
||||
can use one of the following commands:
|
||||
|
||||
% printf 'username\0username\0password' | mmencode
|
||||
|
||||
% perl -MMIME::Base64 -e \
|
||||
'print encode_base64("username\0username\0password");'
|
||||
|
||||
MIME::Base64 is available from www.cpan.org.
|
||||
|
||||
Enabling SASL authentication in the Postfix SMTP client
|
||||
=======================================================
|
||||
|
@ -14,7 +14,10 @@ always_bcc =
|
||||
# take to handle a request before it assumes it is wedged and commits
|
||||
# suicide.
|
||||
#
|
||||
daemon_timeout = 18000
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
daemon_timeout = 18000s
|
||||
|
||||
# The default_database_type parameter specifies the default database
|
||||
# type to use in postalias(1) and postmap(1) commands. On many UNIX
|
||||
@ -117,7 +120,10 @@ ipc_idle = 100
|
||||
# of deadlock situations. If the timeout is exceeded the software
|
||||
# aborts with a fatal error.
|
||||
#
|
||||
ipc_timeout = 3600
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
#ipc_timeout = 3600s
|
||||
|
||||
# The mail_name parameter specifies the mail system name that is used
|
||||
# in Received: headers, in the SMTP greeting banner, and in bounced
|
||||
@ -333,10 +339,16 @@ syslog_facility = mail
|
||||
# a Postfix daemon. This prevents programs from getting stuck when the
|
||||
# mail system is under heavy load.
|
||||
#
|
||||
trigger_timeout = 10
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
trigger_timeout = 10s
|
||||
|
||||
# The delay_warning_time specifies after how many hours a warning
|
||||
# is sent that mail has not yet been delivered. By default, no warning
|
||||
# is sent.
|
||||
#
|
||||
# delay_warning_time = 0
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is h (hours).
|
||||
#
|
||||
# delay_warning_time = 0h
|
||||
|
@ -36,7 +36,10 @@ maximal_backoff_time = 4000
|
||||
# The maximal_queue_lifetime parameter specifies the maximal time in
|
||||
# days a message is queued before it is sent back as undeliverable.
|
||||
#
|
||||
maximal_queue_lifetime = 5
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is d (days).
|
||||
#
|
||||
maximal_queue_lifetime = 5d
|
||||
|
||||
# The minimal_backoff_time parameter specifies the minimal time in
|
||||
# seconds between attempts to deliver a deferred message. This
|
||||
@ -48,7 +51,10 @@ minimal_backoff_time = 1000
|
||||
# The queue_run_delay parameter specifies the time in seconds
|
||||
# between deferred queue scans by the queue manager.
|
||||
#
|
||||
queue_run_delay = 1000
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
queue_run_delay = 1000s
|
||||
|
||||
# The defer_transports parameter specifies the names of transports
|
||||
# that should not be delivered to unless someone issues "sendmail
|
||||
|
@ -36,7 +36,10 @@ deliver_lock_attempts = 5
|
||||
# The deliver_lock_delay parameter limits the time in seconds between
|
||||
# attempts to acquire an exclusive lock.
|
||||
#
|
||||
deliver_lock_delay = 1
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
deliver_lock_delay = 1s
|
||||
|
||||
# The duplicate_filter_limit parameter limits the number of addresses
|
||||
# remembered by the duplicate filter for alias, virtual, etc.
|
||||
@ -52,7 +55,10 @@ fork_attempts = 5
|
||||
# The fork_delay parameter specifies the delay in seconds between
|
||||
# fork() attempts.
|
||||
#
|
||||
fork_delay = 1
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
fork_delay = 1s
|
||||
|
||||
# The header_size_limit parameter limits the amount of memory in
|
||||
# bytes used for processing a message header. If a header is larger,
|
||||
|
@ -114,8 +114,11 @@ smtp_destination_recipient_limit = $default_destination_recipient_limit
|
||||
# tries the next address on the mail exchanger list. Specify 0 to
|
||||
# disable the timeout.
|
||||
#
|
||||
# smtp_connect_timeout = 30
|
||||
smtp_connect_timeout = 0
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
# smtp_connect_timeout = 30s
|
||||
smtp_connect_timeout = 0s
|
||||
|
||||
# The smtp_helo_timeout parameter specifies the SMTP client timeout
|
||||
# in seconds for receiving the SMTP greeting banner.
|
||||
@ -124,7 +127,10 @@ smtp_connect_timeout = 0
|
||||
# banner, or when it sends no greeting banner within the deadline,
|
||||
# the SMTP client tries the next address on the mail exchanger list.
|
||||
#
|
||||
smtp_helo_timeout = 300
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_helo_timeout = 300s
|
||||
|
||||
# The smtp_mail_timeout parameter specifies the SMTP client timeout
|
||||
# in seconds for sending the SMTP MAIL FROM command, and for receiving
|
||||
@ -133,7 +139,10 @@ smtp_helo_timeout = 300
|
||||
# In case of problems the client does NOT try the next address on
|
||||
# the mail exchanger list.
|
||||
#
|
||||
smtp_mail_timeout = 300
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_mail_timeout = 300s
|
||||
|
||||
# The smtp_rcpt_timeout parameter specifies the SMTP client timeout
|
||||
# in seconds for sending the SMTP RCPT TO command, and for receiving
|
||||
@ -142,7 +151,10 @@ smtp_mail_timeout = 300
|
||||
# In case of problems the client does NOT try the next address on
|
||||
# the mail exchanger list.
|
||||
#
|
||||
smtp_rcpt_timeout = 300
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_rcpt_timeout = 300s
|
||||
|
||||
# The smtp_data_init_timeout parameter specifies the SMTP client
|
||||
# timeout in seconds for sending the SMTP DATA command, and for
|
||||
@ -151,7 +163,10 @@ smtp_rcpt_timeout = 300
|
||||
# In case of problems the client does NOT try the next address on
|
||||
# the mail exchanger list.
|
||||
#
|
||||
smtp_data_init_timeout = 120
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_data_init_timeout = 120s
|
||||
|
||||
# The smtp_data_xfer_timeout parameter specifies the SMTP client
|
||||
# timeout in seconds for sending the SMTP message content. When
|
||||
@ -161,7 +176,10 @@ smtp_data_init_timeout = 120
|
||||
# In case of problems the client does NOT try the next address on
|
||||
# the mail exchanger list.
|
||||
#
|
||||
smtp_data_xfer_timeout = 180
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_data_xfer_timeout = 180s
|
||||
|
||||
# The smtp_data_done_timeout parameter specifies the SMTP client
|
||||
# timeout in seconds for sending the SMTP ".", and for receiving
|
||||
@ -173,10 +191,16 @@ smtp_data_xfer_timeout = 180
|
||||
# In case of problems the client does NOT try the next address on
|
||||
# the mail exchanger list.
|
||||
#
|
||||
smtp_data_done_timeout = 600
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_data_done_timeout = 600s
|
||||
|
||||
# The smtp_quit_timeout parameter specifies the SMTP client timeout
|
||||
# in seconds for sending the SMTP QUIT command, and for receiving
|
||||
# the server response.
|
||||
#
|
||||
smtp_quit_timeout = 300
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtp_quit_timeout = 300s
|
||||
|
@ -58,7 +58,10 @@ smtpd_recipient_limit = 1000
|
||||
# Note: if you set SMTP timeouts to large values you must update the
|
||||
# global ipc_timeout parameter as well. See sample-misc.cf for details.
|
||||
#
|
||||
smtpd_timeout = 300
|
||||
# Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
|
||||
# The default time unit is s (seconds).
|
||||
#
|
||||
smtpd_timeout = 300s
|
||||
|
||||
#
|
||||
# TARPIT CONTROLS
|
||||
|
@ -283,8 +283,8 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 1000,
|
||||
VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 'h', 0, 0,
|
||||
VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 8640000,
|
||||
VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 0, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_STR_TABLE str_table[] = {
|
||||
|
@ -116,7 +116,7 @@ CONFIG_INT_TABLE cleanup_int_table[] = {
|
||||
};
|
||||
|
||||
CONFIG_TIME_TABLE cleanup_time_table[] = {
|
||||
VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 'h', 0, 0,
|
||||
VAR_DELAY_WARN_TIME, DEF_DELAY_WARN_TIME, &var_delay_warn_time, 0, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
|
@ -507,8 +507,8 @@ static void pre_jail_init(char *unused_name, char **unused_argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_FFLUSH_REFRESH, DEF_FFLUSH_REFRESH, &var_fflush_refresh, 'h', 1, 0,
|
||||
VAR_FFLUSH_PURGE, DEF_FFLUSH_PURGE, &var_fflush_purge, 'd', 1, 0,
|
||||
VAR_FFLUSH_REFRESH, DEF_FFLUSH_REFRESH, &var_fflush_refresh, 1, 0,
|
||||
VAR_FFLUSH_PURGE, DEF_FFLUSH_PURGE, &var_fflush_purge, 1, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
|
@ -46,11 +46,11 @@ extern const char *mail_conf_lookup_eval(const char *);
|
||||
extern char *get_mail_conf_str(const char *, const char *, int, int);
|
||||
extern int get_mail_conf_int(const char *, int, int, int);
|
||||
extern int get_mail_conf_bool(const char *, int);
|
||||
extern int get_mail_conf_time(const char *, const char *, int, int, int);
|
||||
extern int get_mail_conf_time(const char *, const char *, int, int);
|
||||
extern char *get_mail_conf_raw(const char *, const char *, int, int);
|
||||
|
||||
extern int get_mail_conf_int2(const char *, const char *, int, int, int);
|
||||
extern int get_mail_conf_time2(const char *, const char *, const char *, int, int, int);
|
||||
extern int get_mail_conf_time2(const char *, const char *, const char *, int, int);
|
||||
|
||||
/*
|
||||
* Lookup with function-call defaults.
|
||||
@ -97,9 +97,8 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
const char *name; /* config variable name */
|
||||
const char *defval; /* default value */
|
||||
const char *defval; /* default value + default unit */
|
||||
int *target; /* pointer to global variable */
|
||||
int def_unit; /* default unit: s|m|h|d|w */
|
||||
int min; /* lower bound or zero */
|
||||
int max; /* upper bound or zero */
|
||||
} CONFIG_TIME_TABLE;
|
||||
@ -136,19 +135,9 @@ typedef struct {
|
||||
int *target; /* pointer to global variable */
|
||||
} CONFIG_BOOL_FN_TABLE;
|
||||
|
||||
typedef struct {
|
||||
const char *name; /* config variable name */
|
||||
const char *(*defval) (void); /* default value provider */
|
||||
int *target; /* pointer to global variable */
|
||||
int def_unit; /* default unit: s|m|h|d|w */
|
||||
int min; /* lower bound or zero */
|
||||
int max; /* upper bound or zero */
|
||||
} CONFIG_TIME_FN_TABLE;
|
||||
|
||||
extern void get_mail_conf_str_fn_table(CONFIG_STR_FN_TABLE *);
|
||||
extern void get_mail_conf_int_fn_table(CONFIG_INT_FN_TABLE *);
|
||||
extern void get_mail_conf_bool_fn_table(CONFIG_BOOL_FN_TABLE *);
|
||||
extern void get_mail_conf_time_fn_table(CONFIG_TIME_FN_TABLE *);
|
||||
extern void get_mail_conf_raw_fn_table(CONFIG_STR_FN_TABLE *);
|
||||
|
||||
/* LICENSE
|
||||
|
@ -6,17 +6,9 @@
|
||||
/* SYNOPSIS
|
||||
/* #include <mail_conf.h>
|
||||
/*
|
||||
/* int get_mail_conf_time(name, defval, def_unit, min, max);
|
||||
/* int get_mail_conf_time(name, defval, min, max);
|
||||
/* const char *name;
|
||||
/* const char *defval;
|
||||
/* int def_unit;
|
||||
/* int min;
|
||||
/* int max;
|
||||
/*
|
||||
/* int get_mail_conf_time_fn(name, defval, def_unit, min, max);
|
||||
/* const char *name;
|
||||
/* const char *(*defval)();
|
||||
/* int def_unit;
|
||||
/* int min;
|
||||
/* int max;
|
||||
/*
|
||||
@ -25,15 +17,11 @@
|
||||
/* const char *value;
|
||||
/*
|
||||
/* void get_mail_conf_time_table(table)
|
||||
/* CONFIG_INT_TABLE *table;
|
||||
/*
|
||||
/* void get_mail_conf_time_fn_table(table)
|
||||
/* CONFIG_INT_TABLE *table;
|
||||
/* CONFIG_TIME_TABLE *table;
|
||||
/* AUXILIARY FUNCTIONS
|
||||
/* int get_mail_conf_time2(name1, name2, defval, def_unit, min, max);
|
||||
/* int get_mail_conf_time2(name1, name2, defval, min, max);
|
||||
/* const char *name1;
|
||||
/* const char *name2;
|
||||
/* const char *defval;
|
||||
/* int def_unit;
|
||||
/* int min;
|
||||
/* int max;
|
||||
@ -42,6 +30,7 @@
|
||||
/* for time interval values. The conversion routines understand
|
||||
/* one-letter suffixes to specify an explicit time unit: s
|
||||
/* (seconds), m (minutes), h (hours), d (days) or w (weeks).
|
||||
/* Internally, time is represented in seconds.
|
||||
/*
|
||||
/* get_mail_conf_time() looks up the named entry in the global
|
||||
/* configuration dictionary. The default value is returned
|
||||
@ -51,10 +40,6 @@
|
||||
/* value or string length; \fImax\fR is zero or specifies an
|
||||
/* upper limit on the integer value or string length.
|
||||
/*
|
||||
/* get_mail_conf_time_fn() is similar but specifies a function that
|
||||
/* provides the default value. The function is called only
|
||||
/* when the default value is needed.
|
||||
/*
|
||||
/* set_mail_conf_time() updates the named entry in the global
|
||||
/* configuration dictionary. This has no effect on values that
|
||||
/* have been looked up earlier via the get_mail_conf_XXX() routines.
|
||||
@ -62,11 +47,11 @@
|
||||
/* get_mail_conf_time_table() and get_mail_conf_time_fn_table() initialize
|
||||
/* lists of variables, as directed by their table arguments. A table
|
||||
/* must be terminated by a null entry.
|
||||
/*
|
||||
/* get_mail_conf_time2() concatenates the two names and is otherwise
|
||||
/* identical to get_mail_conf_time().
|
||||
/* DIAGNOSTICS
|
||||
/* Fatal errors: malformed numerical value, unknown time unit.
|
||||
/* BUGS
|
||||
/* Values and defaults are given in any unit; upper and lower
|
||||
/* bounds are given in seconds.
|
||||
/* SEE ALSO
|
||||
/* config(3) general configuration
|
||||
/* mail_conf_str(3) string-valued configuration parameters
|
||||
@ -86,6 +71,7 @@
|
||||
#include <sys_defs.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h> /* sscanf() */
|
||||
#include <ctype.h>
|
||||
|
||||
/* Utility library. */
|
||||
|
||||
@ -111,31 +97,31 @@ static int convert_mail_conf_time(const char *name, int *intval, int def_unit)
|
||||
char unit;
|
||||
char junk;
|
||||
|
||||
if ((strval = mail_conf_lookup_eval(name)) != 0) {
|
||||
switch (sscanf(strval, "%d%c%c", intval, &unit, &junk)) {
|
||||
case 1:
|
||||
unit = def_unit;
|
||||
case 2:
|
||||
switch (unit) {
|
||||
case 'w':
|
||||
*intval *= WEEK;
|
||||
return (1);
|
||||
case 'd':
|
||||
*intval *= DAY;
|
||||
return (1);
|
||||
case 'h':
|
||||
*intval *= HOUR;
|
||||
return (1);
|
||||
case 'm':
|
||||
*intval *= MINUTE;
|
||||
return (1);
|
||||
case 's':
|
||||
return (1);
|
||||
}
|
||||
if ((strval = mail_conf_lookup_eval(name)) == 0)
|
||||
return (0);
|
||||
|
||||
switch (sscanf(strval, "%d%c%c", intval, &unit, &junk)) {
|
||||
case 1:
|
||||
unit = def_unit;
|
||||
case 2:
|
||||
switch (unit) {
|
||||
case 'w':
|
||||
*intval *= WEEK;
|
||||
return (1);
|
||||
case 'd':
|
||||
*intval *= DAY;
|
||||
return (1);
|
||||
case 'h':
|
||||
*intval *= HOUR;
|
||||
return (1);
|
||||
case 'm':
|
||||
*intval *= MINUTE;
|
||||
return (1);
|
||||
case 's':
|
||||
return (1);
|
||||
}
|
||||
msg_fatal("bad time configuration: %s = %s", name, strval);
|
||||
}
|
||||
return (0);
|
||||
msg_fatal("bad time parameter configuration: %s = %s", name, strval);
|
||||
}
|
||||
|
||||
/* check_mail_conf_time - validate integer value */
|
||||
@ -148,12 +134,33 @@ static void check_mail_conf_time(const char *name, int intval, int min, int max)
|
||||
msg_fatal("invalid %s: %d (max %d)", name, intval, max);
|
||||
}
|
||||
|
||||
/* get_def_time_unit - extract time unit from default value */
|
||||
|
||||
static int get_def_time_unit(const char *name, const char *defval)
|
||||
{
|
||||
const char *cp;
|
||||
|
||||
for (cp = defval; /* void */ ; cp++) {
|
||||
if (*cp == 0)
|
||||
msg_panic("parameter %s: missing time unit in default value: %s",
|
||||
name, defval);
|
||||
if (ISALPHA(*cp)) {
|
||||
if (cp[1] != 0)
|
||||
msg_panic("parameter %s: bad time unit in default value: %s",
|
||||
name, defval);
|
||||
return (*cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* get_mail_conf_time - evaluate integer-valued configuration variable */
|
||||
|
||||
int get_mail_conf_time(const char *name, const char *defval, int def_unit, int min, int max)
|
||||
int get_mail_conf_time(const char *name, const char *defval, int min, int max)
|
||||
{
|
||||
int intval;
|
||||
int def_unit;
|
||||
|
||||
def_unit = get_def_time_unit(name, defval);
|
||||
if (convert_mail_conf_time(name, &intval, def_unit) == 0)
|
||||
set_mail_conf_time(name, defval);
|
||||
if (convert_mail_conf_time(name, &intval, def_unit) == 0)
|
||||
@ -165,12 +172,14 @@ int get_mail_conf_time(const char *name, const char *defval, int def_unit, i
|
||||
/* get_mail_conf_time2 - evaluate integer-valued configuration variable */
|
||||
|
||||
int get_mail_conf_time2(const char *name1, const char *name2,
|
||||
const char *defval, int def_unit, int min, int max)
|
||||
const char *defval, int min, int max)
|
||||
{
|
||||
int intval;
|
||||
char *name;
|
||||
int def_unit;
|
||||
|
||||
name = concatenate(name1, name2, (char *) 0);
|
||||
def_unit = get_def_time_unit(name, defval);
|
||||
if (convert_mail_conf_time(name, &intval, def_unit) == 0)
|
||||
set_mail_conf_time(name, defval);
|
||||
if (convert_mail_conf_time(name, &intval, def_unit) == 0)
|
||||
@ -180,23 +189,6 @@ int get_mail_conf_time2(const char *name1, const char *name2,
|
||||
return (intval);
|
||||
}
|
||||
|
||||
/* get_mail_conf_time_fn - evaluate integer-valued configuration variable */
|
||||
|
||||
typedef const char *(*stupid_indent_time) (void);
|
||||
|
||||
int get_mail_conf_time_fn(const char *name, stupid_indent_time defval,
|
||||
int def_unit, int min, int max)
|
||||
{
|
||||
int intval;
|
||||
|
||||
if (convert_mail_conf_time(name, &intval, def_unit) == 0)
|
||||
set_mail_conf_time(name, defval());
|
||||
if (convert_mail_conf_time(name, &intval, def_unit) == 0)
|
||||
msg_panic("get_mail_conf_time_fn: parameter not found: %s", name);
|
||||
check_mail_conf_time(name, intval, min, max);
|
||||
return (intval);
|
||||
}
|
||||
|
||||
/* set_mail_conf_time - update integer-valued configuration dictionary entry */
|
||||
|
||||
void set_mail_conf_time(const char *name, const char *value)
|
||||
@ -210,18 +202,7 @@ void get_mail_conf_time_table(CONFIG_TIME_TABLE *table)
|
||||
{
|
||||
while (table->name) {
|
||||
table->target[0] = get_mail_conf_time(table->name, table->defval,
|
||||
table->def_unit, table->min, table->max);
|
||||
table++;
|
||||
}
|
||||
}
|
||||
|
||||
/* get_mail_conf_time_fn_table - look up integers, defaults are functions */
|
||||
|
||||
void get_mail_conf_time_fn_table(CONFIG_TIME_FN_TABLE *table)
|
||||
{
|
||||
while (table->name) {
|
||||
table->target[0] = get_mail_conf_time_fn(table->name, table->defval,
|
||||
table->def_unit, table->min, table->max);
|
||||
table->min, table->max);
|
||||
table++;
|
||||
}
|
||||
}
|
||||
|
@ -307,14 +307,14 @@ void mail_params_init()
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_defaults[] = {
|
||||
VAR_MAX_IDLE, DEF_MAX_IDLE, &var_idle_limit, 's', 1, 0,
|
||||
VAR_IPC_IDLE, DEF_IPC_IDLE, &var_ipc_idle_limit, 's', 1, 0,
|
||||
VAR_IPC_TIMEOUT, DEF_IPC_TIMEOUT, &var_ipc_timeout, 's', 1, 0,
|
||||
VAR_TRIGGER_TIMEOUT, DEF_TRIGGER_TIMEOUT, &var_trigger_timeout, 's', 1, 0,
|
||||
VAR_FLOCK_DELAY, DEF_FLOCK_DELAY, &var_flock_delay, 's', 1, 0,
|
||||
VAR_FLOCK_STALE, DEF_FLOCK_STALE, &var_flock_stale, 's', 1, 0,
|
||||
VAR_FORK_DELAY, DEF_FORK_DELAY, &var_fork_delay, 's', 1, 0,
|
||||
VAR_DAEMON_TIMEOUT, DEF_DAEMON_TIMEOUT, &var_daemon_timeout, 's', 1, 0,
|
||||
VAR_MAX_IDLE, DEF_MAX_IDLE, &var_idle_limit, 1, 0,
|
||||
VAR_IPC_IDLE, DEF_IPC_IDLE, &var_ipc_idle_limit, 1, 0,
|
||||
VAR_IPC_TIMEOUT, DEF_IPC_TIMEOUT, &var_ipc_timeout, 1, 0,
|
||||
VAR_TRIGGER_TIMEOUT, DEF_TRIGGER_TIMEOUT, &var_trigger_timeout, 1, 0,
|
||||
VAR_FLOCK_DELAY, DEF_FLOCK_DELAY, &var_flock_delay, 1, 0,
|
||||
VAR_FLOCK_STALE, DEF_FLOCK_STALE, &var_flock_stale, 1, 0,
|
||||
VAR_FORK_DELAY, DEF_FORK_DELAY, &var_fork_delay, 1, 0,
|
||||
VAR_DAEMON_TIMEOUT, DEF_DAEMON_TIMEOUT, &var_daemon_timeout, 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_BOOL_TABLE bool_defaults[] = {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Version of this program.
|
||||
*/
|
||||
#define VAR_MAIL_VERSION "mail_version"
|
||||
#define DEF_MAIL_VERSION "Snapshot-20001214"
|
||||
#define DEF_MAIL_VERSION "Snapshot-20001215"
|
||||
extern char *var_mail_version;
|
||||
|
||||
/* LICENSE
|
||||
|
@ -471,15 +471,15 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_LMTP_CONN_TMOUT, DEF_LMTP_CONN_TMOUT, &var_lmtp_conn_tmout, 's', 0, 0,
|
||||
VAR_LMTP_RSET_TMOUT, DEF_LMTP_RSET_TMOUT, &var_lmtp_rset_tmout, 's', 1, 0,
|
||||
VAR_LMTP_LHLO_TMOUT, DEF_LMTP_LHLO_TMOUT, &var_lmtp_lhlo_tmout, 's', 1, 0,
|
||||
VAR_LMTP_MAIL_TMOUT, DEF_LMTP_MAIL_TMOUT, &var_lmtp_mail_tmout, 's', 1, 0,
|
||||
VAR_LMTP_RCPT_TMOUT, DEF_LMTP_RCPT_TMOUT, &var_lmtp_rcpt_tmout, 's', 1, 0,
|
||||
VAR_LMTP_DATA0_TMOUT, DEF_LMTP_DATA0_TMOUT, &var_lmtp_data0_tmout, 's', 1, 0,
|
||||
VAR_LMTP_DATA1_TMOUT, DEF_LMTP_DATA1_TMOUT, &var_lmtp_data1_tmout, 's', 1, 0,
|
||||
VAR_LMTP_DATA2_TMOUT, DEF_LMTP_DATA2_TMOUT, &var_lmtp_data2_tmout, 's', 1, 0,
|
||||
VAR_LMTP_QUIT_TMOUT, DEF_LMTP_QUIT_TMOUT, &var_lmtp_quit_tmout, 's', 1, 0,
|
||||
VAR_LMTP_CONN_TMOUT, DEF_LMTP_CONN_TMOUT, &var_lmtp_conn_tmout, 0, 0,
|
||||
VAR_LMTP_RSET_TMOUT, DEF_LMTP_RSET_TMOUT, &var_lmtp_rset_tmout, 1, 0,
|
||||
VAR_LMTP_LHLO_TMOUT, DEF_LMTP_LHLO_TMOUT, &var_lmtp_lhlo_tmout, 1, 0,
|
||||
VAR_LMTP_MAIL_TMOUT, DEF_LMTP_MAIL_TMOUT, &var_lmtp_mail_tmout, 1, 0,
|
||||
VAR_LMTP_RCPT_TMOUT, DEF_LMTP_RCPT_TMOUT, &var_lmtp_rcpt_tmout, 1, 0,
|
||||
VAR_LMTP_DATA0_TMOUT, DEF_LMTP_DATA0_TMOUT, &var_lmtp_data0_tmout, 1, 0,
|
||||
VAR_LMTP_DATA1_TMOUT, DEF_LMTP_DATA1_TMOUT, &var_lmtp_data1_tmout, 1, 0,
|
||||
VAR_LMTP_DATA2_TMOUT, DEF_LMTP_DATA2_TMOUT, &var_lmtp_data2_tmout, 1, 0,
|
||||
VAR_LMTP_QUIT_TMOUT, DEF_LMTP_QUIT_TMOUT, &var_lmtp_quit_tmout, 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_BOOL_TABLE bool_table[] = {
|
||||
|
@ -626,7 +626,7 @@ static void post_init(char *unused_name, char **unused_argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 's', 1, 0,
|
||||
VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_INT_TABLE int_table[] = {
|
||||
|
@ -58,7 +58,7 @@ void master_vars_init(void)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_THROTTLE_TIME, DEF_THROTTLE_TIME, &var_throttle_time, 's', 1, 0,
|
||||
VAR_THROTTLE_TIME, DEF_THROTTLE_TIME, &var_throttle_time, 1, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
|
@ -510,11 +510,11 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 's', 1, 0,
|
||||
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 's', 1, 0,
|
||||
VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 's', 1, 0,
|
||||
VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 8640000,
|
||||
VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 's', 1, 0,
|
||||
VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 1, 0,
|
||||
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0,
|
||||
VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 1, 0,
|
||||
VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 8640000,
|
||||
VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_INT_TABLE int_table[] = {
|
||||
|
@ -767,7 +767,7 @@ static void drop_privileges(char *unused_name, char **unused_argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 's', 1, 0,
|
||||
VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
|
@ -476,18 +476,6 @@ static void print_bool(int mode, CONFIG_BOOL_TABLE *cbt)
|
||||
static void print_time(int mode, CONFIG_TIME_TABLE *ctt)
|
||||
{
|
||||
const char *value;
|
||||
const char *ptr;
|
||||
|
||||
/*
|
||||
* Make sure the default unit matches the default value unit.
|
||||
*/
|
||||
for (ptr = ctt->defval; ptr[1] != 0; ptr += 1)
|
||||
/* void */ ;
|
||||
if (*ptr == 0)
|
||||
msg_fatal("parameter %s has void default value", ctt->name);
|
||||
if (ctt->def_unit != *ptr)
|
||||
msg_fatal("parameter %s has default value %s but default unit %c",
|
||||
ctt->name, ctt->defval, ctt->def_unit);
|
||||
|
||||
if (mode & SHOW_DEFS) {
|
||||
show_strval(mode, ctt->name, ctt->defval);
|
||||
|
@ -473,11 +473,11 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 's', 1, 0,
|
||||
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 's', 1, 0,
|
||||
VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 's', 1, 0,
|
||||
VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 'd', 1, 8640000,
|
||||
VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 's', 1, 0,
|
||||
VAR_QUEUE_RUN_DELAY, DEF_QUEUE_RUN_DELAY, &var_queue_run_delay, 1, 0,
|
||||
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0,
|
||||
VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 1, 0,
|
||||
VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 1, 8640000,
|
||||
VAR_XPORT_RETRY_TIME, DEF_XPORT_RETRY_TIME, &var_transport_retry_time, 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_INT_TABLE int_table[] = {
|
||||
|
@ -402,14 +402,14 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_SMTP_CONN_TMOUT, DEF_SMTP_CONN_TMOUT, &var_smtp_conn_tmout, 's', 0, 0,
|
||||
VAR_SMTP_HELO_TMOUT, DEF_SMTP_HELO_TMOUT, &var_smtp_helo_tmout, 's', 1, 0,
|
||||
VAR_SMTP_MAIL_TMOUT, DEF_SMTP_MAIL_TMOUT, &var_smtp_mail_tmout, 's', 1, 0,
|
||||
VAR_SMTP_RCPT_TMOUT, DEF_SMTP_RCPT_TMOUT, &var_smtp_rcpt_tmout, 's', 1, 0,
|
||||
VAR_SMTP_DATA0_TMOUT, DEF_SMTP_DATA0_TMOUT, &var_smtp_data0_tmout, 's', 1, 0,
|
||||
VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 's', 1, 0,
|
||||
VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 's', 1, 0,
|
||||
VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 's', 1, 0,
|
||||
VAR_SMTP_CONN_TMOUT, DEF_SMTP_CONN_TMOUT, &var_smtp_conn_tmout, 0, 0,
|
||||
VAR_SMTP_HELO_TMOUT, DEF_SMTP_HELO_TMOUT, &var_smtp_helo_tmout, 1, 0,
|
||||
VAR_SMTP_MAIL_TMOUT, DEF_SMTP_MAIL_TMOUT, &var_smtp_mail_tmout, 1, 0,
|
||||
VAR_SMTP_RCPT_TMOUT, DEF_SMTP_RCPT_TMOUT, &var_smtp_rcpt_tmout, 1, 0,
|
||||
VAR_SMTP_DATA0_TMOUT, DEF_SMTP_DATA0_TMOUT, &var_smtp_data0_tmout, 1, 0,
|
||||
VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 1, 0,
|
||||
VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 1, 0,
|
||||
VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 1, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_INT_TABLE int_table[] = {
|
||||
|
@ -1436,8 +1436,8 @@ int main(int argc, char **argv)
|
||||
0,
|
||||
};
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_SMTPD_TMOUT, DEF_SMTPD_TMOUT, &var_smtpd_tmout, 's', 1, 0,
|
||||
VAR_SMTPD_ERR_SLEEP, DEF_SMTPD_ERR_SLEEP, &var_smtpd_err_sleep, 's', 0, 0,
|
||||
VAR_SMTPD_TMOUT, DEF_SMTPD_TMOUT, &var_smtpd_tmout, 1, 0,
|
||||
VAR_SMTPD_ERR_SLEEP, DEF_SMTPD_ERR_SLEEP, &var_smtpd_err_sleep, 0, 0,
|
||||
0,
|
||||
};
|
||||
static CONFIG_BOOL_TABLE bool_table[] = {
|
||||
|
@ -299,7 +299,7 @@ static void drop_privileges(char *unused_name, char **unused_argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static CONFIG_TIME_TABLE time_table[] = {
|
||||
VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 's', 1, 0,
|
||||
VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
|
@ -81,7 +81,7 @@ void transport_init(void)
|
||||
|
||||
/* transport_lookup - map a transport domain */
|
||||
|
||||
int transport_lookup(const char *domain, VSTRING * channel, VSTRING * nexthop)
|
||||
int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
|
||||
{
|
||||
char *low_domain = lowercase(mystrdup(domain));
|
||||
const char *name;
|
||||
@ -122,6 +122,9 @@ int transport_lookup(const char *domain, VSTRING * channel, VSTRING * nextho
|
||||
transport = var_def_transport;
|
||||
vstring_strcpy(channel, transport);
|
||||
(void) split_at(vstring_str(channel), ':');
|
||||
if (*vstring_str(channel) == 0)
|
||||
msg_fatal("null transport is not allowed: %s = %s",
|
||||
VAR_DEF_TRANSPORT, var_def_transport);
|
||||
vstring_strcpy(nexthop, host);
|
||||
myfree(saved_value);
|
||||
found = 1;
|
||||
|
@ -146,12 +146,30 @@ static int dict_ldap_connect(DICT_LDAP *dict_ldap)
|
||||
void (*saved_alarm) (int);
|
||||
int rc = 0;
|
||||
|
||||
#ifdef LDAP_OPT_NETWORK_TIMEOUT
|
||||
struct timeval mytimeval;
|
||||
|
||||
#endif
|
||||
|
||||
dict_errno = 0;
|
||||
|
||||
if (msg_verbose)
|
||||
msg_info("%s: Connecting to server %s", myname,
|
||||
dict_ldap->server_host);
|
||||
|
||||
#ifdef UNTESTED_LDAP_OPT_NETWORK_TIMEOUT
|
||||
dict_ldap->ld = ldap_init(dict_ldap->server_host,
|
||||
(int) dict_ldap->server_port);
|
||||
if (dict_ldap->ld == NULL) {
|
||||
msg_warn("%s: Unable to int LDAP server %s",
|
||||
myname, dict_ldap->server_host);
|
||||
dict_errno = DICT_ERR_RETRY;
|
||||
return (-1);
|
||||
}
|
||||
mytimeval.tv_sec = dict_ldap->timeout;
|
||||
mytimeval.tv_usec = 0;
|
||||
ldap_set_option(dict_ldap->ld, LDAP_OPT_NETWORK_TIMEOUT, &mytimeval);
|
||||
#else
|
||||
if ((saved_alarm = signal(SIGALRM, dict_ldap_timeout)) == SIG_ERR) {
|
||||
msg_warn("%s: Error setting signal handler for open timeout: %m",
|
||||
myname);
|
||||
@ -178,6 +196,7 @@ static int dict_ldap_connect(DICT_LDAP *dict_ldap)
|
||||
dict_errno = DICT_ERR_RETRY;
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Configure alias dereferencing for this connection. Thanks to Mike
|
||||
|
Loading…
x
Reference in New Issue
Block a user