]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.9-20030424
authorWietse Venema <wietse@porcupine.org>
Thu, 24 Apr 2003 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:28:51 +0000 (06:28 +0000)
23 files changed:
postfix/HISTORY
postfix/README_FILES/SASL_README
postfix/README_FILES/SCHEDULER_README [new file with mode: 0644]
postfix/README_FILES/VIRTUAL_README
postfix/conf/postfix-files
postfix/conf/sample-resource.cf
postfix/conf/sample-scheduler.cf [new file with mode: 0644]
postfix/html/postconf.1.html
postfix/man/man1/postconf.1
postfix/src/global/mail_queue.c
postfix/src/global/mail_version.h
postfix/src/global/pipe_command.c
postfix/src/postcat/postcat.c
postfix/src/postconf/postconf.c
postfix/src/sendmail/sendmail.c
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_check.in
postfix/src/smtpd/smtpd_check.in2
postfix/src/smtpd/smtpd_check.ref
postfix/src/smtpd/smtpd_check.ref2
postfix/src/smtpd/smtpd_exp.in
postfix/src/smtpd/smtpd_exp.ref
postfix/src/util/readlline.c

index 54ca787a78f9a40c43c1f7953ea4713ca3969f05..68140df75b027062f579e42075f7b874f3f804bf 100644 (file)
@@ -8020,6 +8020,33 @@ Apologies for any names omitted.
 
        Cleanup: made postcat "record names" output more consistent.
 
+20030421
+
+       Debugging: added some extra detailed error logging to the
+       pipe-to-command delivery, to help folks with bizarre file
+       truncation problems. File: global/pipe_command.c.
+
+20030424
+
+       Cleanup: readlline() did not terminate the result before
+       complaining about lines starting with whitespace.
+
+       Cleanup: eliminated valid_hostname warning for invalid
+       queue file names. File: global/mail_queue.c.
+
+       Bugfix: lost three lines of code when readying the postcat
+       command for release, which broke postcat -q. File:
+       postcat/postcat.c.
+
+       Bugfix: the Postfix sendmail command applied the message
+       size limit when running as newaliases. The limiting code
+       is now moved to the message enqueuing branch of the code.
+       File: sendmail/sendmail.c.
+
+       Documentation: start of documentation for the algorithm of
+       Patrik Rak's clever queue manager scheduler (nqmgr). Files:
+       conf/sample-scheduler.cf, README_FILES/SCHEDULER_README.
+
 Open problems:
 
        Low: smtp-source may block when sending large test messages.
index f5dbdcca4888ca234c9f7b4c40d8710d09008880..b2b6aa9a492e4ee470e2a20fa1a1aa4d35c4e8e9 100644 (file)
@@ -50,7 +50,8 @@ UCE restriction.
 
 SASL authentication information is not passed on via message headers
 or via SMTP.  It is no-one's business what username and authentication
-method the poster was using in order to access the mail server.
+method the poster was using in order to access the mail server. The
+people who need to know can find the information in the maillog file.
 
 When sending mail, Postfix looks up the server hostname or destination
 domain (the address remote part) in a table, and if a username/password
diff --git a/postfix/README_FILES/SCHEDULER_README b/postfix/README_FILES/SCHEDULER_README
new file mode 100644 (file)
index 0000000..457ea9e
--- /dev/null
@@ -0,0 +1,105 @@
+What this file is about
+=======================
+
+This is the beginning of documentation for the clever queue manager
+scheduling algorithm by Patrik Rak. For too much time, this code
+has been made available in the nqmgr queue manager as an optional
+module.
+
+Why Postfix ships two queue managers
+====================================
+
+The old Postfix scheduler had several limitations due to unfortunate
+choices in its design.
+
+1 - Round-robin selection by destination for mail that is delivered
+    via the same message delivery transport.  That strategy broke
+    down when one single destination (say, inbound mail) had to
+    compete with multiple other destinations (say, outbound mail).
+    The poor suffering destination would be selected only
+    1/number-of-destinations of the time, even when it had more
+    mail than other destinations, and thus mail could be delayed.
+
+    Victor Duchovni found a workaround: use different message
+    delivery transports, and thus avoid the starvation problem.
+    The Patrik Rak scheduler solves this problem by using FIFO
+    selection.
+
+2 - A second limitation of the old Postfix scheduler was that
+    delivery of bulk mail would block all other deliveries, causing
+    large delays.  Patrik Rak's scheduler allows mail with fewer
+    recipients to slip past bulk mail in an elegant manner.
+
+If this newer scheduler is so much better, why does Postfix still
+ship the old one? The problem is that there isn't a whole lot of
+documentation on how Patrik's code works, so that no-one except
+Patrik understands how it works.
+
+This document is the start of something that will help to clarify
+things. Once enough documentation exists we can end the embarassing
+situation of shipping two queue managers.
+
+How the queue manager scheduler works 
+=====================================
+
+[The following text is from Patrik Rak and should be read together
+with the sample-scheduler.cf file]
+
+From user's point of view, qmgr and nqmgr are both the same, except
+for how next message is chosen when delivery agent becomes available.
+You already know that qmgr uses round-robin by destination while
+nqmgr uses simple FIFO, except for some preemptive magic. The
+[sample-scheduler.cf file] documents all the knobs the user can
+use to control this preemptive magic - there is nothing else to
+the preemption than the quite simple conditions described below.
+
+As for programmer-level documentation, this will have to be extracted
+from all those emails we have exchanged with Wietse [rats! I hoped
+that Patrik would do the work for me -- Wietse] But I think there
+are no missing bits which we have not mentioned in our conversations.
+
+However, even from programmer's point of view, there is nothing
+more to add to the message scheduling idea itself.  There are few
+things which make it look more complicated than it is, but the
+algorithm is the same as the user percieves it. The summary of the
+changes from the user's view:
+
+1) Simplification of terms for users: The user knows about messages
+and recipients. The program itself works with jobs (one message is
+split among several jobs, one per each transport needed to deliver
+the message) and queue entries (each entry may group several
+recipients for same destination). Then there is the peer structure
+introduced by nqmgr which is simply per-job analog of the queue
+structure.
+
+2) Dealing with concurrency limits: The actual implementation is
+complicated by the fact that the messages (resp. jobs) may not be
+delivered in the exactly scheduled order because of the concurrency
+limits. It is necessary to skip some "blocker" jobs when the
+concurrency limit is reached and get back to them again when the
+limit permits.
+
+3) Dealing with resource limits: The actual implementation is
+complicated by the fact that not all recipients may be read in-core.
+Therefore each message has some recipients in-core and some may
+remain on-file. This means that a) the preemptive algorithm needs
+to work with recipient count estimates instead of exact counts, b)
+there is extra code which needs to manipulate the per-transport
+pool of recipients which may be read in-core at the same time, and
+c) there is extra code which needs to be able to read recipients
+into core in batches and which is triggered at appropriate moments.
+
+4) Doing things efficiently: All important things I am aware of
+are done in the minimum time possible (either directly or at least
+when ammortized complexity is used), but to choose which job is
+the best candidate for preempting the current job requires linear
+search of up to all transport jobs (the worst theoretical case -
+the reality is much better). As this is done every time the next
+queue entry to be delivered is about to be chosen, it seemed
+reasonable to add cache which minimizes the overhead. Maintenance
+of this candidate cache slightly obfuscates things.
+
+The points 2 and 3 are those which made the implementation (look)
+complicated and were the real coding work, but I believe that to
+understand the scheduling algorithm itself (which was the real
+thinking work) is fairly easy.
index fd833bc0a5484980018d840f96a6659fa0af465d..d4c9ab19cdcf0e64d9c23cabf087cfeb7acdcac8 100644 (file)
@@ -24,12 +24,13 @@ It looks up the user mailbox location, uid and gid via separate
 maps, and the mailbox location map can specify either mailbox or
 maildir delivery (controlled by trailing slash on mailbox name).
 
-The agent does not support user+foo address extensions, aliases or
-.forward files (use the virtual table instead), and therefore
-doesn't support file or program aliases. This choice was made to
-simplify and streamline the code (it allowed me to dispense with
-70% of local's code - mostly the bits that are a security headache)
-- if you need this functionality, this agent isn't for you.
+The agent allows but ignores user+foo address extensions, does not
+support aliases or .forward files (use the virtual table instead),
+and therefore doesn't support file or program aliases. This choice
+was made to simplify and streamline the code (it allowed me to
+dispense with 70% of local's code - mostly the bits that are a
+security headache) - if you need this functionality, this agent
+isn't for you.
 
 It also doesn't support writing to a common spool as root and then
 chowning the mailbox to the user - I felt this functionality didn't
@@ -160,9 +161,9 @@ Example 1: using the virtual delivery agent for all local mail
 ==============================================================
 
 This example does not use the Postfix local delivery agent at all.
-With this configuration Postfix does no user+foo address extension,
-no alias expansion, no .forward file expansion, and no lookups of
-recipients in /etc/passwd.
+With this configuration Postfix does no alias expansion, no .forward
+file expansion, no lookups of recipients in /etc/passwd, and allows
+but ignores user+foo address extensions.
 
 Instead of "hash" specify "dbm" or "btree", depending on your system
 type.  The command "postconf -m" displays possible lookup table
index b5175df76036dd5bb6cf230cd0791979753fc510..a3aa53536c811ffc5fbad1b117786375f656f026 100644 (file)
@@ -172,6 +172,7 @@ $sample_directory/sample-regexp-header.cf:f:root:-:644
 $sample_directory/sample-relocated.cf:f:root:-:644
 $sample_directory/sample-resource.cf:f:root:-:644
 $sample_directory/sample-rewrite.cf:f:root:-:644
+$sample_directory/sample-scheduler.cf:f:root:-:644
 $sample_directory/sample-smtp.cf:f:root:-:644
 $sample_directory/sample-smtpd.cf:f:root:-:644
 $sample_directory/sample-transport.cf:f:root:-:644
@@ -198,6 +199,7 @@ $readme_directory/QMQP_README:f:root:-:644
 $readme_directory/RELEASE_NOTES:f:root:-:644
 $readme_directory/RESTRICTION_CLASS_README:f:root:-:644
 $readme_directory/SASL_README:f:root:-:644
+$readme_directory/SCHEDULER_README:f:root:-:644
 $readme_directory/ULTRIX_README:f:root:-:644
 $readme_directory/UUCP_README:f:root:-:644
 $readme_directory/VERP_README:f:root:-:644
index 54ca3684f702f688231cd830b40b79df7417a42e..54c63394a7f9bef8d35bb30cf9535d84f3700984 100644 (file)
@@ -100,13 +100,44 @@ message_size_limit = 10240000
 # The qmgr_message_active_limit parameter limits the number of
 # messages in the active queue.
 #
-qmgr_message_active_limit = 1000
+qmgr_message_active_limit = 10000
 
 # The qmgr_message_recipient_limit parameter limits the number of
-# in-memory recipients. This parameter also limits the size of the
-# short-term, in-memory destination status cache.
+# in-memory recipients. This limit is used before any of the message
+# recipients have been read and the message has not been assigned
+# to any transports yet. See also qmgr_message_recipient_minimum.
 #
-qmgr_message_recipient_limit = 1000
+# This parameter also limits the size of the short-term, in-memory
+# destination status cache.
+#
+qmgr_message_recipient_limit = 10000
+
+# (nqmgr only)
+# The default_recipient_limit parameter is the default value for
+# per-transport limit imposed on the number of in-memory recipients.
+# These limits take priority over the global qmgr_message_recipient_limit
+# after the message has been assigned to the respective transports.
+# See also default_extra_recipient_limit and qmgr_message_recipient_minimum.
+#
+default_recipient_limit = 10000
+
+# (nqmgr only)
+# The default_extra_recipient_limit parameter is the default value for
+# extra per-transport limit imposed on the number of in-memory recipients.
+# This extra recipient space is reserved for the cases when the scheduler
+# preempts one message with another and suddenly needs some extra recipients
+# slots for the chosen message in order to avoid performance degradation.
+#
+default_extra_recipient_limit = 1000
+
+# (nqmgr only)
+# The qmgr_message_recipient_minimum parameter specifies the minimum
+# amount of in-memory recipients for any message. This takes
+# priority over any other in-memory recipient limits (i.e., global
+# qmgr_message_recipient_limit and per transport XXX_recipient_limit)
+# if necessary. The minimum value allowed for this parameter is 1.
+#
+qmgr_message_recipient_minimum = 10
 
 # The queue_minfree parameter specifies the minimal amount of free
 # space in bytes in the queue file system. This is currently used by
diff --git a/postfix/conf/sample-scheduler.cf b/postfix/conf/sample-scheduler.cf
new file mode 100644 (file)
index 0000000..90843ad
--- /dev/null
@@ -0,0 +1,63 @@
+# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF
+# HERE JUST SERVES AS AN EXAMPLE.
+#
+# This file contains example settings of Postfix queue manager
+# scheduler parameters. It is specific to the nqmgr queue manager.
+# 
+# Controls that are specific to message delivery transports are
+# described in the respective sample-transportname.cf file.
+
+# The default_delivery_slot_cost parameter controls how often
+# is the scheduler allowed to preempt one message with another.
+#
+# Each transport maintains so-called "available delivery slot counter" for
+# each message. One message can be preempted by another one when the other
+# message can be delivered using no more delivery slots (i.e., invocations
+# of delivery agents) than the current message counter has accumulated (or
+# will eventually accumulate - see about slot loans below). This parameter
+# controls how often is the counter incremented - it happens after each
+# default_delivery_slot_cost recipients have been delivered.
+#
+# The cost of 0 is used to disable the preempting scheduling completely. The
+# minimum value the scheduling algorithm can use is 2 - use it if you want
+# to maximize the message throughput rate. Although there is no maximum, it
+# doesn't make much sense to use values above say 50.
+#
+# The only reason why the value of 2 is not the default is the way this
+# parameter affects the delivery of mailing-list mail. In the worst case,
+# their delivery can take somewhere between (cost+1/cost) and (cost/cost-1)
+# times more than if the preemptive scheduler was disabled. The default
+# value of 5 turns out to provide reasonable message response times while
+# making sure the mailing-list deliveries are not extended by more than
+# 20-25 percent even in the worst case.
+#
+# default_delivery_slot_cost = 0
+# default_delivery_slot_cost = 2
+default_delivery_slot_cost = 5
+
+# The default_delivery_slot_discount and default_delivery_slot_loan
+# parameters allow fine-tuning the exact moment when the message preemption
+# happens. It turns out that most of the time it would be wasteful to delay
+# the message preemption until the delivery slot counter accumulates the
+# full amount of delivery slots needed for the preemption to happen. On the
+# other hand, it would not be not very smart to do every preemption
+# immediately either, because it could use all slots that some other urgent
+# message may need just seconds later.
+#
+# The discount (resp. loan) parameter specifies how many percent (resp. how
+# many slots) of the total amount one "gets in advance". If both discount
+# and loan are 0, the preemption can only happen after the full amount has
+# accumulated. With discount of 100, the preemption would happen immediately.
+# The default settings allow the preemption happen after about half of the
+# total amount has accumulated while further reducing the delay for messages
+# with very little recipients.
+#
+default_delivery_slot_discount = 50
+default_delivery_slot_loan = 3
+
+# The default_minimum_delivery_slots parameter controls how many recipients
+# a message must have in order to invoke the scheduling algorithm at all.
+# Messages which would never accumulate at least this many delivery slots
+# (subject to slot cost parameter as well) are never preempted.
+#
+default_minimum_delivery_slots = 3
index 4289928bfe276e1fd2eda0b866132fb7d312342d..f69ae5e805c42e4eb1df699a00e82698813d29e1 100644 (file)
@@ -89,6 +89,11 @@ POSTCONF(1)                                           POSTCONF(1)
                      ular   Expressions.   The   file  format  is
                      described in <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
 
+              <b>pgsql</b> (read-only)
+                     Perform lookups using the PostgreSQL  proto-
+                     col.  This  is  described  in a PGSQL_README
+                     file.
+
               <b>proxy</b> (read-only)
                      A lookup table that is implemented  via  the
                      Postfix  <a href="proxymap.8.html"><b>proxymap</b>(8)</a> service. The table name
index 4a7fab8e3972d6b9af9eba222db2dfbb054b8eee..f521aaa7609957f9d1ec5c3ddcd07b59213308b5 100644 (file)
@@ -82,6 +82,9 @@ in a MYSQL_README file.
 .IP "\fBpcre\fR (read-only)"
 A lookup table based on Perl Compatible Regular Expressions. The
 file format is described in \fBpcre_table\fR(5).
+.IP "\fBpgsql\fR (read-only)"
+Perform lookups using the PostgreSQL protocol. This is described
+in a PGSQL_README file.
 .IP "\fBproxy\fR (read-only)"
 A lookup table that is implemented via the Postfix
 \fBproxymap\fR(8) service. The table name syntax is
index 54916c8b59fd1a2b8ee9477d4ea2221afc4f909c..bb00522fc112d1de14bf70de3aa4cb8cdfc3204b 100644 (file)
@@ -311,7 +311,7 @@ int     mail_queue_id_ok(const char *queue_id)
     /*
      * OK if in valid hostname form.
      */
-    return (valid_hostname(queue_id, DO_GRIPE));
+    return (valid_hostname(queue_id, DONT_GRIPE));
 }
 
 /* mail_queue_enter - make mail queue entry with locally-unique name */
index fef966f828add2a035f6d002fe526a80960308bd..302e68189f9c0bf15cafff8b8fe59a9fb83da306 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only, unless they include the same bugfix as a patch release.
   */
-#define MAIL_RELEASE_DATE      "20030419"
+#define MAIL_RELEASE_DATE      "20030424"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #define DEF_MAIL_VERSION       "2.0.9-" MAIL_RELEASE_DATE
index 40026f2a49cf1eee2f7867b30768fecf7b9f341a..c3ca41b4a49bfd564eda648bcc270d655f1f7924 100644 (file)
@@ -261,8 +261,7 @@ static int pipe_command_write(int fd, void *buf, unsigned len)
      */
     if (write_wait(fd, maxtime) < 0) {
        if (pipe_command_timeout == 0) {
-           if (msg_verbose)
-               msg_info("%s: time limit exceeded", myname);
+           msg_warn("%s: write time limit exceeded", myname);
            pipe_command_timeout = 1;
        }
        return (0);
@@ -283,8 +282,7 @@ static int pipe_command_read(int fd, void *buf, unsigned len)
      */
     if (read_wait(fd, maxtime) < 0) {
        if (pipe_command_timeout == 0) {
-           if (msg_verbose)
-               msg_info("%s: time limit exceeded", myname);
+           msg_warn("%s: read time limit exceeded", myname);
            pipe_command_timeout = 1;
        }
        return (0);
@@ -325,8 +323,7 @@ static int pipe_command_wait_or_kill(pid_t pid, WAIT_STATUS_T *statusp, int sig,
      */
     if ((n = timed_waitpid(pid, statusp, 0, maxtime)) < 0 && errno == ETIMEDOUT) {
        if (pipe_command_timeout == 0) {
-           if (msg_verbose)
-               msg_info("%s: time limit exceeded", myname);
+           msg_warn("%s: child wait time limit exceeded", myname);
            pipe_command_timeout = 1;
        }
        kill_command(pid, sig, kill_uid, kill_gid);
@@ -347,6 +344,7 @@ int     pipe_command(VSTREAM *src, VSTRING *why,...)
     int     log_len;
     pid_t   pid;
     int     write_status;
+    int     write_errno;
     WAIT_STATUS_T wait_status;
     int     cmd_in_pipe[2];
     int     cmd_out_pipe[2];
@@ -489,6 +487,7 @@ int     pipe_command(VSTREAM *src, VSTRING *why,...)
                                 args.delivered, src,
                                 cmd_in_stream, args.flags,
                                 args.eol, DONT_CARE_WHY);
+       write_errno = errno;
 
        /*
         * Capture a limited amount of command output, for inclusion in a
@@ -549,8 +548,12 @@ int     pipe_command(VSTREAM *src, VSTRING *why,...)
            }
        } else if (write_status & MAIL_COPY_STAT_CORRUPT) {
            return (PIPE_STAT_CORRUPT);
-       } else if (write_status && errno != EPIPE) {
-           vstring_sprintf(why, "Command failed: %m: \"%s\"", args.command);
+       } else if (write_status && write_errno != EPIPE) {
+           errno = write_errno;
+           vstring_sprintf(why, "Command failed due to %s: %m: \"%s\"",
+             (write_status & MAIL_COPY_STAT_READ) ? "delivery read error" :
+           (write_status & MAIL_COPY_STAT_WRITE) ? "delivery write error" :
+                           "some delivery error", args.command);
            return (PIPE_STAT_DEFER);
        } else {
            return (PIPE_STAT_OK);
index 993528a17fdbcd0d7bcab567871d083e66065955..4f6c6c482016e6f6d60f84e59ee90cf3dbf16102 100644 (file)
@@ -154,8 +154,12 @@ static void postcat(VSTREAM *fp, VSTRING *buffer)
            break;
        }
        prev_type = rec_type;
+
+       /*
+        * In case the next record is broken.
+        */
+       vstream_fflush(VSTREAM_OUT);
     }
-    vstream_fflush(VSTREAM_OUT);
 }
 
 /* usage - explain and terminate */
@@ -247,11 +251,16 @@ int     main(int argc, char **argv)
        if (chdir(var_queue_dir))
            msg_fatal("chdir %s: %m", var_queue_dir);
        while (optind < argc) {
+           if (!mail_queue_id_ok(argv[optind]))
+               msg_fatal("bad mail queue ID: %s", argv[optind]);
            for (fp = 0, tries = 0; fp == 0 && tries < 2; tries++)
                for (cpp = queue_names; fp == 0 && *cpp != 0; cpp++)
                    fp = mail_queue_open(*cpp, argv[optind], O_RDONLY, 0);
            if (fp == 0)
                msg_fatal("open queue file %s: %m", argv[optind]);
+           postcat(fp, buffer);
+           if (vstream_fclose(fp))
+               msg_warn("close %s: %m", argv[optind]);
            optind++;
        }
     }
index 91854d52223132d34719941662f1dac6c97facba..8c91c734d6f77342e14bd881d578cd4a116c5d02 100644 (file)
@@ -76,6 +76,9 @@
 /* .IP "\fBpcre\fR (read-only)"
 /*     A lookup table based on Perl Compatible Regular Expressions. The
 /*     file format is described in \fBpcre_table\fR(5).
+/* .IP "\fBpgsql\fR (read-only)"
+/*     Perform lookups using the PostgreSQL protocol. This is described
+/*     in a PGSQL_README file.
 /* .IP "\fBproxy\fR (read-only)"
 /*     A lookup table that is implemented via the Postfix
 /*     \fBproxymap\fR(8) service. The table name syntax is
index fd12206f1b072b9feb9fc26a5f89cfb37a965c9d..93c2677a37eae4127d3df543f81e9486dae2895e 100644 (file)
@@ -466,6 +466,13 @@ static void enqueue(const int flags, const char *encoding, const char *sender,
      */
     buf = vstring_alloc(100);
 
+    /*
+     * Stop run-away process accidents by limiting the queue file size. This
+     * is not a defense against DOS attack.
+     */
+    if (var_message_limit > 0 && get_file_limit() > var_message_limit)
+       set_file_limit((off_t) var_message_limit);
+
     /*
      * The sender name is provided by the user. In principle, the mail pickup
      * service could deduce the sender name from queue file ownership, but:
@@ -784,13 +791,6 @@ int     main(int argc, char **argv)
     if (chdir(var_queue_dir))
        msg_fatal_status(EX_UNAVAILABLE, "chdir %s: %m", var_queue_dir);
 
-    /*
-     * Stop run-away process accidents by limiting the queue file size. This
-     * is not a defense against DOS attack.
-     */
-    if (var_message_limit > 0 && get_file_limit() > var_message_limit)
-       set_file_limit((off_t) var_message_limit);
-
     signal(SIGPIPE, SIG_IGN);
 
     /*
index a7da2a25e19956afc5da850bb5971a7a373e9f94..f3ef3fe4f1cb4003c50f8c5641adf3335d1619d1 100644 (file)
@@ -1671,7 +1671,7 @@ static int reject_unverified_address(SMTPD_STATE *state, const char *addr,
        case DEL_RCPT_STAT_TODO:
        case DEL_RCPT_STAT_DEFER:
            DEFER_IF_PERMIT3(state, MAIL_ERROR_POLICY,
-                            "450 <%s>: %s rejected: unverified address: %s",
+                       "450 <%s>: %s rejected: unverified address: %.250s",
                             reply_name, reply_class, STR(why));
            rqst_status = SMTPD_CHECK_DUNNO;
            break;
index 1e0b2969ac0c7239e89aba0cd87ca09391d55e19..2b56051789791a0180f656176ea803d001ae6df7 100644 (file)
@@ -6,7 +6,7 @@
 smtpd_delay_reject 0
 mynetworks 127.0.0.0/8,168.100.189.0/28
 relay_domains porcupine.org
-maps_rbl_domains socks.relays.osirusoft.com
+maps_rbl_domains relays.mail-abuse.org
 #
 # Test the client restrictions.
 #
index 886ffb9ef63eaaea0315a6b9bcb7c93bbd78da67..99aac8f099eaa3cdc4fef090bd85ffaa4fb7154e 100644 (file)
@@ -6,7 +6,7 @@
 smtpd_delay_reject 0
 mynetworks 127.0.0.0/8,168.100.189.0/28
 relay_domains porcupine.org
-maps_rbl_domains socks.relays.osirusoft.com
+maps_rbl_domains relays.mail-abuse.org
 #
 # Test the client restrictions.
 #
index 6d77f64172d53b7ab5a0e13e5487cc945fc4ea4c..61a9b3024d0d1096bb03e9ee919bcf5a8a40cb36 100644 (file)
@@ -9,7 +9,7 @@ OK
 OK
 >>> relay_domains porcupine.org
 OK
->>> maps_rbl_domains socks.relays.osirusoft.com
+>>> maps_rbl_domains relays.mail-abuse.org
 OK
 >>> #
 >>> # Test the client restrictions.
@@ -186,8 +186,8 @@ OK
 ./smtpd_check: warning: restriction reject_maps_rbl is going away. Please use reject_rbl_client <domain> instead
 OK
 >>> client foo 127.0.0.2
-./smtpd_check: <queue id>: reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test; from=<foo@friend.bad.domain> proto=SMTP helo=<123.123.123.123>
-554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test
+./smtpd_check: <queue id>: reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org; from=<foo@friend.bad.domain> proto=SMTP helo=<123.123.123.123>
+554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org
 >>> #
 >>> # Hybrids
 >>> #
index 26d31fe846683a390c015a6573f8602533680b24..142dd1e7f3787cb388306b2163403db2f3c8439f 100644 (file)
@@ -9,7 +9,7 @@ OK
 OK
 >>> relay_domains porcupine.org
 OK
->>> maps_rbl_domains socks.relays.osirusoft.com
+>>> maps_rbl_domains relays.mail-abuse.org
 OK
 >>> #
 >>> # Test the client restrictions.
@@ -176,8 +176,8 @@ OK
 ./smtpd_check: warning: restriction reject_maps_rbl is going away. Please use reject_rbl_client <domain> instead
 OK
 >>> client foo 127.0.0.2
-./smtpd_check: <queue id>: reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test; from=<foo@friend.bad.domain> proto=SMTP helo=<friend.bad.domain>
-554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test
+./smtpd_check: <queue id>: reject: CONNECT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org; from=<foo@friend.bad.domain> proto=SMTP helo=<friend.bad.domain>
+554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org
 >>> #
 >>> # unknown sender/recipient domain
 >>> #
index b1f7135be823d16626242f38b5e5af8ab74fb4ed..ce2a514d9f31119648d695d57b84d939fb677752 100644 (file)
@@ -6,7 +6,7 @@
 smtpd_delay_reject 0
 mynetworks 127.0.0.0/8,168.100.189.0/28
 relay_domains porcupine.org
-maps_rbl_domains socks.relays.osirusoft.com
+maps_rbl_domains relays.mail-abuse.org
 rbl_reply_maps hash:smtpd_check_access
 helo foobar
 #
@@ -19,7 +19,7 @@ rcpt rname@rdomain
 client foo 127.0.0.2
 rcpt rname@rdomain
 #
-recipient_restrictions reject_rbl_client,socks.relays.osirusoft.com
+recipient_restrictions reject_rbl_client,relays.mail-abuse.org
 client spike.porcupine.org 168.100.189.2
 rcpt rname@rdomain
 client foo 127.0.0.2
index b6de0d9da4a5dace625d3a9dc2c853f7efa2d4bc..05c676c2325f041685c06dcea5bc5c8b57843fed 100644 (file)
@@ -9,7 +9,7 @@ OK
 OK
 >>> relay_domains porcupine.org
 OK
->>> maps_rbl_domains socks.relays.osirusoft.com
+>>> maps_rbl_domains relays.mail-abuse.org
 OK
 >>> rbl_reply_maps hash:smtpd_check_access
 OK
@@ -30,10 +30,10 @@ OK
 >>> client foo 127.0.0.2
 OK
 >>> rcpt rname@rdomain
-./smtpd_check: <queue id>: reject: RCPT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test; from=<sname@sdomain> to=<rname@rdomain> proto=SMTP helo=<foobar>
-554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test
+./smtpd_check: <queue id>: reject: RCPT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org; from=<sname@sdomain> to=<rname@rdomain> proto=SMTP helo=<foobar>
+554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org
 >>> #
->>> recipient_restrictions reject_rbl_client,socks.relays.osirusoft.com
+>>> recipient_restrictions reject_rbl_client,relays.mail-abuse.org
 OK
 >>> client spike.porcupine.org 168.100.189.2
 OK
@@ -42,8 +42,8 @@ OK
 >>> client foo 127.0.0.2
 OK
 >>> rcpt rname@rdomain
-./smtpd_check: <queue id>: reject: RCPT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test; from=<sname@sdomain> to=<rname@rdomain> proto=SMTP helo=<foobar>
-554 Service unavailable; Client host [127.0.0.2] blocked using socks.relays.osirusoft.com; Proxy List Test
+./smtpd_check: <queue id>: reject: RCPT from foo[127.0.0.2]: 554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org; from=<sname@sdomain> to=<rname@rdomain> proto=SMTP helo=<foobar>
+554 Service unavailable; Client host [127.0.0.2] blocked using relays.mail-abuse.org
 >>> #
 >>> # RHSBL sender domain name
 >>> #
index 9be31eab10928eb9d9ba578d67cc693dd415a42f..49f1beb7a727e325d713188f3bb95b7ffe8ff5f9 100644 (file)
@@ -101,6 +101,7 @@ VSTRING *readlline(VSTRING *buf, VSTREAM *fp, int *lineno)
                break;
        }
     }
+    VSTRING_TERMINATE(buf);
 
     /*
      * Invalid input: continuing text without preceding text. Allowing this
@@ -118,6 +119,5 @@ VSTRING *readlline(VSTRING *buf, VSTREAM *fp, int *lineno)
     /*
      * Done.
      */
-    VSTRING_TERMINATE(buf);
     return (LEN(buf) > 0 ? buf : 0);
 }