]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20000718
authorWietse Venema <wietse@porcupine.org>
Tue, 18 Jul 2000 05:00:00 +0000 (00:00 -0500)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 23:11:32 +0000 (18:11 -0500)
42 files changed:
postfix/DEBUG_README
postfix/HISTORY
postfix/INSTALL
postfix/Makefile.in
postfix/cleanup/cleanup.h
postfix/cleanup/cleanup_message.c
postfix/conf/sample-smtpd.cf
postfix/global/Makefile.in
postfix/global/been_here.h
postfix/global/bounce.h
postfix/global/defer.h
postfix/global/deliver_request.c
postfix/global/mail_params.h
postfix/global/mail_proto.h
postfix/global/mail_version.h
postfix/global/opened.h
postfix/global/post_mail.h
postfix/global/record.h
postfix/global/sent.h
postfix/global/smtp_stream.h
postfix/html/faq.html
postfix/html/motivation.html
postfix/html/pipe.8.html
postfix/html/uce.html
postfix/lmtp/lmtp.h
postfix/man/man8/pipe.8
postfix/nqmgr/qmgr.h
postfix/pipe/pipe.c
postfix/qmgr/qmgr.h
postfix/smtp/smtp.h
postfix/smtpd/smtpd_chat.h
postfix/smtpd/smtpd_check.c
postfix/util/Makefile.in
postfix/util/dup2_pass_on_exec.c [new file with mode: 0644]
postfix/util/events.c
postfix/util/make_dirs.c
postfix/util/msg.h
postfix/util/msg_output.h
postfix/util/sys_defs.h
postfix/util/vstream.h
postfix/util/vstring.h
postfix/util/watchdog.c

index 78d0b6dd5c71236d7e854196a02a3571a0372512..3ad762120542f2ee3fd28cfe56fcdc7c911f0561 100644 (file)
@@ -104,6 +104,10 @@ by its author? There are two possibilities.
 In both cases, the program being executed is not the program that
 was supposed to be executed, so anything can happen.
 
+There is a third possibility:
+
+3 - Bugs in system software (kernel or libraries).
+
 Hardware-related failures happen erratically, and they usually do
 not reproduce after power cycling and rebooting the system.  There's
 little I can do about bad hardware.  Be sure to use hardware that
index 7a478e98397b485df0155fed3208087e0fadd126..c7e387e875bd2e2caee774294653c0dcd16a40b3 100644 (file)
@@ -4095,3 +4095,22 @@ Apologies for any names omitted.
        delivery agent no longer appends a blank line to mail that
        is delivered to external command. Files:  pipe/pipe.c,
        global/mail_copy.[hc].
+
+20000708
+
+       Portability: support for NEXT/OPENSTEP requires extra
+       include file in util/watchdog.c (Masaki Murase).
+
+20000715
+
+       Added macros to turn on vstream/vstring/etc. format string
+       checking by gcc, in addition to the checking that was
+       already implemented with printfck.  File: util/sys_defs.h,
+       the macros for PRINTFLIKE and SCANFLIKE. Problem - unlike
+       the printfck tool, this gcc finds mismatches only in code
+       that isn't #ifdef-ed out.
+
+20000718
+
+       Robustness: make_dirs() now continues when a missing
+       directory is created by another process.
index b383ed8977b2684badb12c45a5fb696d5428b947..d445826730e191acfb7c50ac20b38db1f554fa7e 100644 (file)
@@ -82,7 +82,7 @@ If your system is supported, it is one of
     Reliant UNIX 5.x
     Rhapsody 5.x
     SunOS 4.1.x
-    SunOS 5.4..5.7 (Solaris 2.4..7)
+    SunOS 5.4..5.8 (Solaris 2.4..8)
     Ultrix 4.x
 
 or something closely resemblant.
index 37d18300be2bdf8fe759bb12d73e95bbca71919e..4fa822d0fa01a31806a04363ea6bb20aa889e156 100644 (file)
@@ -1,5 +1,5 @@
 SHELL  = /bin/sh
-WARN    = -Wmissing-prototypes
+WARN    = -Wmissing-prototypes -Wformat
 OPTS   = "CC=$(CC)"
 DIRS   = util global dns master postfix smtpstone sendmail error \
        pickup cleanup smtpd local lmtp trivial-rewrite qmgr smtp bounce pipe \
index 4bba6ada52e73c6e67debb20b35bcfa94badb37a..13809b382864c9a20050b326f8dd075c9a774906 100644 (file)
@@ -108,7 +108,7 @@ extern CONFIG_STR_TABLE cleanup_str_table[];
   */
 extern void cleanup_out(CLEANUP_STATE *, int, char *, int);
 extern void cleanup_out_string(CLEANUP_STATE *, int, char *);
-extern void cleanup_out_format(CLEANUP_STATE *, int, char *,...);
+extern void PRINTFLIKE(3, 4) cleanup_out_format(CLEANUP_STATE *, int, char *,...);
 
 #define CLEANUP_OUT_BUF(s, t, b) \
        cleanup_out((s), (t), vstring_str((b)), VSTRING_LEN((b)))
index 3b6efc24592a79fc863d34a910bc7d590de2b1bd..ed43a59293f7251b0de58b4118235c02f0c302ac 100644 (file)
@@ -354,10 +354,11 @@ static void cleanup_missing_headers(CLEANUP_STATE *state)
 
     if ((state->headers_seen & (1 << (state->resent[0] ?
                                      HDR_RESENT_FROM : HDR_FROM))) == 0) {
-       quote_822_local(state->temp1, state->sender);
+       quote_822_local(state->temp1, *state->sender ?
+                       state->sender : MAIL_ADDR_MAIL_DAEMON);
        vstring_sprintf(state->temp2, "%sFrom: %s",
                        state->resent, vstring_str(state->temp1));
-       if (state->fullname && *state->fullname) {
+       if (*state->sender && state->fullname && *state->fullname) {
            vstring_sprintf(state->temp1, "(%s)", state->fullname);
            token = tok822_parse(vstring_str(state->temp1));
            vstring_strcat(state->temp2, " ");
index f662bfa2ce59d60bf18063dd9b37eefc3feedf56..0539cc551bcc3ee23e251fa7dfbbbfd52af6772d 100644 (file)
@@ -41,7 +41,8 @@ smtpd_banner = $myhostname ESMTP $mail_name
 #      or networks obtained by stripping octets.
 #      Reject if result is REJECT or "[45]xx text"
 #      Permit otherwise.
-#   reject_maps_rbl: reject if the client is listed under $maps_rbl_domains.
+#   reject_maps_rbl: reject if the reverse client network address
+#      is listed under $maps_rbl_domains.
 #   reject: reject the request. Place this at the end of a restriction.
 #   permit: permit the request. Place this at the end of a restriction.
 smtpd_etrn_restrictions =
index 673dc8819fbbfb40b6605a990f948f345aff12de..544b29919a3d0424514a75756c989830e2ded35f 100644 (file)
@@ -62,7 +62,7 @@ INCL  =
 LIB    = libglobal.a
 TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \
        mail_addr_map mail_date maps mynetworks mypwd namadr_list \
-       off_cvt quote_822_local rec2stream recdump resolve_clnt \
+       off_cvt peer_name quote_822_local rec2stream recdump resolve_clnt \
        resolve_local rewrite_clnt stream2rec string_list tok822_parse \
        quote_821_local
 
@@ -197,6 +197,11 @@ local_transport: $(LIB) $(LIBS)
 quote_821_local: quote_821_local.c $(LIBS)
        $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIBS) $(SYSLIBS)
 
+peer_name: $(LIB)
+       mv $@.o junk
+       $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
+       mv junk $@.o
+
 tests: tok822_test
 
 tok822_test: tok822_parse tok822_parse.in tok822_parse.ref
index 12d87848741b19677f6e3932e2b1d4a1323e566c..855001d61184fef53380f48026468d6e7cea576c 100644 (file)
@@ -31,9 +31,9 @@ typedef struct {
 extern BH_TABLE *been_here_init(int, int);
 extern void been_here_free(BH_TABLE *);
 extern int been_here_fixed(BH_TABLE *, const char *);
-extern int been_here(BH_TABLE *, const char *,...);
+extern int PRINTFLIKE(2, 3) been_here(BH_TABLE *, const char *,...);
 extern int been_here_check_fixed(BH_TABLE *, const char *);
-extern int been_here_check(BH_TABLE *, const char *,...);
+extern int PRINTFLIKE(2, 3) been_here_check(BH_TABLE *, const char *,...);
 
 /* LICENSE
 /* .ad
index ccee874ef08bf0eb32a7ca692e133bad3826b558..fd3623e98244e517e489f16efa4a55a18430246e 100644 (file)
  /*
   * Client interface.
   */
-extern int bounce_append(int, const char *, const char *, const char *,
-                                time_t, const char *,...);
+extern int PRINTFLIKE(6, 7) bounce_append(int, const char *, const char *,
+                                                 const char *, time_t,
+                                                 const char *,...);
 extern int vbounce_append(int, const char *, const char *, const char *,
                                  time_t, const char *, va_list);
 extern int bounce_flush(int, const char *, const char *, const char *);
 
-extern int bounce_recip(int, const char *, const char *, const char *,
-                               const char *, const char *, time_t,
-                               const char *,...);
+extern int PRINTFLIKE(8, 9) bounce_recip(int, const char *, const char *,
+                                                const char *, const char *,
+                                                const char *, time_t,
+                                                const char *,...);
 extern int vbounce_recip(int, const char *, const char *, const char *,
                                 const char *, const char *, time_t,
                                 const char *, va_list);
@@ -38,7 +40,8 @@ extern int vbounce_recip(int, const char *, const char *, const char *,
   */
 #define BOUNCE_CMD_APPEND      0       /* append log */
 #define BOUNCE_CMD_FLUSH       1       /* send log */
-#define BOUNCE_CMD_WARN                2       /* send warning bounce, don't delete log */
+#define BOUNCE_CMD_WARN                2       /* send warning bounce, don't delete
+                                        * log */
 #define BOUNCE_CMD_RECIP       3       /* immediate bounce, no logfile */
 
  /*
index ae6385cfce33362a2d3899f5d538373640a5678f..d23e2d664ace786169763a88c4c2cf20932572c8 100644 (file)
@@ -25,8 +25,8 @@
  /*
   * External interface.
   */
-extern int defer_append(int, const char *, const char *, const char *,
-                               time_t, const char *,...);
+extern int PRINTFLIKE(6, 7) defer_append(int, const char *, const char *,
+                                   const char *, time_t, const char *,...);
 extern int vdefer_append(int, const char *, const char *, const char *,
                                 time_t, const char *, va_list);
 extern int defer_flush(int, const char *, const char *, const char *);
index a38f0368d7eed326a02572815f27309c7cafa434..fee68b991942e78115e7514a9b8cd81d0af3b898 100644 (file)
@@ -190,7 +190,7 @@ static int deliver_request_get(VSTREAM *stream, DELIVER_REQUEST *request)
                  &request->flags,
                  queue_name, queue_id, &request->data_offset,
                  &request->data_size, nexthop, address,
-                 errors_to, return_receipt, &request->arrival_time) != 9)
+                 errors_to, return_receipt, &request->arrival_time) != 10)
        return (-1);
     if (mail_open_ok(vstring_str(queue_name),
                     vstring_str(queue_id), &st, &path) == 0)
index 64e0929267f814cf930f17f3d35d997b9336814a..e3bb7d6e09d3f3bbc1cc61b2a40afeee11d99322 100644 (file)
@@ -23,6 +23,14 @@ typedef int bool;
 #define DEF_MAIL_NAME          "Postfix"
 extern char *var_mail_name;
 
+ /*
+  * Logging facility. Configurable so you can distinguish a limited number of
+  * Postfix instances.
+  */
+#define VAR_LOG_FACILITY       "logging_facility"
+#define DEF_LOG_FACILITY       "mail"
+extern char *var_log_facility;
+
  /*
   * What problem classes should be reported to the postmaster via email.
   * Default is bad problems only. See mail_error(3). Even when mail notices
index 977df5604fdf21ef5b5a938c5be43258fa3af021..275680c51471ccfa72582d7d19730b0aed4fa3ab 100644 (file)
@@ -81,8 +81,8 @@ extern VSTREAM *mail_connect_wait(const char *, const char *);
 extern int mail_scan(VSTREAM *, const char *,...);
 extern void mail_scan_register(int, const char *, MAIL_SCAN_FN);
 extern void mail_print_register(int, const char *, MAIL_PRINT_FN);
-extern int mail_print(VSTREAM *, const char *,...);
-extern int mail_command_write(const char *, const char *, const char *,...);
+extern int PRINTFLIKE(2, 3) mail_print(VSTREAM *, const char *,...);
+extern int PRINTFLIKE(3, 4) mail_command_write(const char *, const char *, const char *,...);
 extern int mail_command_read(VSTREAM *, char *,...);
 extern int mail_trigger(const char *, const char *, const char *, int);
 extern char *mail_pathname(const char *, const char *);
index 9d9f8ac887468f840afb7432af6d3b51f1bef2a3..67b1245e85178c1b9679eb57d721f6a453ef015e 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20000625"
+#define DEF_MAIL_VERSION       "Snapshot-20000718"
 extern char *var_mail_version;
 
 /* LICENSE
index d365b0c008ce1aaad7d490248796318649e81c0e..618dd4221a1b6c9dd9a1704942af7d5872493311 100644 (file)
@@ -19,7 +19,8 @@
  /*
   * External interface.
   */
-extern void opened(const char *, const char *, long, const char *,...);
+extern void PRINTFLIKE(4, 5) opened(const char *, const char *, long,
+                                           const char *,...);
 extern void vopened(const char *, const char *, long, const char *, va_list);
 
 /* LICENSE
index 4786876ba0c1fc998e9ae28a375879f8ece22c1d..8fa5a80bf3bdadae8b46954522070c53f057ec93 100644 (file)
@@ -27,7 +27,7 @@
 extern VSTREAM *post_mail_fopen(const char *, const char *, int, const char *);
 extern VSTREAM *post_mail_fopen_nowait(const char *, const char *,
                                               int, const char *);
-extern int post_mail_fprintf(VSTREAM *, const char *,...);
+extern int PRINTFLIKE(2, 3) post_mail_fprintf(VSTREAM *, const char *,...);
 extern int post_mail_fputs(VSTREAM *, const char *);
 extern int post_mail_buffer(VSTREAM *, const char *, int);
 extern int post_mail_fclose(VSTREAM *);
index 8728689486012945fabec5350c0d54a3ae82803d..da91dc3e10ddd0244e9fc734ba638f0443cb21ac 100644 (file)
@@ -35,7 +35,7 @@
 extern int rec_get(VSTREAM *, VSTRING *, int);
 extern int rec_put(VSTREAM *, int, const char *, int);
 extern int rec_put_type(VSTREAM *, int, long);
-extern int rec_fprintf(VSTREAM *, int, const char *,...);
+extern int PRINTFLIKE(3, 4) rec_fprintf(VSTREAM *, int, const char *,...);
 extern int rec_fputs(VSTREAM *, int, const char *);
 
 #define REC_PUT_BUF(v, t, b) rec_put((v), (t), vstring_str(b), VSTRING_LEN(b))
index 82eaac18834e2bf14a81f7330b1bd12865ed4ad0..cc5178fd0fefeaf6d8bdc336db757eb764176df9 100644 (file)
@@ -20,8 +20,8 @@
  /*
   * External interface.
   */
-extern int sent(const char *, const char *, const char *,
-                       time_t, const char *,...);
+extern int PRINTFLIKE(5, 6) sent(const char *, const char *, const char *,
+                                        time_t, const char *,...);
 extern int vsent(const char *, const char *, const char *,
                         time_t, const char *, va_list);
 
index f1f087b49a535d9c81ba1508b8e10346c2c4b60e..09f53e7bc10d2b1573d329de77d9aa3cdd63472e 100644 (file)
@@ -30,7 +30,7 @@
 #define SMTP_ERR_TIME  2               /* time out */
 
 extern void smtp_timeout_setup(VSTREAM *, int);
-extern void smtp_printf(VSTREAM *, const char *,...);
+extern void PRINTFLIKE(2, 3) smtp_printf(VSTREAM *, const char *,...);
 extern int smtp_get(VSTRING *, VSTREAM *, int);
 extern void smtp_fputs(const char *, int len, VSTREAM *);
 extern void smtp_fwrite(const char *, int len, VSTREAM *);
index 691b64e0fa24178f951ea2df4b1d66acf2d7cc0e..f53e7d25b9c97dfdc557a803cb1277e3d9cfdbfb 100644 (file)
@@ -26,6 +26,8 @@
 
 <li><a href="#sendmail_incompatibility">Sendmail incompatibility</a>
 
+<li><a href="#performance">Postfix performance</a>
+
 <li><a href="#receiving">Receiving mail via the network</a>
 
 <li><a href="#relaying">Mail relaying</a>
@@ -95,6 +97,14 @@ distribution list</a>
 
 </ul>
 
+<a name="performance"><h3>Postfix performance</h3>
+
+<ul>
+
+<li><a href="#incoming">Too much mail in the incoming queue</a>
+
+</ul>
+
 <a name="receiving"><h3>Receiving mail via the network</h3>
 
 <ul>
@@ -127,6 +137,8 @@ domains with "relay access denied"</a>
 
 <ul>
 
+<li><a href="#dns-again">All remote mail stays queued with: Host not found, try again</a>
+
 <li><a href="#timeouts">Mail fails consistently with timeout or lost connection</a>
 
 <li><a href="#skip_greeting">Postfix does not try all the MX addresses</a>
@@ -239,6 +251,8 @@ mailbox</a>
 
 <li><a href="#db">Using third-party DB libraries</a>
 
+<li><a href="#sgistruct">IRIX problems translating IP address to string</a>
+
 </ul>
 
 <hr>
@@ -432,7 +446,7 @@ else mail will bounce with a "mail loops to myself" condition.
 
 <p>
 
-Specify <b>dbm:/etc/postfix/transport</b> if your system uses
+Specify <b>dbm</b> instead of <b>hash</b> if your system uses
 <b>dbm</b> files instead of <b>db</b>. To find out what map types
 Postfix supports, use the command <b>postconf -m</b>.
 
@@ -491,7 +505,7 @@ route mail for <i>my.domain</i> to the inside machine:
 
 <p>
 
-Specify <b>dbm:/etc/postfix/transport</b> if your system uses
+Specify <b>dbm</b> instead of <b>hash</b> if your system uses
 <b>dbm</b> files instead of <b>db</b>. To find out what map types
 Postfix supports, use the command <b>postconf -m</b>.
 
@@ -779,6 +793,63 @@ delivery agent deals with undeliverable mail.
 
 <hr>
 
+<a name="incoming"><h3>Too much mail in the incoming queue</h3></a>
+
+<blockquote>
+
+I have lots if mail in the incoming queue, but Postfix only runs
+a few outbound SMTP deliveries. Why is it not running more SMTP
+clients?
+
+</blockquote>
+
+<p>
+
+Your problem is that the disk is saturated with I/O from receiving
+mail, so that the Postfix queue manager gets insufficient chance
+to process the requests (many SMTP server processes against one
+poor queue manager).
+
+<p>
+
+You solve the problem by getting faster disks.
+
+<p>
+
+I am still solving the scheduling problem from the software side.
+
+<p>
+
+Currently, the workaround is to configure multiple IP addresses
+per machine, and to run one Postfix instance per IP address.  The
+Postfix instances can't share queue directories, but sharing mailbox
+directories is OK.
+
+<p>
+
+Just start each Postfix instance with a different configuration
+directory:
+
+<p>
+
+<pre>
+    # postfix -c config_directory start
+</pre>
+
+<p>
+
+Each main.cf file has a different <b>$myhostname</b> setting,
+depending on the interface that it is supposed to handle.
+
+<p>
+
+<pre>
+    myhostname = foo1.my.domain
+    inet_interfaces = $myhostname
+</pre>
+
+<hr>
+
 <a name="delay"><h3>Postfix responds slowly to incoming SMTP connections</h3></a>
 
 <dl>
@@ -1191,6 +1262,33 @@ types Postfix supports, use the command <b>postconf -m</b>.
 
 <hr>
 
+<a name="dns-again"><h3>All remote mail stays queued with: Host not found, try again</h3></a>
+
+<blockquote>
+
+When I connect send mail to a remote address, the following happens:
+
+<p>
+
+<pre>
+    Jul 14 12:45:38 myhostname postfix/qmgr[2246]: 74FBF30501:
+       from=&lt;sender@sender.domain&gt; size=309 (queue active)
+    Jul 14 12:45:39 myhostname postfix/smtp[2349]: 74FBF30501:
+       to=&lt;recip@recip.domain&gt; relay=none, delay=3944, status=deferred (Name
+       service error for domain recip.domain: Host not found, try again)
+</pre>
+
+</blockquote>
+
+<p>
+
+Check out your Postfix <b>master.cf</b> file. If the SMTP client
+runs chrooted, then it needs a bunch of files inside the Postfix
+queue directory.  Examples are in the source distribution in the
+<b>examples</b> subdirectory.
+
+<hr>
+
 <a name="timeouts"><h3>Mail fails consistently with timeout or lost connection</h3></a>
 
 Every now and then, mail fails with "timed out while sending end
@@ -2476,6 +2574,33 @@ db_185.h include file:
 </pre>
 
 </ul>
+
+<hr>
+
+<a name="sgistruct">
+
+<h3>IRIX problems translating IP address to string</h3>
+
+<dl>
+
+<dt>Question:  <dd> While installing IRIX 6.5.7m on a clean disk
+and no special options or software I stumbled upon the following
+problem; the inet_ntoa() function seems to return INADDR_NONE
+(malformed request?) for every call to it.  
+
+<p>
+
+<dt>Answer: <dd>There is an incompatibility between gcc and system
+libraries compiled with SGI's cc.  See a description in <a
+href="http://freeware.sgi.com/shared/howto.html">
+http://freeware.sgi.com/shared/howto.html</a>.
+
+<p>If you must use gcc, a possible workaround is to use the
+inet_ntoa() routine from the BIND source code at <a
+href="http://www.isc.org/"> http://www.isc.org/</a>.
+
+</dl>
+
 <hr>
 
 <a href="index.html">Up one level</a> | Postfix FAQ
index f27c9569adb820b9de3efec12743b9bbdb880b31..972da06b7138c369690ef2b35dd8f005da83b8e7 100644 (file)
@@ -44,8 +44,9 @@ program will go through its life as Postfix instead.
 <p>
 
 Postfix is a direct competitor to the <a href="http://www.qmail.org">
-qmail </a> by Dan Bernstein. That's competitor, not enemy. I'm sure
-that friendly competition will help to improve both programs.
+qmail </a> software by Dan Bernstein. That's competitor, not enemy.
+I'm sure that friendly competition will help to improve both
+programs.
 
 <hr>
 
index 0b02333e5f41821cceb4c53baaf53af9a5e0cc8d..fa0f42390cf6b4f22ce1af1061c0964badfeb74d 100644 (file)
@@ -141,6 +141,11 @@ PIPE(8)                                                   PIPE(8)
                      This macro expands to  the  envelope  sender
                      address.
 
+              <b>${size</b>}
+                     This  macro expands to Postfix's idea of the
+                     message size, which is an  approximation  of
+                     the size of the message as delivered.
+
               <b>${user</b>}
                      This macro expands to the username part of a
                      recipient address.   For  example,  with  an
@@ -185,12 +190,7 @@ PIPE(8)                                                   PIPE(8)
        <i>transport_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>
               Limit the number of parallel deliveries to the same
               destination,  for delivery via the named <i>transport</i>.
-              The default limit is taken from the  <b>default</b><i>_</i><b>desti-</b>
-              <b>nation</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>  parameter.   The limit is
-              enforced by the Postfix queue manager.
-
-       <i>transport_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
-              Limit  the  number  of   recipients   per   message
+              The   default   limit    is    taken    from    the
 
 
 
@@ -203,16 +203,21 @@ PIPE(8)                                                   PIPE(8)
 PIPE(8)                                                   PIPE(8)
 
 
-              delivery, for delivery via the named <i>transport</i>. The
-              default limit is taken  from  the  <b>default</b><i>_</i><b>destina-</b>
-              <b>tion</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>   parameter.    The  limit  is
+              <b>default</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>    parameter.
+              The limit is enforced by the Postfix queue manager.
+
+       <i>transport_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
+              Limit  the  number of recipients per message deliv-
+              ery, for delivery  via  the  named  <i>transport</i>.  The
+              default  limit  is  taken from the <b>default</b><i>_</i><b>destina-</b>
+              <b>tion</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>  parameter.   The   limit   is
               enforced by the Postfix queue manager.
 
        <i>transport_</i><b>time</b><i>_</i><b>limit</b>
-              Limit the time for delivery  to  external  command,
-              for  delivery  via the named <b>transport</b>. The default
-              limit is taken from the <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b>  parame-
-              ter.   The  limit  is enforced by the Postfix queue
+              Limit  the  time  for delivery to external command,
+              for delivery via the named <b>transport</b>.  The  default
+              limit  is taken from the <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b> parame-
+              ter.  The limit is enforced by  the  Postfix  queue
               manager.
 
 <b>SEE</b> <b>ALSO</b>
@@ -222,7 +227,7 @@ PIPE(8)                                                   PIPE(8)
        syslogd(8) system logging
 
 <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>
@@ -249,11 +254,6 @@ PIPE(8)                                                   PIPE(8)
 
 
 
-
-
-
-
-
 
 
 
index ce35418fba43b77eb7eec18ada8c7247f40fcebc..d35330a2f104c41dddcf100d282e9eea20ea1c20 100644 (file)
@@ -216,9 +216,9 @@ result as another list of UCE restrictions.  The
 
 <a name="reject_maps_rbl">
 
-<dt> <b>reject_maps_rbl</b> <dd> Reject the request when the client
-network address is listed under any of the domains listed in <a
-href="#maps_rbl_domains">$maps_rbl_domains</a>. The <b>
+<dt> <b>reject_maps_rbl</b> <dd> Reject the request when the reversed
+client network address is listed under any of the domains listed
+in <a href="#maps_rbl_domains">$maps_rbl_domains</a>. The <b>
 maps_rbl_reject_code</b> parameter specifies the response code for
 rejected requests (default: <b>554</b>).
 
index 241b248d2e9eba30c4eaf42b1c475372821ff6d4..0f53c46a716bbd392c7d36d6db89fcd41a4eaf9e 100644 (file)
@@ -86,7 +86,7 @@ typedef struct LMTP_RESP {            /* server response */
     VSTRING *buf;                      /* origin of text */
 } LMTP_RESP;
 
-extern void lmtp_chat_cmd(LMTP_STATE *, char *,...);
+extern void PRINTFLIKE(2, 3) lmtp_chat_cmd(LMTP_STATE *, char *,...);
 extern LMTP_RESP *lmtp_chat_resp(LMTP_STATE *);
 extern void lmtp_chat_reset(LMTP_STATE *);
 extern void lmtp_chat_notify(LMTP_STATE *);
@@ -94,10 +94,10 @@ extern void lmtp_chat_notify(LMTP_STATE *);
  /*
   * lmtp_trouble.c
   */
-extern int lmtp_conn_fail(LMTP_STATE *, int, char *,...);
-extern int lmtp_site_fail(LMTP_STATE *, int, char *,...);
-extern int lmtp_mesg_fail(LMTP_STATE *, int, char *,...);
-extern void lmtp_rcpt_fail(LMTP_STATE *, int, RECIPIENT *, char *,...);
+extern int PRINTFLIKE(3, 4) lmtp_conn_fail(LMTP_STATE *, int, char *,...);
+extern int PRINTFLIKE(3, 4) lmtp_site_fail(LMTP_STATE *, int, char *,...);
+extern int PRINTFLIKE(3, 4) lmtp_mesg_fail(LMTP_STATE *, int, char *,...);
+extern void PRINTFLIKE(4, 5) lmtp_rcpt_fail(LMTP_STATE *, int, RECIPIENT *, char *,...);
 extern int lmtp_stream_except(LMTP_STATE *, int, char *);
 
  /*
index 59b3cd02879e2e6261cd2a214a39dd4226298aa8..65ce68a8c13df6904e98e7ffdba21e4a177065f9 100644 (file)
@@ -99,6 +99,9 @@ A command-line argument that contains \fB${\fBrecipient\fR}\fR
 expands into as many command-line arguments as there are recipients.
 .IP \fB${\fBsender\fR}\fR
 This macro expands to the envelope sender address.
+.IP \fB${\fBsize\fR}\fR
+This macro expands to Postfix's idea of the message size, which
+is an approximation of the size of the message as delivered.
 .IP \fB${\fBuser\fR}\fR
 This macro expands to the username part of a recipient address.
 For example, with an address \fIuser+foo@domain\fR the username
index 3872ee35f6e24db4a238589dce35842ede23d43d..a47db71fdeae84dca65cedf8191feb1a8555e6e6 100644 (file)
@@ -330,7 +330,7 @@ extern void qmgr_defer_recipient(QMGR_MESSAGE *, const char *, const char *);
  /*
   * qmgr_bounce.c
   */
-extern void qmgr_bounce_recipient(QMGR_MESSAGE *, QMGR_RCPT *, const char *,...);
+extern void PRINTFLIKE(3, 4) qmgr_bounce_recipient(QMGR_MESSAGE *, QMGR_RCPT *, const char *,...);
 
  /*
   * qmgr_deliver.c
index 78c11a200e9aa815c5507f5e4afd75b050bc1734..e85e328f149c486bf119d3332447c9522e02fc99 100644 (file)
@@ -91,6 +91,9 @@
 /*     expands into as many command-line arguments as there are recipients.
 /* .IP \fB${\fBsender\fR}\fR
 /*     This macro expands to the envelope sender address.
+/* .IP \fB${\fBsize\fR}\fR
+/*     This macro expands to Postfix's idea of the message size, which
+/*     is an approximation of the size of the message as delivered.
 /* .IP \fB${\fBuser\fR}\fR
 /*     This macro expands to the username part of a recipient address.
 /*     For example, with an address \fIuser+foo@domain\fR the username
 #define PIPE_DICT_USER         "user"  /* key */
 #define PIPE_DICT_EXTENSION    "extension"     /* key */
 #define PIPE_DICT_MAILBOX      "mailbox"       /* key */
+#define PIPE_DICT_SIZE         "size"  /* key */
 
  /*
   * Flags used to pass back the type of special parameter found by
 #define PIPE_FLAG_USER         (1<<1)
 #define PIPE_FLAG_EXTENSION    (1<<2)
 #define PIPE_FLAG_MAILBOX      (1<<3)
+#define PIPE_FLAG_SIZE         (1<<4)
 
  /*
   * Tunable parameters. Values are taken from the config file, after
@@ -284,13 +289,15 @@ static int parse_callback(int type, VSTRING *buf, char *context)
            *expand_flag |= PIPE_FLAG_EXTENSION;
        else if (strcmp(vstring_str(buf), PIPE_DICT_MAILBOX) == 0)
            *expand_flag |= PIPE_FLAG_MAILBOX;
+       else if (strcmp(vstring_str(buf), PIPE_DICT_SIZE) == 0)
+           *expand_flag |= PIPE_FLAG_SIZE;
     }
     return (0);
 }
 
 /* expand_argv - expand macros in the argument vector */
 
-static ARGV *expand_argv(char **argv, RECIPIENT_LIST *rcpt_list)
+static ARGV *expand_argv(char **argv, RECIPIENT_LIST *rcpt_list, long data_size)
 {
     VSTRING *buf = vstring_alloc(100);
     ARGV   *result;
@@ -387,6 +394,18 @@ static ARGV *expand_argv(char **argv, RECIPIENT_LIST *rcpt_list)
                    lowercase(STR(buf));
                    dict_update(PIPE_DICT_TABLE, PIPE_DICT_MAILBOX, STR(buf));
                }
+
+               /*
+                * This argument contains $size.
+                */
+               if (expand_flag & PIPE_FLAG_SIZE) {
+                   vstring_sprintf(buf, "%ld", data_size);
+                   dict_update(PIPE_DICT_TABLE, PIPE_DICT_SIZE, STR(buf));
+               }
+
+               /*
+                * Done.
+                */
                argv_add(result, dict_eval(PIPE_DICT_TABLE, *cpp, NO), ARGV_END);
            }
        }
@@ -670,7 +689,7 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
 
     dict_update(PIPE_DICT_TABLE, PIPE_DICT_SENDER, request->sender);
     dict_update(PIPE_DICT_TABLE, PIPE_DICT_NEXTHOP, request->nexthop);
-    expanded_argv = expand_argv(attr.command, rcpt_list);
+    expanded_argv = expand_argv(attr.command, rcpt_list, request->data_size);
 
     command_status = pipe_command(request->fp, why,
                                  PIPE_CMD_UID, attr.uid,
index 44e6b4fb38fad4abff79a66f8c3acde9ebeaf6d5..45ceac8e99bcd50f03911fde770985d075d7fce9 100644 (file)
@@ -258,7 +258,7 @@ extern void qmgr_defer_recipient(QMGR_MESSAGE *, const char *, const char *);
  /*
   * qmgr_bounce.c
   */
-extern void qmgr_bounce_recipient(QMGR_MESSAGE *, QMGR_RCPT *, const char *,...);
+extern void PRINTFLIKE(3, 4) qmgr_bounce_recipient(QMGR_MESSAGE *, QMGR_RCPT *, const char *,...);
 
  /*
   * qmgr_deliver.c
index d734948713d3e7a6296999feafd63fd8bd8b3436..6643944e7b695617ebf25d94b1926afb02027ef0 100644 (file)
@@ -103,7 +103,7 @@ typedef struct SMTP_RESP {          /* server response */
     VSTRING *buf;                      /* origin of text */
 } SMTP_RESP;
 
-extern void smtp_chat_cmd(SMTP_STATE *, char *,...);
+extern void PRINTFLIKE(2, 3) smtp_chat_cmd(SMTP_STATE *, char *,...);
 extern SMTP_RESP *smtp_chat_resp(SMTP_STATE *);
 extern void smtp_chat_reset(SMTP_STATE *);
 extern void smtp_chat_notify(SMTP_STATE *);
@@ -111,10 +111,10 @@ extern void smtp_chat_notify(SMTP_STATE *);
  /*
   * smtp_trouble.c
   */
-extern int smtp_conn_fail(SMTP_STATE *, int, char *,...);
-extern int smtp_site_fail(SMTP_STATE *, int, char *,...);
-extern int smtp_mesg_fail(SMTP_STATE *, int, char *,...);
-extern void smtp_rcpt_fail(SMTP_STATE *, int, RECIPIENT *, char *,...);
+extern int PRINTFLIKE(3, 4) smtp_conn_fail(SMTP_STATE *, int, char *,...);
+extern int PRINTFLIKE(3, 4) smtp_site_fail(SMTP_STATE *, int, char *,...);
+extern int PRINTFLIKE(3, 4) smtp_mesg_fail(SMTP_STATE *, int, char *,...);
+extern void PRINTFLIKE(4, 5) smtp_rcpt_fail(SMTP_STATE *, int, RECIPIENT *, char *,...);
 extern int smtp_stream_except(SMTP_STATE *, int, char *);
 
  /*
index a5638b4d799a5c10b3ae7884b031101d91213254..a2dab070d03df61d807809801b90a1952193814a 100644 (file)
@@ -14,7 +14,7 @@
   */
 extern void smtpd_chat_reset(SMTPD_STATE *);
 extern void smtpd_chat_query(SMTPD_STATE *);
-extern void smtpd_chat_reply(SMTPD_STATE *, char *, ...);
+extern void PRINTFLIKE(2, 3) smtpd_chat_reply(SMTPD_STATE *, char *, ...);
 extern void smtpd_chat_notify(SMTPD_STATE *);
 
 /* LICENSE
index 03e2ee4fe26576bc878f33cadd47d19a9e121768..e5089b46560b874687f03f91cf12ae38a9481aaa 100644 (file)
@@ -82,7 +82,7 @@
 /*     Look up the resolved recipient address in the named access table,
 /*     any parent domains of the recipient domain, and the localpart@.
 /* .IP reject_maps_rbl
-/*     Look up the client network address in the real-time blackhole
+/*     Look up the reversed client network address in the real-time blackhole
 /*     DNS zones below the domains listed in the "maps_rbl_domains"
 /*     configuration parameter. The \fImaps_rbl_reject_code\fR
 /*     configuration parameter specifies the reject status code
index c0a48c3941122e0c3c8ac7eebc94e5da2a5d7dbb..89023fd456f2b6c8d6af93d4f386a6e9ca43c4a8 100644 (file)
@@ -73,7 +73,7 @@ LIB   = libutil.a
 TESTPROG= dict_open dup2_pass_on_exec events exec_command fifo_open \
        fifo_rdonly_bug fifo_rdwr_bug fifo_trigger fsspace fullname \
        inet_addr_host inet_addr_local mac_parse make_dirs msg_syslog \
-       mystrtok peer_name sigdelay translit valid_hostname vstream_popen \
+       mystrtok sigdelay translit valid_hostname vstream_popen \
        vstring vstring_vstream doze select_bug stream_test mac_expand \
        watchdog unescape
 
@@ -229,11 +229,6 @@ fifo_trigger: $(LIB)
        $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
        mv junk $@.o
 
-peer_name: $(LIB)
-       mv $@.o junk
-       $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
-       mv junk $@.o
-
 doze: $(LIB)
        mv $@.o junk
        $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS)
diff --git a/postfix/util/dup2_pass_on_exec.c b/postfix/util/dup2_pass_on_exec.c
new file mode 100644 (file)
index 0000000..54bca23
--- /dev/null
@@ -0,0 +1,60 @@
+/*++
+/* NAME
+/*     dup2_pass_on_exec 1
+/* SUMMARY
+/*     dup2 close-on-exec behaviour test program
+/* SYNOPSIS
+/*     dup2_pass_on_exec
+/* DESCRIPTION
+/*     dup2_pass_on_exec sets the close-on-exec flag on its
+/*     standard input and then dup2() to duplicate it.
+/*     Posix-1003.1 specifies in section 6.2.1.2 that dup2(o,n) should behave
+/*     as: close(n); n = fcntl(o, F_DUPFD, n); as long as o is a valid
+/*     file-descriptor, n!=o, and 0<=n<=[OPEN_MAX].
+/*     Section 6.5.2.2 states that the close-on-exec flag of the result of a
+/*     successful fcntl(o, F_DUPFD, n) is cleared.
+/*
+/*     At least Ultrix4.3a does not clear the close-on-exec flag of n on
+/*     dup2(o, n).
+/* DIAGNOSTICS
+/*     Problems are reported to the standard error stream.
+/* LICENSE
+/* .ad
+/* .fi
+/*     The Secure Mailer license must be distributed with this software.
+/* AUTHOR(S)
+/*     Christian von Roques <roques@pond.sub.org>
+/*     Forststrasse 71
+/*     76131 Karlsruhe, GERMANY
+/*--*/
+
+#include <stdio.h>
+#include <fcntl.h>
+
+#define DO(s)  if (s < 0) { perror(#s); exit(1); }
+
+int     main(int unused_argc, char **unused_argv)
+{
+    int     res;
+
+    printf("Setting the close-on-exec flag of file-descriptor 0.\n");
+    DO(fcntl(0, F_SETFD, 1));
+
+    printf("Duplicating file-descriptor 0 to 3.\n");
+    DO(dup2(0, 3));
+
+    printf("Testing if the close-on-exec flag of file-descriptor 3 is set.\n");
+    DO((res = fcntl(3, F_GETFD, 0)));
+    if (res & 1)
+       printf("Yes, a newly dup2()ed file-descriptor has the close-on-exec "
+              "flag cloned.\n"
+              "THIS VIOLATES Posix1003.1 section 6.2.1.2 or 6.5.2.2!\n"
+              "You should #define DUP2_DUPS_CLOSE_ON_EXEC in sys_defs.h "
+              "for your OS.\n");
+    else
+       printf("No, a newly dup2()ed file-descriptor has the close-on-exec "
+              "flag cleared.\n"
+          "This complies with Posix1003.1 section 6.2.1.2 and 6.5.2.2!\n");
+
+    return 0;
+}
index dc61e97c0c556f4ecb026584d60201c5c43c2db3..a3921e280954ece3c98cf27512d3c68a404a9753 100644 (file)
@@ -588,7 +588,7 @@ static void dingdong(char *context)
     printf("%c", *context);
     fflush(stdout);
     *context = (ISUPPER(*context) ? TOLOWER(*context) : TOUPPER(*context));
-    event_request_timer(dingdong, context, DELAY);
+    event_request_timer(dingdong, context, (char *) DELAY);
 }
 
 /* echo - echo text received on stdin */
@@ -608,7 +608,7 @@ main(void)
     char   *cp;
 
     for (cp = text; *cp; cp++)
-       event_request_timer(dingdong, cp, 0);
+       event_request_timer(dingdong, cp, (char *) 0);
     event_enable_read(fileno(stdin), echo, (char *) 0);
     for (;;)
        event_loop(-1);
index 5fe5e94577e616f801b27dfe42f8e19c666479ad..1ca68af132fac69832c1c2267d50e28f47133115 100644 (file)
@@ -78,8 +78,12 @@ int     make_dirs(const char *path, int perms)
                ret = -1;
                break;
            }
-       } else if (errno != ENOENT || (ret = mkdir(saved_path, perms)) < 0)
-           break;
+       } else {
+           if (errno != ENOENT)
+               break;
+           if ((ret = mkdir(saved_path, perms)) < 0 && errno != EEXIST)
+               break;
+       }
        if (saved_ch != 0)
            *cp = saved_ch;
        SKIP_WHILE(*cp == '/', cp);
index 2b62dec5e3a3a8da245ff196375fb1b9c3bc149f..fae8a2327c9689534d7817c69d5875390ff6d283 100644 (file)
@@ -18,11 +18,11 @@ typedef void (*MSG_CLEANUP_FN) (void);
 
 extern int msg_verbose;
 
-extern void msg_info(const char *,...);
-extern void msg_warn(const char *,...);
-extern void msg_error(const char *,...);
-extern NORETURN msg_fatal(const char *,...);
-extern NORETURN msg_panic(const char *,...);
+extern void PRINTFLIKE(1, 2) msg_info(const char *,...);
+extern void PRINTFLIKE(1, 2) msg_warn(const char *,...);
+extern void PRINTFLIKE(1, 2) msg_error(const char *,...);
+extern NORETURN PRINTFLIKE(1, 2) msg_fatal(const char *,...);
+extern NORETURN PRINTFLIKE(1, 2) msg_panic(const char *,...);
 
 extern int msg_error_limit(int);
 extern void msg_error_clear(void);
index b409e95183b8bce0027a6b33b4685e2fa6b48333..2ac4739e052fd06140baf30a48add16b41329c40 100644 (file)
@@ -21,7 +21,7 @@
   */
 typedef void (*MSG_OUTPUT_FN) (int, const char *);
 extern void msg_output(MSG_OUTPUT_FN);
-extern void msg_printf(int, const char *,...);
+extern void PRINTFLIKE(2, 3) msg_printf(int, const char *,...);
 extern void msg_vprintf(int, const char *, va_list);
 extern void msg_text(int, const char *);
 
index 115b21d06d0f470a7016f86d9c168e61f67d2424..2a4f73abad88c7ce3ae97c54b112089ef648bf07 100644 (file)
@@ -812,6 +812,29 @@ typedef int pid_t;
 
 #ifndef NORETURN
 #define NORETURN       void
+#endif
+
+ /*
+  * Turn on format string argument checking. This is more accurate than
+  * printfck, but it misses #ifdef-ed code. XXX I am just guessing at what
+  * gcc versions support this. In order to turn this off for some platforms,
+  * specify #define PRINTFLIKE and #define SCANFLIKE in the system-dependent
+  * sections above.
+  */
+#ifndef PRINTFLIKE
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+#define PRINTFLIKE(x,y) __attribute__ ((format (printf, (x), (y))))
+#else
+#define PRINTFLIKE
+#endif
+#endif
+
+#ifndef SCANFLIKE
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+#define SCANFLIKE(x,y) __attribute__ ((format (scanf, (x), (y))))
+#else
+#define SCANFLIKE
+#endif
 #endif
 
  /*
index 4ae0b5f04f4221fd23cadace84fb8e47522dd90e..66f926a23488bb72174049054db75b2a4813f3e7 100644 (file)
@@ -111,8 +111,8 @@ extern void vstream_control(VSTREAM *, int,...);
 #define VSTREAM_CTL_EXCEPT     9
 #define VSTREAM_CTL_CONTEXT    10
 
-extern VSTREAM *vstream_printf(const char *,...);
-extern VSTREAM *vstream_fprintf(VSTREAM *, const char *,...);
+extern VSTREAM *PRINTFLIKE(1, 2) vstream_printf(const char *,...);
+extern VSTREAM *PRINTFLIKE(2, 3) vstream_fprintf(VSTREAM *, const char *,...);
 
 extern VSTREAM *vstream_popen(const char *, int);
 extern VSTREAM *vstream_popen_vargs(int,...);
index c1c9eb966ebdaf68bbe3e06fef9f464daeed2a07..6ae8947e78414d20683fa74e643942aa4dcefdf0 100644 (file)
@@ -38,8 +38,8 @@ extern VSTRING *vstring_strcpy(VSTRING *, const char *);
 extern VSTRING *vstring_strncpy(VSTRING *, const char *, int);
 extern VSTRING *vstring_strcat(VSTRING *, const char *);
 extern VSTRING *vstring_strncat(VSTRING *, const char *, int);
-extern VSTRING *vstring_sprintf(VSTRING *, const char *,...);
-extern VSTRING *vstring_sprintf_append(VSTRING *, const char *,...);
+extern VSTRING *PRINTFLIKE(2, 3) vstring_sprintf(VSTRING *, const char *,...);
+extern VSTRING *PRINTFLIKE(2, 3) vstring_sprintf_append(VSTRING *, const char *,...);
 extern char *vstring_export(VSTRING *);
 extern VSTRING *vstring_import(char *);
 
index e712c24e41e91de8816432a303fcfd43b78be6b3..da2ac106371c1b162f98d02569fd37481b12b2a3 100644 (file)
@@ -77,6 +77,7 @@
 #include <sys_defs.h>
 #include <unistd.h>
 #include <signal.h>
+#include <posix_signals.h>
 
 /* Utility library. */