import 19991231-pl07
This commit is contained in:
parent
e65735cc74
commit
b7b463a78a
43
gnu/dist/postfix/HISTORY
vendored
43
gnu/dist/postfix/HISTORY
vendored
@ -3670,3 +3670,46 @@ Apologies for any names omitted.
|
||||
be issued in an SMTP session (ex.: NOOP, VRFY, ETRN, RSET).
|
||||
Problem report by Michael Ju. Tokarev @ tls.msk.ru. Files:
|
||||
global/mail_params.h, smtpd/smtpd.c.
|
||||
|
||||
20000413
|
||||
|
||||
Bugfix: RFC 822 requires the presence of at least one
|
||||
destination message header. The cleanup daemon now generates
|
||||
a generic "To: undisclosed-recipients:;" message header
|
||||
when no destination header is present. The header content
|
||||
is specified with the undisclosed_recipients_header parameter.
|
||||
Problem pointed out by Geoff Gibbs, UK-Human Genome Mapping
|
||||
Project-Resource Centre.
|
||||
|
||||
20000416
|
||||
|
||||
Workaround: allow <(comment)> as SMTP MAIL FROM address.
|
||||
|
||||
20000423
|
||||
|
||||
Bugfix: mail_copy() could prepend > or . in the middle of
|
||||
long lines. Found by code inspection.
|
||||
|
||||
20000505
|
||||
|
||||
Bugfix: the SMTP server now flushes unwritten output before
|
||||
tarpit delays, to avoid protocol timeouts in pipelined
|
||||
sessions when a client causes lots of errors. Found by
|
||||
Lamont Jones, HP. File: smtpd/smtpd_chat.c.
|
||||
|
||||
20000510
|
||||
|
||||
Bugfix: configuration parameters for one mysql dictionary
|
||||
would become default settings for the next one. File:
|
||||
dict_mysql.c. This patch was merged into Postfix a while
|
||||
back but apparently that Postfix version was nuked when
|
||||
other parts were redesigned. Update by Scott Cotton.
|
||||
|
||||
Bugfix: some Postfix delivery agents would abort on addresses
|
||||
of the form `stuff@.' which could be generated only locally.
|
||||
Found by Patrik Rak. File: trivial-rewrite/resolve.c.
|
||||
|
||||
20000511
|
||||
|
||||
Bugfix: Postfix would incorrectly reject domain names with
|
||||
adjacent - characters. File: util/valid_hostname.c.
|
||||
|
1
gnu/dist/postfix/INSTALL.sh
vendored
1
gnu/dist/postfix/INSTALL.sh
vendored
@ -332,6 +332,7 @@ no) ;;
|
||||
for file in man?/*
|
||||
do
|
||||
(test -f $MANPAGES/$file && cmp -s $file $MANPAGES/$file) || {
|
||||
echo Updating $MANPAGES/$file...
|
||||
rm -f $MANPAGES/$file
|
||||
cp $file $MANPAGES/$file || exit 1
|
||||
chmod 644 $MANPAGES/$file || exit 1
|
||||
|
8
gnu/dist/postfix/RELEASE_NOTES
vendored
8
gnu/dist/postfix/RELEASE_NOTES
vendored
@ -1,3 +1,11 @@
|
||||
Incompatible changes with postfix-19991231-pl07:
|
||||
================================================
|
||||
|
||||
As required by RFC 822, Postfix now inserts a generic destination
|
||||
message header when no destination header is present. The text is
|
||||
specified via the undisclosed_recipients_header configuration
|
||||
parameter (default: "To: undisclosed-recipients:;").
|
||||
|
||||
Incompatible changes with postfix-19991231-pl06:
|
||||
================================================
|
||||
|
||||
|
7
gnu/dist/postfix/cleanup/cleanup.c
vendored
7
gnu/dist/postfix/cleanup/cleanup.c
vendored
@ -13,7 +13,7 @@
|
||||
/* The \fBcleanup\fR daemon always performs the following transformations:
|
||||
/* .IP \(bu
|
||||
/* Insert missing message headers: (\fBResent-\fR) \fBFrom:\fR,
|
||||
/* \fBMessage-Id:\fR, and \fBDate:\fR.
|
||||
/* \fBTo:\fR, \fBMessage-Id:\fR, and \fBDate:\fR.
|
||||
/* .IP \(bu
|
||||
/* Extract envelope recipient addresses from (\fBResent-\fR) \fBTo:\fR,
|
||||
/* \fBCc:\fR and \fBBcc:\fR message headers when no recipients are
|
||||
@ -67,6 +67,9 @@
|
||||
/* Address to send a copy of each message that enters the system.
|
||||
/* .IP \fBhopcount_limit\fR
|
||||
/* Limit the number of \fBReceived:\fR message headers.
|
||||
/* .IP \fBrecipients_witheld_header\fR
|
||||
/* The header line that is inserted when no recipients were
|
||||
/* specified in (Resent-)To: or (Resent-)Cc: message headers.
|
||||
/* .SH "Address transformations"
|
||||
/* .ad
|
||||
/* .fi
|
||||
@ -177,6 +180,7 @@ char *var_empty_addr; /* destination of bounced bounces */
|
||||
int var_delay_warn_time; /* delay that triggers warning */
|
||||
char *var_prop_extension; /* propagate unmatched extension */
|
||||
char *var_always_bcc;
|
||||
char *var_rcpt_witheld; /* recipients not disclosed */
|
||||
|
||||
/*
|
||||
* Mappings.
|
||||
@ -471,6 +475,7 @@ int main(int argc, char **argv)
|
||||
VAR_HEADER_CHECKS, DEF_HEADER_CHECKS, &var_header_checks, 0, 0,
|
||||
VAR_PROP_EXTENSION, DEF_PROP_EXTENSION, &var_prop_extension, 0, 0,
|
||||
VAR_ALWAYS_BCC, DEF_ALWAYS_BCC, &var_always_bcc, 0, 0,
|
||||
VAR_RCPT_WITHELD, DEF_RCPT_WITHELD, &var_rcpt_witheld, 1, 0,
|
||||
0,
|
||||
};
|
||||
|
||||
|
9
gnu/dist/postfix/cleanup/cleanup_message.c
vendored
9
gnu/dist/postfix/cleanup/cleanup_message.c
vendored
@ -350,6 +350,15 @@ static void cleanup_missing_headers(void)
|
||||
cleanup_resent, vstring_str(cleanup_temp1));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a missing destination header.
|
||||
*/
|
||||
#define VISIBLE_RCPT ((1 << HDR_TO) | (1 << HDR_RESENT_TO) | \
|
||||
(1 << HDR_CC) | (1 << HDR_RESENT_CC))
|
||||
|
||||
if ((cleanup_headers_seen & VISIBLE_RCPT) == 0)
|
||||
cleanup_out_format(REC_TYPE_NORM, "%s", var_rcpt_witheld);
|
||||
}
|
||||
|
||||
/* cleanup_message - process message content segment */
|
||||
|
10
gnu/dist/postfix/global/mail_copy.c
vendored
10
gnu/dist/postfix/global/mail_copy.c
vendored
@ -166,10 +166,12 @@ int mail_copy(const char *sender, const char *delivered,
|
||||
if (type != REC_TYPE_NORM && type != REC_TYPE_CONT)
|
||||
break;
|
||||
bp = vstring_str(buf);
|
||||
if ((flags & MAIL_COPY_QUOTE) && *bp == 'F' && !strncmp(bp, "From ", 5))
|
||||
VSTREAM_PUTC('>', dst);
|
||||
if ((flags & MAIL_COPY_DOT) && *bp == '.')
|
||||
VSTREAM_PUTC('.', dst);
|
||||
if (prev_type == REC_TYPE_NORM) {
|
||||
if ((flags & MAIL_COPY_QUOTE) && *bp == 'F' && !strncmp(bp, "From ", 5))
|
||||
VSTREAM_PUTC('>', dst);
|
||||
if ((flags & MAIL_COPY_DOT) && *bp == '.')
|
||||
VSTREAM_PUTC('.', dst);
|
||||
}
|
||||
if (VSTRING_LEN(buf) && VSTREAM_FWRITE_BUF(dst, buf) != VSTRING_LEN(buf))
|
||||
break;
|
||||
if (type == REC_TYPE_NORM && VSTREAM_PUTC('\n', dst) == VSTREAM_EOF)
|
||||
|
7
gnu/dist/postfix/global/mail_params.h
vendored
7
gnu/dist/postfix/global/mail_params.h
vendored
@ -214,6 +214,13 @@ extern char *var_db_type;
|
||||
#define DEF_ALWAYS_BCC ""
|
||||
extern char *var_always_bcc;
|
||||
|
||||
/*
|
||||
* What to put in the To: header when no recipients were disclosed.
|
||||
*/
|
||||
#define VAR_RCPT_WITHELD "undisclosed_recipients_header"
|
||||
#define DEF_RCPT_WITHELD "To: undisclosed-recipients:;"
|
||||
extern char *var_rcpt_witheld;
|
||||
|
||||
/*
|
||||
* Standards violation: allow/permit RFC 822-style addresses in SMTP
|
||||
* commands.
|
||||
|
2
gnu/dist/postfix/global/mail_version.h
vendored
2
gnu/dist/postfix/global/mail_version.h
vendored
@ -15,7 +15,7 @@
|
||||
* Version of this program.
|
||||
*/
|
||||
#define VAR_MAIL_VERSION "mail_version"
|
||||
#define DEF_MAIL_VERSION "Postfix-19991231-pl06"
|
||||
#define DEF_MAIL_VERSION "Postfix-19991231-pl07"
|
||||
extern char *var_mail_version;
|
||||
|
||||
/* LICENSE
|
||||
|
22
gnu/dist/postfix/html/cleanup.8.html
vendored
22
gnu/dist/postfix/html/cleanup.8.html
vendored
@ -20,7 +20,7 @@ CLEANUP(8) CLEANUP(8)
|
||||
mations:
|
||||
|
||||
<b>o</b> Insert missing message headers: (<b>Resent-</b>) <b>From:</b>,
|
||||
<b>Message-Id:</b>, and <b>Date:</b>.
|
||||
<b>To:</b>, <b>Message-Id:</b>, and <b>Date:</b>.
|
||||
|
||||
<b>o</b> Extract envelope recipient addresses from (<b>Resent-</b>)
|
||||
<b>To:</b>, <b>Cc:</b> and <b>Bcc:</b> message headers when no recipi-
|
||||
@ -92,6 +92,11 @@ CLEANUP(8) CLEANUP(8)
|
||||
<b>hopcount</b><i>_</i><b>limit</b>
|
||||
Limit the number of <b>Received:</b> message headers.
|
||||
|
||||
<b>recipients</b><i>_</i><b>witheld</b><i>_</i><b>header</b>
|
||||
The header line that is inserted when no recipients
|
||||
were specified in (Resent-)To: or (Resent-)Cc: mes-
|
||||
sage headers.
|
||||
|
||||
<b>Address</b> <b>transformations</b>
|
||||
<b>empty</b><i>_</i><b>address</b><i>_</i><b>recipient</b>
|
||||
The destination for undeliverable mail from <>.
|
||||
@ -120,11 +125,6 @@ CLEANUP(8) CLEANUP(8)
|
||||
|
||||
<b>virtual</b><i>_</i><b>maps</b>
|
||||
Address mapping lookup table for envelope recipient
|
||||
addresses.
|
||||
|
||||
<b>Resource</b> <b>controls</b>
|
||||
<b>duplicate</b><i>_</i><b>filter</b><i>_</i><b>limit</b>
|
||||
Limit the number of envelope recipients that are
|
||||
|
||||
|
||||
|
||||
@ -137,6 +137,11 @@ CLEANUP(8) CLEANUP(8)
|
||||
CLEANUP(8) CLEANUP(8)
|
||||
|
||||
|
||||
addresses.
|
||||
|
||||
<b>Resource</b> <b>controls</b>
|
||||
<b>duplicate</b><i>_</i><b>filter</b><i>_</i><b>limit</b>
|
||||
Limit the number of envelope recipients that are
|
||||
remembered.
|
||||
|
||||
<b>header</b><i>_</i><b>size</b><i>_</i><b>limit</b>
|
||||
@ -183,11 +188,6 @@ CLEANUP(8) CLEANUP(8)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
5
gnu/dist/postfix/man/man8/cleanup.8
vendored
5
gnu/dist/postfix/man/man8/cleanup.8
vendored
@ -19,7 +19,7 @@ manager of its arrival.
|
||||
The \fBcleanup\fR daemon always performs the following transformations:
|
||||
.IP \(bu
|
||||
Insert missing message headers: (\fBResent-\fR) \fBFrom:\fR,
|
||||
\fBMessage-Id:\fR, and \fBDate:\fR.
|
||||
\fBTo:\fR, \fBMessage-Id:\fR, and \fBDate:\fR.
|
||||
.IP \(bu
|
||||
Extract envelope recipient addresses from (\fBResent-\fR) \fBTo:\fR,
|
||||
\fBCc:\fR and \fBBcc:\fR message headers when no recipients are
|
||||
@ -81,6 +81,9 @@ a configuration change.
|
||||
Address to send a copy of each message that enters the system.
|
||||
.IP \fBhopcount_limit\fR
|
||||
Limit the number of \fBReceived:\fR message headers.
|
||||
.IP \fBrecipients_witheld_header\fR
|
||||
The header line that is inserted when no recipients were
|
||||
specified in (Resent-)To: or (Resent-)Cc: message headers.
|
||||
.SH "Address transformations"
|
||||
.ad
|
||||
.fi
|
||||
|
17
gnu/dist/postfix/smtpd/smtpd.c
vendored
17
gnu/dist/postfix/smtpd/smtpd.c
vendored
@ -479,15 +479,6 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
|
||||
#define PERMIT_EMPTY_ADDR 1
|
||||
#define REJECT_EMPTY_ADDR 0
|
||||
|
||||
if (allow_empty_addr && strcmp(STR(arg->vstrval), "<>") == 0) {
|
||||
if (msg_verbose)
|
||||
msg_info("%s: empty address", myname);
|
||||
VSTRING_RESET(arg->vstrval);
|
||||
VSTRING_TERMINATE(arg->vstrval);
|
||||
arg->strval = STR(arg->vstrval);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Some mailers send RFC822-style address forms (with comments and such)
|
||||
* in SMTP envelopes. We cannot blame users for this: the blame is with
|
||||
@ -519,9 +510,11 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
|
||||
}
|
||||
|
||||
/*
|
||||
* Report trouble. Log a warning only if we are going to sleep+reject.
|
||||
* Report trouble. Log a warning only if we are going to sleep+reject so
|
||||
* that attackers can't flood our logfiles.
|
||||
*/
|
||||
if (naddr != 1
|
||||
if ((naddr < 1 && !allow_empty_addr)
|
||||
|| naddr > 1
|
||||
|| (strict_rfc821 && (non_addr || *STR(arg->vstrval) != '<'))) {
|
||||
msg_warn("Illegal address syntax from %s in %s command: %s",
|
||||
state->namaddr, state->where, STR(arg->vstrval));
|
||||
@ -537,7 +530,7 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
|
||||
if (addr)
|
||||
tok822_internalize(arg->vstrval, addr->head, TOK822_STR_DEFL);
|
||||
else
|
||||
vstring_strcat(arg->vstrval, "");
|
||||
vstring_strcpy(arg->vstrval, "");
|
||||
arg->strval = STR(arg->vstrval);
|
||||
|
||||
/*
|
||||
|
13
gnu/dist/postfix/smtpd/smtpd_chat.c
vendored
13
gnu/dist/postfix/smtpd/smtpd_chat.c
vendored
@ -133,6 +133,7 @@ void smtpd_chat_query(SMTPD_STATE *state)
|
||||
void smtpd_chat_reply(SMTPD_STATE *state, char *format,...)
|
||||
{
|
||||
va_list ap;
|
||||
int slept = 0;
|
||||
|
||||
va_start(ap, format);
|
||||
vstring_vsprintf(state->buffer, format, ap);
|
||||
@ -149,11 +150,19 @@ void smtpd_chat_reply(SMTPD_STATE *state, char *format,...)
|
||||
* errors within a session.
|
||||
*/
|
||||
if (state->error_count > var_smtpd_soft_erlim)
|
||||
sleep(state->error_count);
|
||||
sleep(slept = state->error_count);
|
||||
else if (STR(state->buffer)[0] == '4' || STR(state->buffer)[0] == '5')
|
||||
sleep(var_smtpd_err_sleep);
|
||||
sleep(slept = var_smtpd_err_sleep);
|
||||
|
||||
smtp_fputs(STR(state->buffer), LEN(state->buffer), state->client);
|
||||
|
||||
/*
|
||||
* Flush unsent output AFTER writing instead of before sleeping (so that
|
||||
* vstream_fflush() flushes the output half of a bidirectional stream).
|
||||
* Pipelined error responses could result in client-side timeouts.
|
||||
*/
|
||||
if (slept)
|
||||
(vstream_fflush(state->client));
|
||||
}
|
||||
|
||||
/* print_line - line_wrap callback */
|
||||
|
8
gnu/dist/postfix/trivial-rewrite/resolve.c
vendored
8
gnu/dist/postfix/trivial-rewrite/resolve.c
vendored
@ -27,7 +27,7 @@
|
||||
/*
|
||||
/* resolve_proto() implements the client-server protocol:
|
||||
/* read one address in FQDN form, reply with a (transport,
|
||||
/* nexthop, internalized recipient) triple.
|
||||
/* nexthop, internalized recipient) triple.
|
||||
/*
|
||||
/* resolve_addr() gives direct access to the address resolving
|
||||
/* engine. It resolves an internalized address to a (transport,
|
||||
@ -110,10 +110,12 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
|
||||
while (tree->head) {
|
||||
|
||||
/*
|
||||
* Strip trailing dot.
|
||||
* Strip trailing dot or @.
|
||||
*/
|
||||
if (tree->tail->type == '.')
|
||||
if (tree->tail->type == '.' || tree->tail->type == '@') {
|
||||
tok822_free_tree(tok822_sub_keep_before(tree, tree->tail));
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* A lone empty string becomes the postmaster.
|
||||
|
40
gnu/dist/postfix/util/dict_mysql.c
vendored
40
gnu/dist/postfix/util/dict_mysql.c
vendored
@ -201,9 +201,9 @@ static const char *dict_mysql_lookup(DICT *dict, const char *name)
|
||||
|
||||
/*
|
||||
* plmysql_query - process a MySQL query. Return MYSQL_RES* on success.
|
||||
* On failure, log failure and try other db instances.
|
||||
* on failure of all db instances, return 0;
|
||||
* close unnecessary active connections
|
||||
* On failure, log failure and try other db instances.
|
||||
* on failure of all db instances, return 0;
|
||||
* close unnecessary active connections
|
||||
*/
|
||||
|
||||
static MYSQL_RES *plmysql_query(PLMYSQL *PLDB,
|
||||
@ -361,20 +361,29 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
int i;
|
||||
char *nameval;
|
||||
char *hosts;
|
||||
/* the name of the dict for processing the mysql options file */
|
||||
MYSQL_NAME *name = (MYSQL_NAME *) mymalloc(sizeof(MYSQL_NAME));
|
||||
ARGV *hosts_argv;
|
||||
|
||||
dict_load_file(mysqlcf_path, mysqlcf_path);
|
||||
VSTRING *opt_dict_name;
|
||||
|
||||
/*
|
||||
* setup a dict containing info in the mysql cf file. the dict has a
|
||||
* name, and a path. The name must be distinct from the path, or the
|
||||
* dict interface gets confused. The name must be distinct for two
|
||||
* different paths, or the configuration info will cache across different
|
||||
* mysql maps, which can be confusing.
|
||||
*/
|
||||
opt_dict_name = vstring_alloc(64);
|
||||
vstring_sprintf(opt_dict_name, "mysql opt dict %s", mysqlcf_path);
|
||||
dict_load_file(vstring_str(opt_dict_name), mysqlcf_path);
|
||||
/* mysql username lookup */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "user")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "user")) == NULL)
|
||||
name->username = mystrdup("");
|
||||
else
|
||||
name->username = mystrdup(nameval);
|
||||
if (msg_verbose)
|
||||
msg_info("mysqlname_parse(): set username to '%s'", name->username);
|
||||
/* password lookup */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "password")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "password")) == NULL)
|
||||
name->password = mystrdup("");
|
||||
else
|
||||
name->password = mystrdup(nameval);
|
||||
@ -382,7 +391,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
msg_info("mysqlname_parse(): set password to '%s'", name->password);
|
||||
|
||||
/* database name lookup */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "dbname")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "dbname")) == NULL)
|
||||
msg_fatal("%s: mysql options file does not include database name", mysqlcf_path);
|
||||
else
|
||||
name->dbname = mystrdup(nameval);
|
||||
@ -390,7 +399,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
msg_info("mysqlname_parse(): set database name to '%s'", name->dbname);
|
||||
|
||||
/* table lookup */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "table")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "table")) == NULL)
|
||||
msg_fatal("%s: mysql options file does not include table name", mysqlcf_path);
|
||||
else
|
||||
name->table = mystrdup(nameval);
|
||||
@ -398,7 +407,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
msg_info("mysqlname_parse(): set table name to '%s'", name->table);
|
||||
|
||||
/* select field lookup */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "select_field")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "select_field")) == NULL)
|
||||
msg_fatal("%s: mysql options file does not include select field", mysqlcf_path);
|
||||
else
|
||||
name->select_field = mystrdup(nameval);
|
||||
@ -406,7 +415,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
msg_info("mysqlname_parse(): set select_field to '%s'", name->select_field);
|
||||
|
||||
/* where field lookup */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "where_field")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "where_field")) == NULL)
|
||||
msg_fatal("%s: mysql options file does not include where field", mysqlcf_path);
|
||||
else
|
||||
name->where_field = mystrdup(nameval);
|
||||
@ -414,7 +423,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
msg_info("mysqlname_parse(): set where_field to '%s'", name->where_field);
|
||||
|
||||
/* additional conditions */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "additional_conditions")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "additional_conditions")) == NULL)
|
||||
name->additional_conditions = mystrdup("");
|
||||
else
|
||||
name->additional_conditions = mystrdup(nameval);
|
||||
@ -422,7 +431,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
msg_info("mysqlname_parse(): set additional_conditions to '%s'", name->additional_conditions);
|
||||
|
||||
/* mysql server hosts */
|
||||
if ((nameval = (char *) dict_lookup(mysqlcf_path, "hosts")) == NULL)
|
||||
if ((nameval = (char *) dict_lookup(vstring_str(opt_dict_name), "hosts")) == NULL)
|
||||
hosts = mystrdup("");
|
||||
else
|
||||
hosts = mystrdup(nameval);
|
||||
@ -448,6 +457,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
}
|
||||
}
|
||||
myfree(hosts);
|
||||
vstring_free(opt_dict_name);
|
||||
argv_free(hosts_argv);
|
||||
return name;
|
||||
}
|
||||
@ -455,7 +465,7 @@ static MYSQL_NAME *mysqlname_parse(const char *mysqlcf_path)
|
||||
|
||||
/*
|
||||
* plmysql_init - initalize a MYSQL database.
|
||||
* Return NULL on failure, or a PLMYSQL * on success.
|
||||
* Return NULL on failure, or a PLMYSQL * on success.
|
||||
*/
|
||||
static PLMYSQL *plmysql_init(char *hostnames[],
|
||||
int len_hosts)
|
||||
|
8
gnu/dist/postfix/util/valid_hostname.c
vendored
8
gnu/dist/postfix/util/valid_hostname.c
vendored
@ -81,12 +81,18 @@ int valid_hostname(const char *name)
|
||||
}
|
||||
if (!ISDIGIT(ch))
|
||||
non_numeric = 1;
|
||||
} else if (ch == '.' || ch == '-') {
|
||||
} else if (ch == '.') {
|
||||
if (label_length == 0 || cp[1] == 0) {
|
||||
msg_warn("%s: misplaced delimiter: %.100s", myname, name);
|
||||
return (0);
|
||||
}
|
||||
label_length = 0;
|
||||
} else if (ch == '-') {
|
||||
label_length++;
|
||||
if (label_length == 1 || cp[1] == 0 || cp[1] == '.') {
|
||||
msg_warn("%s: misplaced hyphen: %.100s", myname, name);
|
||||
return (0);
|
||||
}
|
||||
} else {
|
||||
msg_warn("%s: invalid character %d(decimal): %.100s",
|
||||
myname, ch, name);
|
||||
|
10
gnu/dist/postfix/util/valid_hostname.in
vendored
10
gnu/dist/postfix/util/valid_hostname.in
vendored
@ -26,3 +26,13 @@ f1.2.3.4
|
||||
1.2.3.4f
|
||||
1.2.3.f4
|
||||
1.2.3.f
|
||||
-.a.b
|
||||
a.-.b
|
||||
a.b.-
|
||||
-aa.b.b
|
||||
aa-.b.b
|
||||
a.-bb.b
|
||||
a.bb-.b
|
||||
a.b.-bb
|
||||
a.b.bb-
|
||||
a-a.b-b
|
||||
|
29
gnu/dist/postfix/util/valid_hostname.ref
vendored
29
gnu/dist/postfix/util/valid_hostname.ref
vendored
@ -70,3 +70,32 @@
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 102(decimal): 1.2.3.f4
|
||||
./valid_hostname: testing: "1.2.3.f"
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 102(decimal): 1.2.3.f
|
||||
./valid_hostname: testing: "-.a.b"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: -.a.b
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 45(decimal): -.a.b
|
||||
./valid_hostname: testing: "a.-.b"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: a.-.b
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a.-.b
|
||||
./valid_hostname: testing: "a.b.-"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: a.b.-
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a.b.-
|
||||
./valid_hostname: testing: "-aa.b.b"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: -aa.b.b
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 45(decimal): -aa.b.b
|
||||
./valid_hostname: testing: "aa-.b.b"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: aa-.b.b
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): aa-.b.b
|
||||
./valid_hostname: testing: "a.-bb.b"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: a.-bb.b
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a.-bb.b
|
||||
./valid_hostname: testing: "a.bb-.b"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: a.bb-.b
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a.bb-.b
|
||||
./valid_hostname: testing: "a.b.-bb"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: a.b.-bb
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a.b.-bb
|
||||
./valid_hostname: testing: "a.b.bb-"
|
||||
./valid_hostname: warning: valid_hostname: misplaced hyphen: a.b.bb-
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a.b.bb-
|
||||
./valid_hostname: testing: "a-a.b-b"
|
||||
./valid_hostname: warning: valid_hostaddr: invalid character 97(decimal): a-a.b-b
|
||||
|
Loading…
Reference in New Issue
Block a user