]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.0.11 v2.0.11
authorWietse Venema <wietse@porcupine.org>
Mon, 9 Jun 2003 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 15:51:46 +0000 (15:51 +0000)
24 files changed:
postfix/0README
postfix/COMPATIBILITY
postfix/HISTORY
postfix/README_FILES/FILTER_README
postfix/html/postcat.1.html
postfix/html/virtual.8.html
postfix/man/man1/postcat.1
postfix/man/man8/virtual.8
postfix/src/cleanup/cleanup_envelope.c
postfix/src/global/mail_version.h
postfix/src/global/pipe_command.c
postfix/src/global/rec_type.h
postfix/src/global/sent.h
postfix/src/lmtp/lmtp_sasl_glue.c
postfix/src/local/Makefile.in
postfix/src/postcat/Makefile.in
postfix/src/postcat/postcat.c
postfix/src/postdrop/postdrop.c
postfix/src/sendmail/sendmail.c
postfix/src/smtpd/smtpd.c
postfix/src/util/dict_mysql.c
postfix/src/util/non_blocking.c
postfix/src/util/sys_defs.h
postfix/src/virtual/virtual.c

index 0b13f9ca3d20f7fda8133b2d0379591f72feac3d..85420af5bedd84a54de4ac446e25eb84063e32c7 100644 (file)
@@ -46,10 +46,10 @@ Web sites:
 
 Mail addresses (PLEASE send questions to the mailing list)
 
-    postfix-XXX@postfix.org            Postfix mailing lists
+    postfix-users@postfix.org          Postfix users mailing list
     wietse@porcupine.org               the original author
 
-In order to subscribe to a mailing list, see http://www.postfix.org/.
+In order to subscribe to the mailing list, see http://www.postfix.org/.
 
 Acknowledgments
 ===============
index 494efe453f775fabcf8d67ee99c3da3fd977bbc3..c958ab4ee14e26713324377cbdcf43e1c40f9a39 100644 (file)
@@ -31,7 +31,6 @@ mailertable   yes (it's called transport)
 mailq          yes
 majordomo      yes (edit approve script to delete /^delivered-to:/i)
 mime           yes (including 8bit to quoted-printable conversion)
-mime conversion        not yet; postfix uses just-send-eight
 mysql tables   yes (contributed)
 netinfo tables yes (contributed)
 newaliases     yes (main alias database only)
index b92b35e4c4b7166d944314964d13876b6a158b8c..66ab3f69f1e232f3dd8eafb9e8c03731ea6e75b4 100644 (file)
@@ -1262,12 +1262,12 @@ Apologies for any names omitted.
        reorganization of the way queue scans were done. The queue
        manager socket now has become public.
 
-10091002
+19981002
 
        SMTPD now logs "lost connection after end-of-message" instead
        of "lost connection after DATA".
 
-10091005
+19981005
 
        More bullet proofing: timeouts on all triggers.
 
@@ -7766,6 +7766,54 @@ Apologies for any names omitted.
        Richard Stockton, Gramma Software. Files:
        cleanup/cleanup_envelope.c, cleanup/cleanup_extracted.c
 
+20030528
+
+       Compatibility: "sendmail -q<time>" without -bd option now
+       exits immediately, instead of waiting for input on the
+       standard input stream and screwing up system boot sequences.
+       File: sendmail/sendmail.c.
+
+       Bugfix: the Postfix LMTP client used the wrong service
+       name, causing trouble with SASL 2.1.13.  Daniel Schales,
+       Louisiana Tech. File: lmtp/lmtp_sasl_glue.c.
+
+       Workaround: IRIX select() reports that a non-blocking file
+       descriptor is writable while write() transfers zero bytes.
+       File:  global/pipe_command.c.
+
+       Feature: "postcat -q" (search the queue for the named file)
+       support copied from snapshot release because I can't see
+       people suffer. File: postcat/postcat.c.
+
+20030530
+
+       Bugfix: client access denied with smtpd_delay_reject=no
+       broke "sendmail -bs". Fix by Victor Duchovni, Morgan Stanley.
+       File: smtpd/smtpd.c.
+
+20030531
+
+       Compatibility: allow <@site,@site:address> route addresses
+       in SMTP commands.  File: smtpd/smtpd.c.
+
+20030605
+
+       Bugfix: the "dead host" backoff timer in the MySQL client
+       didn't work.  Fix by Leandro Santi. File: util/dict_mysql.c.
+
+       Safety: stricter checks on what queue file records the
+       postdrop submission command accepts (idea copied from
+       snapshot). File:  postdrop/postdrop.c.
+
+       Workaround: turned off non-blocking write to pipe because
+       too many systems give a weird write() result. File:
+       global/pipe_command.c.  
+
+20030609
+
+       Workaround: Solaris non-blocking socket read() may hang.
+       Leandro Santi. File: smtpd/smtpd.c.
+
 Open problems:
 
        Low: smtp-source may block when sending large test messages.
index ecdf61d717b55de1bc418717362f69c8b548e434..e403b523e336d64b79d983e208e1dd495227527f 100644 (file)
@@ -505,7 +505,7 @@ Limitations:
   precedence over filters specified with the main.cf content_filter 
   parameter.
 
-- Only the last FILTER action from smtpd access maps or in
+- Only the last FILTER action from smtpd access maps or from
   header/body_checks takes effect.
 
 - The same content filter is applied to all the recipients of a
index 94e6d8ee0879afca0ea0b4d562cd7dee8e9de1ff..3d70fb1293bcba8a2d173b0d690f4c05c5075518 100644 (file)
@@ -5,25 +5,47 @@ POSTCAT(1)                                             POSTCAT(1)
        postcat - show Postfix queue file contents
 
 <b>SYNOPSIS</b>
-       <b>postcat</b> [<b>-v</b>] [<i>files</i>...]
+       <b>postcat</b> [<b>-vq</b>] [<b>-c</b> <i>config_dir</i>] [<i>files</i>...]
 
 <b>DESCRIPTION</b>
-       The <b>postcat</b> command prints the contents of the named Post-
-       fix queue <i>files</i> in human-readable form. If  no  <i>files</i>  are
-       specified  on  the  command  line,  the program reads from
-       standard input.
+       The <b>postcat</b> command prints the contents of the named <i>files</i>
+       in human-readable form. The files are expected  to  be  in
+       Postfix  queue  file  format. If no <i>files</i> are specified on
+       the command line, the program reads from standard input.
 
        Options:
 
+       <b>-c</b> <i>config_dir</i>
+              The <b>main.cf</b> configuration  file  is  in  the  named
+              directory  instead  of  the  default  configuration
+              directory.
+
+       <b>-q</b>     Search the Postfix queue  for  <i>files</i>.  By  default,
+              file names are taken literally.
+
        <b>-v</b>     Enable verbose logging for debugging purposes. Mul-
-              tiple  <b>-v</b>  options  make  the software increasingly
+              tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
 <b>DIAGNOSTICS</b>
        Problems are reported to the standard error stream.
 
+<b>ENVIRONMENT</b>
+       <b>MAIL</b><i>_</i><b>CONFIG</b>
+              Directory with Postfix configuration files.
+
+<b>CONFIGURATION</b> <b>PARAMETERS</b>
+       See  the  Postfix  <b>main.cf</b> file for syntax details and for
+       default values. Use the <b>postfix</b>  <b>reload</b>  command  after  a
+       configuration change.
+
+       <b>queue</b><i>_</i><b>directory</b>
+              Top-level  directory  of the Postfix queue. This is
+              also the root directory of Postfix daemons that run
+              chrooted.
+
 <b>LICENSE</b>
-       The Secure Mailer license must be  distributed  with  this
+       The  Secure  Mailer  license must be distributed with this
        software.
 
 <b>AUTHOR(S)</b>
index c36f4e3137dabe104ad7a530e1dc4757ab8a8c99..8066a01d1867af2e308c70b9bb2159e016592989 100644 (file)
@@ -152,110 +152,109 @@ VIRTUAL(8)                                             VIRTUAL(8)
 
        <b>virtual</b><i>_</i><b>minimum</b><i>_</i><b>uid</b>
               Specifies  a minimum uid that will be accepted as a
-              return   from   a   <b>virtual</b><i>_</i><b>owner</b><i>_</i><b>maps</b>   or    <b>vir-</b>
-              <b>tual</b><i>_</i><b>uid</b><i>_</i><b>maps</b>  lookup.   Returned  values less than
-              this will be rejected,  and  the  message  will  be
-              deferred.
+              return from a  <b>virtual</b><i>_</i><b>uid</b><i>_</i><b>maps</b>  lookup.   Returned
+              values  less  than  this  will be rejected, and the
+              message will be deferred.
 
        <b>virtual</b><i>_</i><b>uid</b><i>_</i><b>maps</b>
               Recipients are looked up in these maps to determine
-              the user ID to be used when writing to  the  target
+              the  user  ID to be used when writing to the target
               mailbox.
 
-              While  searching  a lookup table, an address exten-
+              While searching a lookup table, an  address  exten-
               sion (<i>user+foo@domain.tld</i>) is ignored.
 
-              In a lookup table,  specify  a  left-hand  side  of
-              <i>@domain.tld</i>  to  match  any  user  in the specified
-              domain   that   does   not    have    a    specific
+              In  a  lookup  table,  specify  a left-hand side of
+              <i>@domain.tld</i> to match  any  user  in  the  specified
+              domain    that    does    not   have   a   specific
               <i>user@domain.tld</i> entry.
 
-              For  security  reasons, regular expression maps are
-              allowed but regular expression substitution  of  $1
+              For security reasons, regular expression  maps  are
+              allowed  but  regular expression substitution of $1
               etc. is disallowed, because that would open a secu-
               rity hole.
 
-              For security reasons, proxied table lookup  is  not
+              For  security  reasons, proxied table lookup is not
               allowed, because that would open a security hole.
 
        <b>virtual</b><i>_</i><b>gid</b><i>_</i><b>maps</b>
               Recipients are looked up in these maps to determine
-              the group ID to be used when writing to the  target
+              the  group ID to be used when writing to the target
               mailbox.
 
-              While  searching  a lookup table, an address exten-
+              While searching a lookup table, an  address  exten-
               sion (<i>user+foo@domain.tld</i>) is ignored.
 
-              In a lookup table,  specify  a  left-hand  side  of
-              <i>@domain.tld</i>  to  match  any  user  in the specified
-              domain   that   does   not    have    a    specific
+              In  a  lookup  table,  specify  a left-hand side of
+              <i>@domain.tld</i> to match  any  user  in  the  specified
+              domain    that    does    not   have   a   specific
               <i>user@domain.tld</i> entry.
 
-              For  security  reasons, regular expression maps are
-              allowed but regular expression substitution  of  $1
+              For security reasons, regular expression  maps  are
+              allowed  but  regular expression substitution of $1
               etc. is disallowed, because that would open a secu-
               rity hole.
 
-              For security reasons, proxied table lookup  is  not
+              For  security  reasons, proxied table lookup is not
               allowed, because that would open a security hole.
 
 <b>Locking</b> <b>controls</b>
        <b>virtual</b><i>_</i><b>mailbox</b><i>_</i><b>lock</b>
-              How  to  lock  UNIX-style mailboxes: one or more of
-              <b>flock</b>,  <b>fcntl</b>  or  <b>dotlock</b>.  The   <b>dotlock</b>   method
-              requires  that  the  recipient UID or GID has write
+              How to lock UNIX-style mailboxes: one  or  more  of
+              <b>flock</b>,   <b>fcntl</b>   or  <b>dotlock</b>.  The  <b>dotlock</b>  method
+              requires that the recipient UID or  GID  has  write
               access to the parent directory of the mailbox file.
 
-              This  setting  is ignored with <b>maildir</b> style deliv-
+              This setting is ignored with <b>maildir</b>  style  deliv-
               ery,  because  such  deliveries  are  safe  without
               explicit locks.
 
-              Use  the command <b>postconf</b> <b>-l</b> to find out what lock-
+              Use the command <b>postconf</b> <b>-l</b> to find out what  lock-
               ing methods are available on your system.
 
        <b>deliver</b><i>_</i><b>lock</b><i>_</i><b>attempts</b>
-              Limit the number of attempts to acquire  an  exclu-
+              Limit  the  number of attempts to acquire an exclu-
               sive lock on a UNIX-style mailbox file.
 
        <b>deliver</b><i>_</i><b>lock</b><i>_</i><b>delay</b>
               Time (default: seconds) between successive attempts
-              to acquire an exclusive lock on a UNIX-style  mail-
-              box  file. The actual delay is slightly randomized.
+              to  acquire an exclusive lock on a UNIX-style mail-
+              box file. The actual delay is slightly  randomized.
 
        <b>stale</b><i>_</i><b>lock</b><i>_</i><b>time</b>
-              Limit the time after  which  a  stale  lockfile  is
-              removed  (applicable to UNIX-style mailboxes only).
+              Limit  the  time  after  which  a stale lockfile is
+              removed (applicable to UNIX-style mailboxes  only).
 
 <b>Resource</b> <b>controls</b>
        <b>virtual</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>
               Limit the number of parallel deliveries to the same
               domain via the <b>virtual</b> delivery agent.  The default
               limit is taken from the <b>default</b><i>_</i><b>destination</b><i>_</i><b>concur-</b>
-              <b>rency</b><i>_</i><b>limit</b>  parameter.   The  limit is enforced by
+              <b>rency</b><i>_</i><b>limit</b> parameter.  The limit  is  enforced  by
               the Postfix queue manager.
 
        <b>virtual</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
               Limit the number of recipients per message delivery
-              via  the <b>virtual</b> delivery agent.  The default limit
-              is  taken  from   the   <b>default</b><i>_</i><b>destination</b><i>_</i><b>recipi-</b>
-              <b>ent</b><i>_</i><b>limit</b>  parameter.  The limit is enforced by the
+              via the <b>virtual</b> delivery agent.  The default  limit
+              is   taken   from  the  <b>default</b><i>_</i><b>destination</b><i>_</i><b>recipi-</b>
+              <b>ent</b><i>_</i><b>limit</b> parameter.  The limit is enforced by  the
               Postfix queue manager.
 
        <b>virtual</b><i>_</i><b>mailbox</b><i>_</i><b>limit</b>
-              The maximal size in bytes of a mailbox  or  maildir
+              The  maximal  size in bytes of a mailbox or maildir
               file.  Set to zero to disable the limit.
 
 <b>HISTORY</b>
-       This  agent  was  originally  based  on  the Postfix local
+       This agent was  originally  based  on  the  Postfix  local
        delivery agent. Modifications mainly consisted of removing
-       code  that  either was not applicable or that was not safe
-       in this context: aliases, ~user/.forward  files,  delivery
+       code that either was not applicable or that was  not  safe
+       in  this  context: aliases, ~user/.forward files, delivery
        to "|command" or to /file/name.
 
-       The  <b>Delivered-To:</b>  header  appears in the <b>qmail</b> system by
+       The <b>Delivered-To:</b> header appears in the  <b>qmail</b>  system  by
        Daniel Bernstein.
 
-       The <b>maildir</b> structure  appears  in  the  <b>qmail</b>  system  by
+       The  <b>maildir</b>  structure  appears  in  the  <b>qmail</b> system by
        Daniel Bernstein.
 
 <b>SEE</b> <b>ALSO</b>
@@ -266,7 +265,7 @@ VIRTUAL(8)                                             VIRTUAL(8)
        <a href="qmgr.8.html">qmgr(8)</a> queue manager
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
index 2ab5fe048db1233be55be04ae36661417b1ff85f..5b7f28a5f1511a180f9c35210d39ac8d15af52ca 100644 (file)
@@ -8,16 +8,23 @@ show Postfix queue file contents
 .SH SYNOPSIS
 .na
 .nf
-\fBpostcat\fR [\fB-v\fR] [\fIfiles\fR...]
+\fBpostcat\fR [\fB-vq\fR] [\fB-c \fIconfig_dir\fR] [\fIfiles\fR...]
 .SH DESCRIPTION
 .ad
 .fi
 The \fBpostcat\fR command prints the contents of the named
-Postfix queue \fIfiles\fR in human-readable form. If no
+\fIfiles\fR in human-readable form. The files are expected
+to be in Postfix queue file format. If no
 \fIfiles\fR are specified on the command line, the program
 reads from standard input.
 
 Options:
+.IP "\fB-c \fIconfig_dir\fR"
+The \fBmain.cf\fR configuration file is in the named directory
+instead of the default configuration directory.
+.IP \fB-q\fR
+Search the Postfix queue for \fIfiles\fR. By default,
+file names are taken literally.
 .IP \fB-v\fR
 Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 options make the software increasingly verbose.
@@ -25,6 +32,24 @@ options make the software increasingly verbose.
 .ad
 .fi
 Problems are reported to the standard error stream.
+.SH ENVIRONMENT
+.na
+.nf
+.ad
+.fi
+.IP \fBMAIL_CONFIG\fR
+Directory with Postfix configuration files.
+.SH CONFIGURATION PARAMETERS
+.na
+.nf
+.ad
+.fi
+See the Postfix \fBmain.cf\fR file for syntax details and for
+default values. Use the \fBpostfix reload\fR command after a
+configuration change.
+.IP \fBqueue_directory\fR
+Top-level directory of the Postfix queue. This is also the root
+directory of Postfix daemons that run chrooted.
 .SH LICENSE
 .na
 .nf
index ea13355170c9480825b67e348d88c522f7a23efd..7dd8207701fb80475c18c649285ffa1a3bc9a144 100644 (file)
@@ -166,7 +166,7 @@ delivery agent. This uses the same syntax as the \fBmydestination\fR
 configuration parameter.
 .IP \fBvirtual_minimum_uid\fR
 Specifies a minimum uid that will be accepted as a return from
-a \fBvirtual_owner_maps\fR or \fBvirtual_uid_maps\fR lookup.
+a \fBvirtual_uid_maps\fR lookup.
 Returned values less than this will be rejected, and the message
 will be deferred.
 .IP \fBvirtual_uid_maps\fR
index 950be4a5c3c2819bcae04d36ab675ee97d1cf6b2..914719c04231919669439bbe6a0c1c6dcec56b16 100644 (file)
@@ -153,10 +153,12 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf,
        }
     }
     if (type == REC_TYPE_TIME) {
-       state->time = atol(buf);
+       if (state->time == 0)
+           state->time = atol(buf);
        cleanup_out(state, type, buf, len);
     } else if (type == REC_TYPE_FULL) {
-       state->fullname = mystrdup(buf);
+       if (state->fullname == 0)
+           state->fullname = mystrdup(buf);
     } else if (type == REC_TYPE_FROM) {
        VSTRING *clean_addr = vstring_alloc(100);
 
index 9df4cebceed4f3543e92e1a41187c2cc9a8090e7..f55dc59bcb0fc7dd8791bb22fc5da8828691fc33 100644 (file)
   * 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      "20030521"
+#define MAIL_RELEASE_DATE      "20030609"
 
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "2.0.10"
+#define DEF_MAIL_VERSION       "2.0.11"
 extern char *var_mail_version;
 
  /*
index 40026f2a49cf1eee2f7867b30768fecf7b9f341a..1e193974bb468a19b16828e8e47d4a2467743140 100644 (file)
@@ -381,11 +381,16 @@ int     pipe_command(VSTREAM *src, VSTRING *why,...)
      * 
      * Turn on non-blocking writes to the child process so that we can enforce
      * timeouts after partial writes.
+     * 
+     * XXX Too much trouble with different systems returning weird write()
+     * results when a pipe is writable.
      */
     if (pipe(cmd_in_pipe) < 0 || pipe(cmd_out_pipe) < 0)
        msg_fatal("%s: pipe: %m", myname);
     non_blocking(cmd_out_pipe[1], NON_BLOCKING);
+#if 0
     non_blocking(cmd_in_pipe[1], NON_BLOCKING);
+#endif
 
     /*
      * Spawn off a child process and irrevocably change privilege to the
index 452aac40cceb16ae81c92baea2984505abc2cc76..348de2dca4bd0a71f23ce950275acbfd0959f6cb 100644 (file)
 #define REC_TYPE_CONTENT       "XLN"
 #define REC_TYPE_EXTRACT       "EDROPreAFIL"
 
+ /*
+  * The subset of inputs that the postdrop command allows.
+  */
+#define REC_TYPE_POST_ENVELOPE "MFSRVA"
+#define REC_TYPE_POST_CONTENT  "XLN"
+#define REC_TYPE_POST_EXTRACT  "E"
+
  /*
   * The record at the beginning of the envelope segment specifies the message
   * content size, data offset, and recipient count. These are fixed-width
index 92c441427ce2616272435b52f1067cde4cae8072..0ce8027ddb3f11ed4d4629335701583c3516553f 100644 (file)
@@ -35,6 +35,5 @@ extern int vsent(const char *, const char *, const char *, const char *,
 /*     P.O. Box 704
 /*     Yorktown Heights, NY 10598, USA
 /*--*/
-/**INDENT** Error@17: Unmatched #endif */
 
 #endif
index a53c19f9a6dc271e00697db1f97b742b5655fe5d..60e622fcabddc69557f23cd1116cc2a51cad49c7 100644 (file)
@@ -369,7 +369,7 @@ void    lmtp_sasl_start(LMTP_STATE *state)
 #define NULL_SERVER_ADDR       ((char *) 0)
 #define NULL_CLIENT_ADDR       ((char *) 0)
 
-    if (SASL_CLIENT_NEW("smtp", state->session->host,
+    if (SASL_CLIENT_NEW("lmtp", state->session->host,
                        NULL_CLIENT_ADDR, NULL_SERVER_ADDR,
                        state->sasl_callbacks, NULL_SECFLAGS,
                        (sasl_conn_t **) &state->sasl_conn) != SASL_OK)
index 15539ceed12a8c1e4605f46b90522571710751d8..71af7dfaa69f8356b1b579ed27158949f319a6ca 100644 (file)
@@ -462,6 +462,7 @@ token.o: ../../include/tok822.h
 token.o: ../../include/resolve_clnt.h
 token.o: ../../include/mail_params.h
 token.o: ../../include/bounce.h
+token.o: ../../include/defer.h
 token.o: local.h
 token.o: ../../include/been_here.h
 token.o: ../../include/deliver_request.h
index 65cf7576f3a32630f0ad782408823dc8078e27a4..dca6108806e3c0a6c5375b0ea3290c5043d584f6 100644 (file)
@@ -65,3 +65,6 @@ postcat.o: ../../include/msg_vstream.h
 postcat.o: ../../include/vstring_vstream.h
 postcat.o: ../../include/record.h
 postcat.o: ../../include/rec_type.h
+postcat.o: ../../include/mail_queue.h
+postcat.o: ../../include/mail_conf.h
+postcat.o: ../../include/mail_params.h
index 824c95422669cd4347ddd4e2810e926ebb8d029a..4f4ab9d7262cdae2f5aaaac4d8fd8de97f3e0d61 100644 (file)
@@ -4,19 +4,40 @@
 /* SUMMARY
 /*     show Postfix queue file contents
 /* SYNOPSIS
-/*     \fBpostcat\fR [\fB-v\fR] [\fIfiles\fR...]
+/*     \fBpostcat\fR [\fB-vq\fR] [\fB-c \fIconfig_dir\fR] [\fIfiles\fR...]
 /* DESCRIPTION
 /*     The \fBpostcat\fR command prints the contents of the named
-/*     Postfix queue \fIfiles\fR in human-readable form. If no
+/*     \fIfiles\fR in human-readable form. The files are expected
+/*     to be in Postfix queue file format. If no
 /*     \fIfiles\fR are specified on the command line, the program
 /*     reads from standard input.
 /*
 /*     Options:
+/* .IP "\fB-c \fIconfig_dir\fR"
+/*     The \fBmain.cf\fR configuration file is in the named directory
+/*     instead of the default configuration directory.
+/* .IP \fB-q\fR
+/*     Search the Postfix queue for \fIfiles\fR. By default,
+/*     file names are taken literally.
 /* .IP \fB-v\fR
 /*     Enable verbose logging for debugging purposes. Multiple \fB-v\fR
 /*     options make the software increasingly verbose.
 /* DIAGNOSTICS
 /*     Problems are reported to the standard error stream.
+/* ENVIRONMENT
+/* .ad
+/* .fi
+/* .IP \fBMAIL_CONFIG\fR
+/*     Directory with Postfix configuration files.
+/* CONFIGURATION PARAMETERS
+/* .ad
+/* .fi
+/*     See the Postfix \fBmain.cf\fR file for syntax details and for
+/*     default values. Use the \fBpostfix reload\fR command after a
+/*     configuration change.
+/* .IP \fBqueue_directory\fR
+/*     Top-level directory of the Postfix queue. This is also the root
+/*     directory of Postfix daemons that run chrooted.
 /* LICENSE
 /* .ad
 /* .fi
 
 #include <record.h>
 #include <rec_type.h>
+#include <mail_queue.h>
+#include <mail_conf.h>
+#include <mail_params.h>
 
 /* Application-specific. */
 
+#define PC_FLAG_QUEUE (1<<0)           /* search queue */
+
 #define STR    vstring_str
 
 /* postcat - visualize Postfix queue file contents */
@@ -65,7 +91,7 @@ static void postcat(VSTREAM *fp, VSTRING *buffer)
     int     ch;
 
 #define TEXT_RECORD(rec_type) \
-           (rec_type == REC_TYPE_CONT || rec_type == REC_TYPE_NORM)
+               (rec_type == REC_TYPE_CONT || rec_type == REC_TYPE_NORM)
 
     /*
      * See if this is a plausible file.
@@ -139,7 +165,8 @@ static void postcat(VSTREAM *fp, VSTRING *buffer)
 
 static NORETURN usage(char *myname)
 {
-    msg_fatal("usage: %s [-v] [file(s)...]", myname);
+    msg_fatal("usage: %s [-c config_dir] [-q (access queue)] [-v] [file(s)...]",
+             myname);
 }
 
 int     main(int argc, char **argv)
@@ -149,6 +176,17 @@ int     main(int argc, char **argv)
     int     ch;
     int     fd;
     struct stat st;
+    int     flags = 0;
+    static char *queue_names[] = {
+       MAIL_QUEUE_MAILDROP,
+       MAIL_QUEUE_INCOMING,
+       MAIL_QUEUE_ACTIVE,
+       MAIL_QUEUE_DEFERRED,
+       MAIL_QUEUE_HOLD,
+       0,
+    };
+    char  **cpp;
+    int     tries;
 
     /*
      * To minimize confusion, make sure that the standard file descriptors
@@ -168,8 +206,15 @@ int     main(int argc, char **argv)
     /*
      * Parse JCL.
      */
-    while ((ch = GETOPT(argc, argv, "v")) > 0) {
+    while ((ch = GETOPT(argc, argv, "c:qv")) > 0) {
        switch (ch) {
+       case 'c':
+           if (setenv(CONF_ENV_PATH, optarg, 1) < 0)
+               msg_fatal("out of memory");
+           break;
+       case 'q':
+           flags |= PC_FLAG_QUEUE;
+           break;
        case 'v':
            msg_verbose++;
            break;
@@ -178,6 +223,11 @@ int     main(int argc, char **argv)
        }
     }
 
+    /*
+     * Further initialization...
+     */
+    mail_conf_read();
+
     /*
      * Initialize.
      */
@@ -193,6 +243,27 @@ int     main(int argc, char **argv)
        postcat(VSTREAM_IN, buffer);
     }
 
+    /*
+     * Copy the named queue files in the specified order.
+     */
+    else if (flags & PC_FLAG_QUEUE) {
+       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++;
+       }
+    }
+
     /*
      * Copy the named files in the specified order.
      */
index 141702406f07c98b1c661bf36191b89e9d4b4903..7afa0f9ff23331639eb5412776b1408a4526ae98 100644 (file)
@@ -178,7 +178,7 @@ int     main(int argc, char **argv)
     MAIL_STREAM *dst;
     int     rec_type;
     static char *segment_info[] = {
-       REC_TYPE_ENVELOPE, REC_TYPE_CONTENT, REC_TYPE_EXTRACT,
+       REC_TYPE_POST_ENVELOPE, REC_TYPE_POST_CONTENT, REC_TYPE_POST_EXTRACT, ""
     };
     char  **expected;
     uid_t   uid = getuid();
index 29bc38feb4c9e332970c0d519896bd75440c855f..685949749197fa15b27594f819360236e70490f7 100644 (file)
@@ -554,6 +554,7 @@ int     main(int argc, char **argv)
     int     flags = SM_FLAG_DEFAULT;
     char   *site_to_flush = 0;
     char   *encoding = 0;
+    char   *qtime = 0;
 
     /*
      * Be consistent with file permissions.
@@ -750,11 +751,7 @@ int     main(int argc, char **argv)
            break;
        case 'q':
            if (ISDIGIT(optarg[0])) {
-               if (mode == SM_MODE_DAEMON) {
-                   if (msg_verbose)
-                       msg_info("-%c%s option ignored", c, optarg);
-
-               }
+               qtime = optarg;
            } else if (optarg[0] == 'R') {
                site_to_flush = optarg + 1;
                if (*site_to_flush == 0)
@@ -798,6 +795,8 @@ int     main(int argc, char **argv)
     /*
      * Start processing. Everything is delegated to external commands.
      */
+    if (qtime && mode != SM_MODE_DAEMON)
+       exit(0);
     switch (mode) {
     default:
        msg_panic("unknown operation mode: %d", mode);
index f4cd07788d95bf904407b15938c8f3f11f5c8486..851c4db1947239b1ee2056e3ec5d8f02841a486d 100644 (file)
@@ -629,7 +629,9 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
     int     naddr;
     int     non_addr;
     char   *err = 0;
-    char   *junk;
+    char   *junk = 0;
+    char   *text;
+    char   *colon;
 
     /*
      * Special case.
@@ -653,11 +655,19 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
        msg_info("%s: input: %s", myname, STR(arg->vstrval));
     if (STR(arg->vstrval)[0] == '<'
        && STR(arg->vstrval)[LEN(arg->vstrval) - 1] == '>') {
-       junk = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2);
-       tree = tok822_parse(junk);
-       myfree(junk);
+       junk = text = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2);
     } else
-       tree = tok822_parse(STR(arg->vstrval));
+       text = STR(arg->vstrval);
+
+    /*
+     * Truncate deprecated route address form.
+     */
+    if (*text == '@' && (colon = strchr(text, ':')) != 0)
+       text = colon + 1;
+    tree = tok822_parse(text);
+
+    if (junk)
+       myfree(junk);
 
     /*
      * Find trouble.
@@ -700,7 +710,7 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
      * Report trouble. Log a warning only if we are going to sleep+reject so
      * that attackers can't flood our logfiles.
      */
-    if (arg->strval[0] == 0 && !allow_empty_addr) {
+    if ((arg->strval[0] == 0 && !allow_empty_addr) || arg->strval[0] == '@') {
        msg_warn("Illegal address syntax from %s in %s command: %s",
                 state->namaddr, state->where, STR(arg->vstrval));
        err = "501 Bad address syntax";
@@ -796,7 +806,7 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
                verp_delims = arg + VERP_CMD_LEN + 1;
                if (verp_delims_verify(verp_delims) != 0) {
                    state->error_mask |= MAIL_ERROR_PROTOCOL;
-                   smtpd_chat_reply(state, "501 %s needs two characters from %s",
+                   smtpd_chat_reply(state, "501 Error: %s needs two characters from %s",
                                     VERP_CMD, var_verp_filter);
                    return (-1);
                }
@@ -808,7 +818,8 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
        }
     }
     if (verp_delims && argv[2].strval[0] == 0) {
-       smtpd_chat_reply(state, "503 Error: XVERP requires non-null sender");
+       smtpd_chat_reply(state, "503 Error: %s requires non-null sender",
+                        VERP_CMD);
        return (-1);
     }
     state->time = time((time_t *) 0);
@@ -1460,7 +1471,8 @@ static void smtpd_proto(SMTPD_STATE *state)
        break;
 
     case 0:
-       if (var_smtpd_delay_reject == 0
+       if (SMTPD_STAND_ALONE(state) == 0
+           && var_smtpd_delay_reject == 0
            && (state->access_denied = smtpd_check_client(state)) != 0) {
            smtpd_chat_reply(state, "%s", state->access_denied);
        } else {
@@ -1572,6 +1584,13 @@ static void smtpd_service(VSTREAM *stream, char *unused_service, char **argv)
     smtpd_state_init(&state, stream);
     msg_info("connect from %s[%s]", state.name, state.addr);
 
+    /*
+     * XXX non_blocking() aborts upon error.
+     */
+#ifdef BROKEN_READ_SELECT_ON_BLOCKING_SOCKET
+    non_blocking(vstream_fileno(stream), NON_BLOCKING);
+#endif
+
     /*
      * See if we need to turn on verbose logging for this client.
      */
index f778e928d082bb2876666a22fce22c5e5c5ee2be..baecfb85b12e8574d768877ba39f4973454b55ea 100644 (file)
@@ -127,6 +127,7 @@ typedef struct {
 static PLMYSQL *plmysql_init(char *hostnames[], int);
 static MYSQL_RES *plmysql_query(PLMYSQL *, const char *, char *, char *, char *);
 static void plmysql_dealloc(PLMYSQL *);
+static void plmysql_close_host(HOST *);
 static void plmysql_down_host(HOST *);
 static void plmysql_connect_single(HOST *, char *, char *, char *);
 static int plmysql_ready_reconn(HOST *);
@@ -246,7 +247,7 @@ static MYSQL_RES *plmysql_query(PLMYSQL *PLDB,
            if (msg_verbose)
                msg_info("dict_mysql: closing unnessary connection to %s",
                         host->hostname);
-           plmysql_down_host(host);
+           plmysql_close_host(host);
        }
        /* try to connect for the first time if we don't have a result yet */
        if (res == 0 && host->stat == STATUNTRIED) {
@@ -331,18 +332,24 @@ static void plmysql_connect_single(HOST *host, char *dbname, char *username, cha
        myfree(hostname);
 }
 
+/* plmysql_close_host - close an established MySQL connection */
+static void plmysql_close_host(HOST *host)
+{
+    mysql_close(host->db);
+    host->db = 0;
+    host->stat = STATUNTRIED;
+}
+
 /*
- * plmysql_down_host - mark a HOST down update ts if marked down
- * for the first time so that we'll know when to retry the connection
+ * plmysql_down_host - close a failed connection AND set a "stay away from 
+ * this host" timer
  */
 static void plmysql_down_host(HOST *host)
 {
-    if (host->stat != STATFAIL) {
-       host->ts = time((time_t *) 0) + RETRY_CONN_INTV;
-       host->stat = STATFAIL;
-    }
     mysql_close(host->db);
     host->db = 0;
+    host->ts = time((time_t *) 0) + RETRY_CONN_INTV;
+    host->stat = STATFAIL;
 }
 
 /**********************************************************************
index 08f0c8243287aad64a2fc50122db1f9e16a77f1b..6427cd80fc62b01c07d4cc5186a7c2d35ad7db5c 100644 (file)
@@ -44,7 +44,7 @@
 #include "iostuff.h"
 
 /* Backwards compatibility */
-#ifdef FNDELAY
+#ifndef O_NONBLOCK
 #define PATTERN        FNDELAY
 #else
 #define PATTERN        O_NONBLOCK
index d1735d9f8faf269dde62d85a5b635a3b66b3dd80..739818adf5c57b6c4ba171a166f5df7d5482e1d2 100644 (file)
@@ -185,6 +185,7 @@ extern int opterr;                  /* XXX use <getopt.h> */
 #define USE_STATFS
 #define STATFS_IN_SYS_MOUNT_H
 #define HAS_POSIX_REGEXP
+#define BROKEN_WRITE_SELECT_ON_NON_BLOCKING_PIPE
 #endif
 
  /*
@@ -260,6 +261,7 @@ extern int opterr;
 #define LOCAL_CONNECT  stream_connect
 #define LOCAL_TRIGGER  stream_trigger
 #define HAS_VOLATILE_LOCKS
+#define BROKEN_READ_SELECT_ON_BLOCKING_SOCKET
 /*
  * Allow build environment to override paths.
  */
@@ -463,6 +465,7 @@ extern int initgroups(const char *, int);
 #define DBM_NO_TRAILING_NULL           /* XXX check */
 #define USE_STATVFS
 #define STATVFS_IN_SYS_STATVFS_H
+#define BROKEN_WRITE_SELECT_ON_NON_BLOCKING_PIPE
 #endif
 
 #if defined(IRIX5)
index f25f52f4acd9e793416cc8a79ba0a42a407e4962..7141a55d52a0ea38a81d3409e3ea04b57e37eb0c 100644 (file)
 /*     configuration parameter.
 /* .IP \fBvirtual_minimum_uid\fR
 /*     Specifies a minimum uid that will be accepted as a return from
-/*     a \fBvirtual_owner_maps\fR or \fBvirtual_uid_maps\fR lookup.
+/*     a \fBvirtual_uid_maps\fR lookup.
 /*     Returned values less than this will be rejected, and the message
 /*     will be deferred.
 /* .IP \fBvirtual_uid_maps\fR