2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-30 21:55:20 +00:00

snapshot-20011007

This commit is contained in:
Wietse Venema
2001-10-07 00:00:00 -05:00
committed by Viktor Dukhovni
parent 6654683f18
commit 3d5513e695
8 changed files with 69 additions and 36 deletions

View File

@@ -237,9 +237,13 @@ mail_owner = postfix
# Beware: if the Postfix SMTP server runs chrooted, you may have to # Beware: if the Postfix SMTP server runs chrooted, you may have to
# copy the passwd (not shadow) database into the jail. This is # copy the passwd (not shadow) database into the jail. This is
# system dependent. # system dependent.
# #
#local_recipient_maps = $alias_maps unix:passwd.byname #local_recipient_maps = $alias_maps unix:passwd.byname
# If you use both the Postfix local and virtual delivery agents, specify:
#
#local_recipient_maps = $alias_maps unix:passwd.byname $virtual_mailbox_maps
# INPUT RATE CONTROL # INPUT RATE CONTROL
# #
# The in_flow_delay configuration parameter implements mail input # The in_flow_delay configuration parameter implements mail input

View File

@@ -47,7 +47,8 @@
/* The "fast flush" server rejected the request (invalid request /* The "fast flush" server rejected the request (invalid request
/* parameter). /* parameter).
/* .IP MAIL_FLUSH_DENY /* .IP MAIL_FLUSH_DENY
/* The specified domain is not eligible for "fast flush" service. /* The specified domain is not eligible for "fast flush" service,
/* or the "fast flush" service is disabled.
/* SEE ALSO /* SEE ALSO
/* flush(8) Postfix fast flush cache manager /* flush(8) Postfix fast flush cache manager
/* LICENSE /* LICENSE

View File

@@ -161,6 +161,8 @@ int main(int argc, char **argv)
/* /*
* Initialize. * Initialize.
*/ */
#define UPDATE(dst, src) { myfree(dst); dst = mystrdup(src); }
mail_conf_read(); mail_conf_read();
msg_verbose = 1; msg_verbose = 1;
if (chdir(var_queue_dir) < 0) if (chdir(var_queue_dir) < 0)
@@ -168,14 +170,14 @@ int main(int argc, char **argv)
path = maps_create(argv[0], argv[1], DICT_FLAG_LOCK); path = maps_create(argv[0], argv[1], DICT_FLAG_LOCK);
while (vstring_fgets_nonl(buffer, VSTREAM_IN)) { while (vstring_fgets_nonl(buffer, VSTREAM_IN)) {
msg_info("=== Address extension on, extension propagation on ==="); msg_info("=== Address extension on, extension propagation on ===");
var_rcpt_delim = "+"; UPDATE(var_rcpt_delim, "+");
if ((result = mail_addr_map(path, STR(buffer), 1)) != 0) if ((result = mail_addr_map(path, STR(buffer), 1)) != 0)
argv_free(result); argv_free(result);
msg_info("=== Address extension on, extension propagation off ==="); msg_info("=== Address extension on, extension propagation off ===");
if ((result = mail_addr_map(path, STR(buffer), 0)) != 0) if ((result = mail_addr_map(path, STR(buffer), 0)) != 0)
argv_free(result); argv_free(result);
msg_info("=== Address extension off ==="); msg_info("=== Address extension off ===");
var_rcpt_delim = ""; UPDATE(var_rcpt_delim, "");
if ((result = mail_addr_map(path, STR(buffer), 1)) != 0) if ((result = mail_addr_map(path, STR(buffer), 1)) != 0)
argv_free(result); argv_free(result);
} }

View File

@@ -15,7 +15,7 @@
* Version of this program. * Version of this program.
*/ */
#define VAR_MAIL_VERSION "mail_version" #define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "Snapshot-20011006" #define DEF_MAIL_VERSION "Snapshot-20011007"
extern char *var_mail_version; extern char *var_mail_version;
/* LICENSE /* LICENSE

View File

@@ -921,6 +921,8 @@ int main(int argc, char **argv)
} }
} else if (optarg[0] == 'R') { } else if (optarg[0] == 'R') {
site_to_flush = optarg + 1; site_to_flush = optarg + 1;
if (*site_to_flush == 0)
msg_fatal("specify: -qRsitename");
} else { } else {
msg_fatal("-q%c is not implemented", optarg[0]); msg_fatal("-q%c is not implemented", optarg[0]);
} }

View File

@@ -146,7 +146,7 @@
/* without being told that the server implements SMTP command pipelining. /* without being told that the server implements SMTP command pipelining.
/* .IP permit_mx_backup /* .IP permit_mx_backup
/* Allow the request when all primary MX hosts for the recipient /* Allow the request when all primary MX hosts for the recipient
/* are in the networks specified with the $auth_mx_backup_networks /* are in the networks specified with the $permit_mx_backup_networks
/* configuration parameter, or when the local system is the final /* configuration parameter, or when the local system is the final
/* destination. /* destination.
/* .IP restriction_classes /* .IP restriction_classes
@@ -1022,7 +1022,7 @@ static int reject_unauth_pipelining(SMTPD_STATE *state)
return (SMTPD_CHECK_DUNNO); return (SMTPD_CHECK_DUNNO);
} }
/* all_auth_mx_addr - match host addresses against auth_mx_backup_networks */ /* all_auth_mx_addr - match host addresses against permit_mx_backup_networks */
static int all_auth_mx_addr(char *host) static int all_auth_mx_addr(char *host)
{ {
@@ -1043,7 +1043,7 @@ static int all_auth_mx_addr(char *host)
#define TRYAGAIN 2 #define TRYAGAIN 2
/* /*
* Verify that all host addresses are within auth_mx_backup_networks. * Verify that all host addresses are within permit_mx_backup_networks.
*/ */
dns_status = dns_lookup(host, T_A, 0, &addr_list, (VSTRING *) 0, (VSTRING *) 0); dns_status = dns_lookup(host, T_A, 0, &addr_list, (VSTRING *) 0, (VSTRING *) 0);
if (dns_status != DNS_OK) if (dns_status != DNS_OK)
@@ -1051,7 +1051,8 @@ static int all_auth_mx_addr(char *host)
for (rr = addr_list; rr != 0; rr = rr->next) { for (rr = addr_list; rr != 0; rr = rr->next) {
if (rr->data_len > sizeof(addr)) { if (rr->data_len > sizeof(addr)) {
msg_warn("skipping address length %d", rr->data_len); msg_warn("skipping address length %d for host %s",
rr->data_len, host);
continue; continue;
} }
memcpy((char *) &addr, rr->data, sizeof(addr)); memcpy((char *) &addr, rr->data, sizeof(addr));
@@ -1062,11 +1063,11 @@ static int all_auth_mx_addr(char *host)
/* /*
* Reject: at least one IP address is not listed in * Reject: at least one IP address is not listed in
* auth_mx_backup_networks. * permit_mx_backup_networks.
*/ */
if (msg_verbose) if (msg_verbose)
msg_info("%s: address %s does not match %s", msg_info("%s: address %s for %s does not match %s",
myname, inet_ntoa(addr), VAR_PERM_MX_NETWORKS); myname, inet_ntoa(addr), host, VAR_PERM_MX_NETWORKS);
dns_rr_free(addr_list); dns_rr_free(addr_list);
return (NOPE); return (NOPE);
} }
@@ -1183,7 +1184,7 @@ static int permit_mx_primary(DNS_RR *mx_list)
/* /*
* All IP addresses of the best MX hosts are within * All IP addresses of the best MX hosts are within
* auth_mx_backup_networks. * permit_mx_backup_networks.
*/ */
return (YUP); return (YUP);
} }

View File

@@ -5,10 +5,10 @@
/* multi-threaded SMTP/LMTP test server /* multi-threaded SMTP/LMTP test server
/* SYNOPSIS /* SYNOPSIS
/* .fi /* .fi
/* \fBsmtp-sink\fR [\fB-cLpv\fR] [\fB-w \fIdelay\fR] /* \fBsmtp-sink\fR [\fB-cLpv\fR] [\fB-n \fIcount\fR] [\fB-w \fIdelay\fR]
/* [\fBinet:\fR][\fIhost\fR]:\fIport\fR \fIbacklog\fR /* [\fBinet:\fR][\fIhost\fR]:\fIport\fR \fIbacklog\fR
/* /*
/* \fBsmtp-sink\fR [\fB-cLpv\fR] [\fB-w \fIdelay\fR] /* \fBsmtp-sink\fR [\fB-cLpv\fR] [\fB-n \fIcount\fR] [\fB-w \fIdelay\fR]
/* \fBunix:\fR\fIpathname\fR \fIbacklog\fR /* \fBunix:\fR\fIpathname\fR \fIbacklog\fR
/* DESCRIPTION /* DESCRIPTION
/* \fIsmtp-sink\fR listens on the named host (or address) and port. /* \fIsmtp-sink\fR listens on the named host (or address) and port.
@@ -18,17 +18,29 @@
/* Connections can be accepted on IPV4 endpoints or UNIX-domain sockets. /* Connections can be accepted on IPV4 endpoints or UNIX-domain sockets.
/* IPV4 is the default. /* IPV4 is the default.
/* This program is the complement of the \fIsmtp-source\fR program. /* This program is the complement of the \fIsmtp-source\fR program.
/* .IP -c /*
/* Arguments:
/* .IP \fB-c\fR
/* Display a running counter that is updated whenever an SMTP /* Display a running counter that is updated whenever an SMTP
/* QUIT command is executed. /* QUIT command is executed.
/* .IP -L /* .IP \fB-L\fR
/* Speak LMTP rather than SMTP. /* Speak LMTP rather than SMTP.
/* .IP -p /* .IP "\fB-n \fIcount\fR"
/* Terminate after \fIcount\fR sessions. This is for memory leak
/* testing purposes.
/* .IP \fB-p\fR
/* Disable ESMTP command pipelining. /* Disable ESMTP command pipelining.
/* .IP -v /* .IP \fB-v\fR
/* Show the SMTP conversations. /* Show the SMTP conversations.
/* .IP "-w delay" /* .IP "\fB-w \fIdelay\fR"
/* Wait \fIdelay\fR seconds before responding to a DATA command. /* Wait \fIdelay\fR seconds before responding to a DATA command.
/* .IP [\fBinet:\fR][\fIhost\fR]:\fIport\fR
/* Listen on network interface \fIhost\fR (default: any interface)
/* TCP port \fIport\fR.
/* .IP \fBunix:\fR\fIpathname\fR
/* Listen on the UNIX-domain socket at \fIpathname\fR.
/* .IP \fIbacklog\fR
/* The maximum length the queue of pending connections.
/* SEE ALSO /* SEE ALSO
/* smtp-source, SMTP/LMTP test message generator /* smtp-source, SMTP/LMTP test message generator
/* LICENSE /* LICENSE
@@ -98,6 +110,7 @@ static int data_read(SINK_STATE *);
static void disconnect(SINK_STATE *); static void disconnect(SINK_STATE *);
static int count; static int count;
static int counter; static int counter;
static int max_count;
static int disable_pipelining; static int disable_pipelining;
static int fixed_delay; static int fixed_delay;
static int enable_lmtp; static int enable_lmtp;
@@ -396,6 +409,8 @@ static void disconnect(SINK_STATE *state)
vstream_fclose(state->stream); vstream_fclose(state->stream);
vstring_free(state->buffer); vstring_free(state->buffer);
myfree((char *) state); myfree((char *) state);
if (counter >= max_count)
exit(0);
} }
/* connect_event - handle connection events */ /* connect_event - handle connection events */
@@ -437,7 +452,7 @@ static void connect_event(int unused_event, char *context)
static void usage(char *myname) static void usage(char *myname)
{ {
msg_fatal("usage: %s [-cLpv] [host]:port backlog", myname); msg_fatal("usage: %s [-cLpv] [-n count] [-w delay] [host]:port backlog", myname);
} }
int main(int argc, char **argv) int main(int argc, char **argv)
@@ -454,7 +469,7 @@ int main(int argc, char **argv)
/* /*
* Parse JCL. * Parse JCL.
*/ */
while ((ch = GETOPT(argc, argv, "cLpvw:")) > 0) { while ((ch = GETOPT(argc, argv, "cLn:pvw:")) > 0) {
switch (ch) { switch (ch) {
case 'c': case 'c':
count++; count++;
@@ -462,6 +477,9 @@ int main(int argc, char **argv)
case 'L': case 'L':
enable_lmtp = 1; enable_lmtp = 1;
break; break;
case 'n':
max_count = atoi(optarg);
break;
case 'p': case 'p':
disable_pipelining = 1; disable_pipelining = 1;
break; break;

View File

@@ -15,43 +15,48 @@
/* LMTP. Connections can be made to UNIX-domain and IPV4 servers. /* LMTP. Connections can be made to UNIX-domain and IPV4 servers.
/* IPV4 is the default. /* IPV4 is the default.
/* /*
/* Options: /* Arguments:
/* .IP -c /* .IP \fB-c\fR
/* Display a running counter that is incremented each time /* Display a running counter that is incremented each time
/* an SMTP DATA command completes. /* an SMTP DATA command completes.
/* .IP "-C count" /* .IP "\fB-C \fIcount\fR"
/* When a host sends RESET instead of SYN|ACK, try \fIcount\fR times /* When a host sends RESET instead of SYN|ACK, try \fIcount\fR times
/* before giving up. The default count is 1. Specify a larger count in /* before giving up. The default count is 1. Specify a larger count in
/* order to work around a problem with TCP/IP stacks that send RESET /* order to work around a problem with TCP/IP stacks that send RESET
/* when the listen queue is full. /* when the listen queue is full.
/* .IP -d /* .IP \fB-d\fR
/* Don't disconnect after sending a message; send the next /* Don't disconnect after sending a message; send the next
/* message over the same connection. /* message over the same connection.
/* .IP "-f from" /* .IP "\fB-f \fIfrom\fR"
/* Use the specified sender address (default: <foo@myhostname>). /* Use the specified sender address (default: <foo@myhostname>).
/* .IP -o /* .IP \fB-o\fR
/* Old mode: don't send HELO, and don't send message headers. /* Old mode: don't send HELO, and don't send message headers.
/* .IP "-l length" /* .IP "\fB-l \fIlength\fR"
/* Send \fIlength\fR bytes as message payload. The length does not /* Send \fIlength\fR bytes as message payload. The length does not
/* include message headers. /* include message headers.
/* .IP -L /* .IP \fB-L\fR
/* Speak LMTP rather than SMTP. /* Speak LMTP rather than SMTP.
/* .IP "-m message_count" /* .IP "\fB-m \fImessage_count\fR"
/* Send the specified number of messages (default: 1). /* Send the specified number of messages (default: 1).
/* .IP "-r recipient_count" /* .IP "\fB-r \fIrecipient_count\fR"
/* Send the specified number of recipients per transaction (default: 1). /* Send the specified number of recipients per transaction (default: 1).
/* Recipient names are generated by prepending a number to the /* Recipient names are generated by prepending a number to the
/* recipient address. /* recipient address.
/* .IP "-s session_count" /* .IP "\fB-s \fIsession_count\fR"
/* Run the specified number of SMTP sessions in parallel (default: 1). /* Run the specified number of SMTP sessions in parallel (default: 1).
/* .IP "-t to" /* .IP "\fB-t \fIto\fR"
/* Use the specified recipient address (default: <foo@myhostname>). /* Use the specified recipient address (default: <foo@myhostname>).
/* .IP "-R interval" /* .IP "\fB-R \fIinterval\fR"
/* Wait for a random period of time 0 <= n <= interval between messages. /* Wait for a random period of time 0 <= n <= interval between messages.
/* Suspending one thread does not affect other delivery threads. /* Suspending one thread does not affect other delivery threads.
/* .IP "-w interval" /* .IP "\fB-w \fIinterval\fR"
/* Wait a fixed time between messages. /* Wait a fixed time between messages.
/* Suspending one thread does not affect other delivery threads. /* Suspending one thread does not affect other delivery threads.
/* .IP [\fBinet:\fR]\fIhost\fR[:\fIport\fR]
/* Connect via TCP to \fIhost\fR port \fIport\fR. The default
/* port is \fBsmtp\fR.
/* .IP \fBunix:\fIpathname\fR
/* Connect to the UNIX-domain socket at \fIpathname\fR.
/* BUGS /* BUGS
/* No SMTP command pipelining support. /* No SMTP command pipelining support.
/* LICENSE /* LICENSE