Postfix Release 20010228 Patchlevel 01 includes patches that were sent to the list in the last month, some portability enhancements, and updated documentation. The patch is too large to distribute via email. A patched version of the source code will be made available from the sites listed on the www.postfix.org web site. The primary distribution site is: ftp://ftp.porcupine.org/mirrors/postfix-release/ postfix-20010228-patch01.gz Source patch postfix-20010228-pl01.tar.sig Source code postfix-20010228-pl01.tar.gz.sig PGP signature Details of the patch can be found in the extracts from the RELEASE_NOTES and HISTORY files below the signature. Wietse RELEASE_NOTES extract: ====================== This release changes the names of the "fast ETRN" logfiles with delayed mail per destination. These files are maintained by the Postfix "fast flush" daemon. The old scheme failed with addresses of the form user@[ip.address] and user@a.domain.name. In order to populate the new "fast ETRN" logfiles, execute the command "sendmail -q". The old "fast ETRN" logfiles go away by themselves (default: after 7 days). HISTORY file extract: ===================== 20010313 Bugfix: the RFC 822 untokenizer quoted newlines inside comments. File: global/tok822_parse.c. 20010316 Cleanup: removed an extraneous warning when a queue file write error happened. 20010321 Workaround: LMTP connection caching never worked for destinations starting with unix: or inet:. File: lmtp/lmtp_connect.c. 20010322 Portability: Solaris <2.6 does not have srandom() and random() in libc. File: util/rand_sleep.c. It does not have to be cryptographically strong. Bugfix: the fast ETRN flush server could not handle [ipaddr] or domain names with one-character hostname part. This fix changes the destination to logfile name mapping, so that you need to populate the new files with "sendmail -q". The old files go away automatically. File: flush/flush.c. 20010327 Speed up mailq (sendmail -bp) display by flushing output after each file. File: showq/showq.c. Portability: missing string.h includes, %p wants (void *), Lamont Jones, HP. 20010328 Bugfix: swapped logic caused cleanup to stall when the queue file size exceeded the file size limit by less than one the VSTREAM buffer size, so that the "file too big" was detected after flushing the last queue file record. File: cleanup/cleanup.c. 20010329 Portability: workaround for missing prototype problem in dict_ldap.c. This module should move to the global directory, because it depends on Postfix main.cf parameter information. Prereq: "Release-20010228" diff -cr ../release-20010228/src/global/mail_version.h ./src/global/mail_version.h *** ../release-20010228/src/global/mail_version.h Wed Feb 28 14:13:32 2001 --- ./src/global/mail_version.h Thu Mar 29 19:39:46 2001 *************** *** 15,21 **** * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Release-20010228" extern char *var_mail_version; /* LICENSE --- 15,21 ---- * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-20010228-pl01" extern char *var_mail_version; /* LICENSE diff -cr ../release-20010228/FILTER_README ./FILTER_README *** ../release-20010228/FILTER_README Wed Feb 28 11:06:40 2001 --- ./FILTER_README Thu Mar 1 09:40:21 2001 *************** *** 128,136 **** you create no temporary files. Each temporary file adds another factor to the performance loss. ! We will set up a content filtering program listening on localhost ! port 10025 that receives mail via the SMTP protocol, and that ! submits mail back into Postfix via localhost port 10026. .................................. : Postfix : --- 128,136 ---- you create no temporary files. Each temporary file adds another factor to the performance loss. ! We will set up a content filtering program that receives SMTP mail ! via localhost port 10025, and that submits SMTP mail back into ! Postfix via localhost port 10026. .................................. : Postfix : *************** *** 162,168 **** smtpd and pickup servers. When a queue file has content filtering information, the queue ! manager will deliver the mail to the specified content filtering regardless of its final destination. The content filter can be set up with the Postfix spawn service, --- 162,168 ---- smtpd and pickup servers. When a queue file has content filtering information, the queue ! manager will deliver the mail to the specified content filter regardless of its final destination. The content filter can be set up with the Postfix spawn service, *************** *** 182,187 **** --- 182,190 ---- you want to have your filter listening on port localhost:10025 instead of Postfix, then you must run your filter as a stand-alone program. + + Note: the localhost port 10025 SMTP server filter should announce + itself as "220 localhost...", to silence warnings in the log. The /some/where/filter command is most likely a PERL script. PERL has modules that make talking SMTP easy. The command-line specifies diff -cr ../release-20010228/HISTORY ./HISTORY *** ../release-20010228/HISTORY Wed Feb 28 11:16:24 2001 --- ./HISTORY Thu Mar 29 12:36:25 2001 *************** *** 4919,4921 **** --- 4919,4971 ---- Code cleanup: some queue/transport operations need to be moved, after the code cleanup of the recipient/concurrency limit handling. Patrik Rak. Files: *qmgr/qmgr_message.c. + + 20010313 + + Bugfix: the RFC 822 untokenizer quoted newlines inside + comments. File: global/tok822_parse.c. + + 20010316 + + Cleanup: removed an extraneous warning when a queue file + write error happened. + + 20010321 + + Workaround: LMTP connection caching never worked for + destinations starting with unix: or inet:. File: + lmtp/lmtp_connect.c. + + 20010322 + + Portability: Solaris <2.6 does not have srandom() and + random() in libc. File: util/rand_sleep.c. It does not have + to be cryptographically strong. + + Bugfix: the fast ETRN flush server could not handle [ipaddr] + or domain names with one-character hostname part. This + fix changes the destination to logfile name mapping, so + that you need to populate the new files with "sendmail -q". + The old files go away automatically. File: flush/flush.c. + + 20010327 + + Speed up mailq (sendmail -bp) display by flushing output + after each file. File: showq/showq.c. + + Portability: missing string.h includes, %p wants (void *), + Lamont Jones, HP. + + 20010328 + + Bugfix: swapped logic caused cleanup to stall when the + queue file size exceeded the file size limit by less than + one the VSTREAM buffer size, so that the "file too big" + was detected after flushing the last queue file record. + File: cleanup/cleanup.c. + + 20010329 + + Portability: workaround for missing prototype problem in + dict_ldap.c. This module should move to the global directory, + because it depends on Postfix main.cf parameter information. diff -cr ../release-20010228/INSTALL ./INSTALL *** ../release-20010228/INSTALL Fri Feb 23 11:08:09 2001 --- ./INSTALL Thu Mar 29 14:54:01 2001 *************** *** 249,254 **** --- 249,259 ---- and watch your syslog file for any error messages. + % egrep '(reject|warning|error|fatal|panic):' /some/log/file + + Typical logfile names are: /var/log/maillog or /var/log/syslog. + See /etc/syslog.conf for actual logfile names. + When it is run for the first time, the Postfix startup shell script will create a bunch of subdirectories below the Postfix spool directory. *************** *** 290,295 **** --- 295,305 ---- and watch your syslog file for any error messages. + % egrep '(reject|warning|error|fatal|panic):' /some/log/file + + Typical logfile names are: /var/log/maillog or /var/log/syslog. + See /etc/syslog.conf for actual logfile names. + When it is run for the first time, the Postfix startup shell script will create a bunch of subdirectories below the Postfix spool directory. *************** *** 323,328 **** --- 333,343 ---- and watch the syslog file for any complaints from the mail system. + % egrep '(reject|warning|error|fatal|panic):' /some/log/file + + Typical logfile names are: /var/log/maillog or /var/log/syslog. + See /etc/syslog.conf for actual logfile names. + When it is run for the first time, the Postfix startup shell script will create a bunch of subdirectories below the Postfix spool directory. *************** *** 508,513 **** --- 523,534 ---- # postfix check # egrep '(reject|warning|error|fatal|panic):' /some/log/file + + Typical logfile names are: /var/log/maillog or /var/log/syslog. + See /etc/syslog.conf for actual logfile names. + + The first line (postfix check) causes Postfix to report file + permission/ownership discrepancies. The second line looks for problem reports from the mail software, and reports how effective the anti-relay and anti-UCE blocks are. diff -cr ../release-20010228/MYSQL_README ./MYSQL_README *** ../release-20010228/MYSQL_README Sun Dec 17 16:28:51 2000 --- ./MYSQL_README Thu Mar 29 13:57:38 2001 *************** *** 3,9 **** We've written code to add a mysql map type. It utilizes the mysql client library, which can be obtained from: ! http://www.tcx.se/download.html In order to build postfix with mysql map support, you will need to add -DHAS_MYSQL and -I for the directory containing the mysql headers, and --- 3,10 ---- We've written code to add a mysql map type. It utilizes the mysql client library, which can be obtained from: ! http://www.mysql.com/downloads/ ! http://sourceforge.net/projects/mysql/ In order to build postfix with mysql map support, you will need to add -DHAS_MYSQL and -I for the directory containing the mysql headers, and diff -cr ../release-20010228/RELEASE_NOTES ./RELEASE_NOTES *** ../release-20010228/RELEASE_NOTES Wed Feb 28 14:54:00 2001 --- ./RELEASE_NOTES Thu Mar 29 14:57:03 2001 *************** *** 1,16 **** ! This is the first official Postfix release that is not called BETA. ! May it help the people who cannot get BETA software past their ! management. ! ! Release 20010228 differs from snapshot 20010228 in that the virtual ! delivery agent and nqmgr queue manager are left out. That software ! will become part of the official release when it has not changed ! in a while. In the text below, incompatible changes are labeled with the Postfix version that introduced the change. If you upgrade from a later Postfix version, then you do not have to worry about that particular incompatibility. Major incompatible changes with release-20010228 ================================================ --- 1,22 ---- ! Release 20010228 is the first official Postfix release that is not ! called BETA. May it help the people who cannot get BETA software ! past their management. In the text below, incompatible changes are labeled with the Postfix version that introduced the change. If you upgrade from a later Postfix version, then you do not have to worry about that particular incompatibility. + + Major incompatible changes with release-20010228 Patch 01 + ========================================================= + + This release changes the names of the "fast ETRN" logfiles with + delayed mail per destination. These files are maintained by the + Postfix "fast flush" daemon. The old scheme failed with addresses + of the form user@[ip.address] and user@a.domain.name. In order to + populate the new "fast ETRN" logfiles, execute the command "sendmail + -q". The old "fast ETRN" logfiles go away by themselves (default: + after 7 days). Major incompatible changes with release-20010228 ================================================ diff -cr ../release-20010228/SASL_README ./SASL_README *** ../release-20010228/SASL_README Sat Jan 27 16:39:48 2001 --- ./SASL_README Wed Mar 28 20:07:24 2001 *************** *** 111,117 **** permit_mynetworks permit_sasl_authenticated ... In /usr/local/lib/sasl/smtpd.conf you need to specify how the server ! should validate client passwords. For example: /usr/local/lib/sasl/smtpd.conf: pwcheck_method: sasldb --- 111,126 ---- permit_mynetworks permit_sasl_authenticated ... In /usr/local/lib/sasl/smtpd.conf you need to specify how the server ! should validate client passwords. ! ! In order to authenticate against the UNIX password database, try: ! ! /usr/local/lib/sasl/smtpd.conf: ! pwcheck_method: pwcheck ! ! The pwcheck daemon is contained in the cyrus-sasl source tarball. ! ! In order to authenticate against SASL's own password database: /usr/local/lib/sasl/smtpd.conf: pwcheck_method: sasldb *************** *** 129,148 **** EXAMPLE: saslpasswd -c -u `postconf -h myhostname` exampleuser ! Instead of the SASL-specific password file you can configure the ! Postfix SMTP server to validate client passwords against the UNIX ! shadow password file: ! ! /usr/local/lib/sasl/smtpd.conf: ! pwcheck_method: shadow ! ! However this requires that Postfix has read access to the UNIX shadow ! password file, which is normally readable only by root. Shadow ! password support has been found to work for Solaris 2.7 and RedHat ! 6.1 but not with FreeBSD 3.4. ! To run software chrooted with SASL support is an interesting exercise. ! This is one of the many problems with the present SASL support. To test the whole mess, connect to the SMTP server, and you should be able to have a conversation like this: --- 138,148 ---- EXAMPLE: saslpasswd -c -u `postconf -h myhostname` exampleuser ! To run software chrooted with SASL support is an interesting ! exercise. It probably is not worth the trouble. ! Testing SASL authentication in the Postfix SMTP server ! ====================================================== To test the whole mess, connect to the SMTP server, and you should be able to have a conversation like this: diff -cr ../release-20010228/conf/access ./conf/access *** ../release-20010228/conf/access Tue Jan 23 19:09:09 2001 --- ./conf/access Wed Mar 28 20:07:11 2001 *************** *** 76,82 **** # octets separated by ".". # # ACTIONS ! # [45]XX text # Reject the address etc. that matches the pattern, # and respond with the numerical code and text. # --- 76,82 ---- # octets separated by ".". # # ACTIONS ! # [45]NN text # Reject the address etc. that matches the pattern, # and respond with the numerical code and text. # *************** *** 86,92 **** # OK Accept the address etc. that matches the pattern. # # restriction... ! # Apply the named UCE restriction (permit, reject, # reject_unauth_destination, and so on). # # REGULAR EXPRESSION TABLES --- 86,92 ---- # OK Accept the address etc. that matches the pattern. # # restriction... ! # Apply the named UCE restriction(s) (permit, reject, # reject_unauth_destination, and so on). # # REGULAR EXPRESSION TABLES diff -cr ../release-20010228/conf/main.cf ./conf/main.cf *** ../release-20010228/conf/main.cf Wed Feb 28 10:31:37 2001 --- ./conf/main.cf Wed Mar 28 20:08:11 2001 *************** *** 226,239 **** # $inet_interfaces. If this parameter is defined, then the SMTP server # will reject mail for unknown local users. # ! # The local_recipient_maps parameter accepts tables with bare usernames ! # such as unix:passwd.byname and alias maps. # # Beware: if the Postfix SMTP server runs chrooted, you may have to ! # copy the passwd database into the jail. This is system dependent. ! # ! # FOR THIS TO WORK, DO NOT SPECIFY VIRTUAL DOMAINS IN MYDESTINATION. ! # MYDESTINATION MUST LIST NON-VIRTUAL DOMAINS ONLY. # #local_recipient_maps = $alias_maps unix:passwd.byname --- 226,237 ---- # $inet_interfaces. If this parameter is defined, then the SMTP server # will reject mail for unknown local users. # ! # If you use the default Postfix local delivery agent for local ! # delivery, uncomment the definition below. # # Beware: if the Postfix SMTP server runs chrooted, you may have to ! # copy the passwd (not shadow) database into the jail. This is ! # system dependent. # #local_recipient_maps = $alias_maps unix:passwd.byname diff -cr ../release-20010228/conf/sample-compatibility.cf ./conf/sample-compatibility.cf *** ../release-20010228/conf/sample-compatibility.cf Thu Jan 18 20:44:44 2001 --- ./conf/sample-compatibility.cf Wed Mar 28 20:09:00 2001 *************** *** 4,9 **** --- 4,19 ---- # This file contains example settings of Postfix configuration # parameters that control compatibility with broken software. + # The broken_sasl_auth_clients controls inter-operability with SMTP + # clients that do not recognize that Postfix supports RFC 2554 (AUTH + # command). Examples of such clients are MicroSoft Outlook Express + # version 4 and MicroSoft Exchange version 5.0. + # + # Specify broken_sasl_auth_clients=yes to have Postfix advertise + # AUTH support in a non-standard way. + # + broken_sasl_auth_clients = no + # The ignore_mx_lookup_error parameter controls what happens when a # name server fails to respond to an MX lookup request. By default, # Postfix defers delivery and tries again after some delay. Specify diff -cr ../release-20010228/examples/chroot-setup/HPUX10 ./examples/chroot-setup/HPUX10 *** ../release-20010228/examples/chroot-setup/HPUX10 Tue Nov 17 14:02:49 1998 --- ./examples/chroot-setup/HPUX10 Wed Mar 28 20:09:26 2001 *************** *** 19,21 **** --- 19,23 ---- mkdir etc cp /etc/services etc + mkdir -p usr/lib + cp /usr/lib/tztab usr/lib diff -cr ../release-20010228/html/access.5.html ./html/access.5.html *** ../release-20010228/html/access.5.html Wed Jan 24 20:52:59 2001 --- ./html/access.5.html Wed Mar 28 20:09:54 2001 *************** *** 87,93 **** octets separated by ".". ACTIONS ! [45]XX text Reject the address etc. that matches the pattern, and respond with the numerical code and text. --- 87,93 ---- octets separated by ".". ACTIONS ! [45]NN text Reject the address etc. that matches the pattern, and respond with the numerical code and text. *************** *** 97,103 **** OK Accept the address etc. that matches the pattern. restriction... ! Apply the named UCE restriction (permit, reject, reject_unauth_destination, and so on). REGULAR EXPRESSION TABLES --- 97,103 ---- OK Accept the address etc. that matches the pattern. restriction... ! Apply the named UCE restriction(s) (permit, reject, reject_unauth_destination, and so on). REGULAR EXPRESSION TABLES diff -cr ../release-20010228/html/faq.html ./html/faq.html *** ../release-20010228/html/faq.html Tue Feb 27 16:57:30 2001 --- ./html/faq.html Wed Mar 28 19:56:00 2001 *************** *** 24,29 **** --- 24,31 ----
  • POP or IMAP problems +
  • Problems with specific Operating Systems +
  • Postfix warnings and error messages
  • Example configurations *************** *** 74,81 **** --- 76,93 ----
  • What does "fatal: open database /etc/aliases.db" mean? +
  • What does "fatal: unknown service: smtp/tcp" mean? +
  • sendmail has set-uid root file permissions, or is run from a set-uid root process +
  • sendmail: unable to find out your login name + + +
  • Mail for unknown users in + virtual domains fails with "mail loops back to myself" + +
  • Postfix refuses mail for virtual + domains with "relay access denied"

    *************** *** 186,191 **** --- 198,205 ----

  • Postfix does not try all the MX addresses +
  • What does "fatal: unknown service: smtp/tcp" mean? +

    Local (non-virtual) delivery

    *************** *** 311,316 **** --- 325,360 ---- +

    + +

    Problems with specific Operating Systems

    + +

    + +

    + +

    Problems with Compaq

    + +
    + +

    Problems with IRIX

    + +
    +

    POP or IMAP problems

    *************** *** 970,975 **** --- 1014,1043 ----
    +

    sendmail: unable to find out your login name

    + + This message is logged when submitting mail from a process with a + userid that does not exist in the UNIX password file. Postfix uses + this information in order to set the envelope sender address. + +

    + + The envelope sender address is also the default value for the From: + header address, when none is specified in the message. + +

    + + To fix, specify the envelope sender address on the sendmail command + line: + +

    +
    + sendmail -f user@domain ...
    + 
    +
    + +
    +

    Running hundreds of Postfix processes on FreeBSD

    With hundreds of Postfix processes, the kernel will eventually *************** *** 1112,1143 ****

    Postfix responds slowly to incoming SMTP connections

    !
    !
    Question: !
    My Postfix server is too slow. When I telnet to the SMTP port (telnet hostname 25), the response comes after 40 seconds. On the other hand, when I telnet to the the POP port (telnet hostname 110) the response comes with no delay.

    !

    Answer: !
    ! This is a DNS configuration problem. Postfix tries to resolve the ! SMTP client IP address to a hostname. Apparently, your POP server ! does not look up POP clients.

    ! The fix is to properly configure the naming service. If you can't ! have every host in the DNS, then configure the mail server to look ! in /etc/hosts before the DNS, and specify the clients in /etc/hosts. !


    --- 1180,1220 ----

    Postfix responds slowly to incoming SMTP connections

    ! Question: !
    ! My Postfix server is too slow. When I telnet to the SMTP port (telnet hostname 25), the response comes after 40 seconds. On the other hand, when I telnet to the the POP port (telnet hostname 110) the response comes with no delay. +
    +

    ! Answer: !

    ! You have a name service problem.

    ! Postfix calls the C library routines gethostbyname() and ! gethostbyaddr() in order to find out the SMTP client hostname. ! These library routines use several system configuration files in ! order to satisfy the request. They may in fact end up calling the ! DNS for reasons that are not under control by Postfix. !

    ! ! Depending on your system, these controlling files can be named ! /etc/nsswitch.conf, /etc/svcorder, /etc/host.conf ! or otherwise. Those files specify whether the C library routines ! will use local /etc/hosts before or after DNS. ! !


    *************** *** 1733,1738 **** --- 1810,1844 ---- Execute the command postfix reload to make the change effective immediately. +

    What does "fatal: unknown service: smtp/tcp" + mean?

    + + The Postfix /etc/postfix/master.cf file specifies that the + Postfix SMTP client runs inside a chroot environment. However, + the files necessary for that mode of operation are not installed + below /var/spool/postfix. + +

    + + Enabling chroot operation adds a non-trivial barrier for + system penetrators. + +

    + + Two solutions: + +


    Root's mail is delivered to nobody

    *************** *** 2300,2305 **** --- 2406,2416 ----

    + Sendmail-style virtual domains are not supported in Postfix versions + released before 20001118. + +

    + Be sure to follow instructions in the virtual manual page. *************** *** 2906,2911 **** --- 3017,3052 ---- href="http://www.isc.org/"> http://www.isc.org/. + +


    + +

    Compaq mail blackhole problem

    + + On some Compaq Tru64 UNIX configurations, Postfix will receive mail + and then nothing happens. The mail does not even show up with the + mailq command. + +

    + + Postfix sets the execute bit on a queue file to indicate that it + is done receiving a message. As long as a queue file does not have + the execute bit set, Postfix will ignore it as "mail still being + received". + +

    + + With enhanced security enabled, Compaq Tru64 UNIX has a feature + that disallows non-superuser attempts to set the execute bit on a + queuefile. Unfortunately, Postfix is never informed that such + attempts fail, and mail seems to disappear into a black hole. + +

    + + Postfix could be modified to use some other bit than the execute + bit, but that might equally well fail on other systems. Another + possibility is to allow non-superusers to set the execute bit on + files, and to mount the Postfix queue file system with the + noexec option or equivalent.


    diff -cr ../release-20010228/html/pipe.8.html ./html/pipe.8.html *** ../release-20010228/html/pipe.8.html Thu Feb 22 14:15:00 2001 --- ./html/pipe.8.html Wed Mar 28 20:10:10 2001 *************** *** 13,23 **** DESCRIPTION The pipe daemon processes requests from the Postfix queue ! manager to deliver messages to external commands. Each ! delivery request specifies a queue file, a sender address, ! a domain or host to deliver to, and one or more recipi- ! ents. This program expects to be run from the
    master(8) ! process manager. The pipe daemon updates queue files and marks recipients as finished, or it informs the queue manager that delivery --- 13,21 ---- DESCRIPTION The pipe daemon processes requests from the Postfix queue ! manager to deliver messages to external commands. This ! program expects to be run from the master(8) process man- ! ager. The pipe daemon updates queue files and marks recipients as finished, or it informs the queue manager that delivery *************** *** 25,84 **** reports are sent to the bounce(8) or defer(8) daemon as appropriate. COMMAND ATTRIBUTE SYNTAX The external command attributes are given in the master.cf file at the end of a service definition. The syntax is as follows: flags=BFR.> (optional) ! Optional message processing flags. By default, a message is copied unchanged. ! B Append a blank line at the end of each mes- ! sage. This is required by some mail user ! agents that recognize "From " lines only when preceded by a blank line. ! F Prepend a "From sender time_stamp" envelope ! header to the message content. This is expected by, for example, UUCP software. ! R Prepend a Return-Path: message header with the envelope sender address. ! . Prepend . to lines starting with ".". This ! is needed by, for example, BSMTP software. - > Prepend > to lines starting with "From ". - This is expected by, for example, UUCP soft- - ware. - user=username (required) ! user=username:groupname ! The external command is executed with the rights of ! the specified username. The software refuses to ! execute commands with root privileges, or with the - 1 ! PIPE(8) PIPE(8) ! privileges of the mail system owner. If groupname ! is specified, the corresponding group ID is used instead of the group ID of username. eol=string (default: \n) ! The output record delimiter. Typically one would ! use either \r\n or \n. The usual C-style backslash ! escape sequences are recognized: \a \b \f \n \r \t \v \octal and \\. size=size_limit (optional) --- 23,96 ---- reports are sent to the bounce(8) or defer(8) daemon as appropriate. + SINGLE-RECIPIENT DELIVERY + Some external commands cannot handle more than one recipi- + ent per delivery request. Examples of such transports are + pagers, fax machines, and so on. + + To prevent Postfix from sending multiple recipients per + delivery request, specify + + transport_destination_recipient_limit = 1 + + in the Postfix main.cf file, where transport is the name + in the first column of the Postfix master.cf entry for the + pipe-based delivery transport. + COMMAND ATTRIBUTE SYNTAX The external command attributes are given in the master.cf file at the end of a service definition. The syntax is as follows: flags=BFR.> (optional) ! Optional message processing flags. By default, a message is copied unchanged. ! B Append a blank line at the end of each mes- ! sage. This is required by some mail user ! agents that recognize "From " lines only when preceded by a blank line. ! F Prepend a "From sender time_stamp" envelope ! header to the message content. This is expected by, for example, UUCP software. ! R Prepend a Return-Path: message header with the envelope sender address. ! . Prepend . to lines starting with ".". This ! 1 + PIPE(8) PIPE(8) + is needed by, for example, BSMTP software. ! > Prepend > to lines starting with "From ". ! This is expected by, for example, UUCP soft- ! ware. + user=username (required) ! user=username:groupname ! The external command is executed with the rights of ! the specified username. The software refuses to ! execute commands with root privileges, or with the ! privileges of the mail system owner. If groupname ! is specified, the corresponding group ID is used instead of the group ID of username. eol=string (default: \n) ! The output record delimiter. Typically one would ! use either \r\n or \n. The usual C-style backslash ! escape sequences are recognized: \a \b \f \n \r \t \v \octal and \\. size=size_limit (optional) *************** *** 86,130 **** will be bounced back to the sender. argv=command... (required) ! The command to be executed. This must be specified as the last command attribute. The command is exe- cuted directly, i.e. without interpretation of ! shell meta characters by a shell command inter- preter. In the command argument vector, the following macros are recognized and replaced with correspond- ! ing information from the Postfix queue manager delivery request: ${extension} ! This macro expands to the extension part of ! a recipient address. For example, with an address user+foo@domain the extension is ! foo. A command-line argument that contains ! ${extension} expands into as many command- line arguments as there are recipients. ${mailbox} ! This macro expands to the complete local ! part of a recipient address. For example, ! with an address user+foo@domain the mailbox ! is user+foo. A command-line argument that ! contains ${mailbox} expands into as many ! command-line arguments as there are recipi- ! ents. - ${nexthop} - This macro expands to the next-hop hostname. - - ${recipient} - This macro expands to the complete recipient - address. A command-line argument that con- - tains ${recipient} expands into as many com- - mand-line arguments as there are recipients. - - ${sender} - This macro expands to the envelope sender --- 98,130 ---- will be bounced back to the sender. argv=command... (required) ! The command to be executed. This must be specified as the last command attribute. The command is exe- cuted directly, i.e. without interpretation of ! shell meta characters by a shell command inter- preter. In the command argument vector, the following macros are recognized and replaced with correspond- ! ing information from the Postfix queue manager delivery request: ${extension} ! This macro expands to the extension part of ! a recipient address. For example, with an address user+foo@domain the extension is ! foo. ! ! A command-line argument that contains ! ${extension} expands into as many command- line arguments as there are recipients. ${mailbox} ! This macro expands to the complete local ! part of a recipient address. For example, ! with an address user+foo@domain the mailbox ! is user+foo. *************** *** 137,179 **** PIPE(8) PIPE(8) address. ${size} ! This macro expands to Postfix's idea of the ! message size, which is an approximation of the size of the message as delivered. ${user} This macro expands to the username part of a ! recipient address. For example, with an address user+foo@domain the username part is ! user. A command-line argument that contains ! ${user} expands into as many command-line arguments as there are recipients. ! In addition to the form ${name}, the forms $name and ! $(name) are also recognized. Specify $$ where a single $ is wanted. DIAGNOSTICS ! Command exit status codes are expected to follow the con- ventions defined in <sysexits.h>. ! Problems and transactions are logged to syslogd(8). Cor- ! rupted message files are marked so that the queue manager can move them to the corrupt queue for further inspection. SECURITY ! This program needs a dual personality 1) to access the ! private Postfix queue and IPC mechanisms, and 2) to exe- cute external commands as the specified user. It is there- fore security sensitive. CONFIGURATION PARAMETERS ! The following main.cf parameters are especially relevant ! to this program. See the Postfix main.cf file for syntax ! details and for default values. Use the postfix reload command after a configuration change. Miscellaneous --- 137,210 ---- PIPE(8) PIPE(8) + A command-line argument that contains + ${mailbox} expands into as many command-line + arguments as there are recipients. + + ${nexthop} + This macro expands to the next-hop hostname. + + ${recipient} + This macro expands to the complete recipient + address. + + A command-line argument that contains + ${recipient} expands into as many command- + line arguments as there are recipients. + + ${sender} + This macro expands to the envelope sender address. ${size} ! This macro expands to Postfix's idea of the ! message size, which is an approximation of the size of the message as delivered. ${user} This macro expands to the username part of a ! recipient address. For example, with an address user+foo@domain the username part is ! user. ! ! A command-line argument that contains ! ${user} expands into as many command-line arguments as there are recipients. ! In addition to the form ${name}, the forms $name and ! $(name) are also recognized. Specify $$ where a single $ is wanted. DIAGNOSTICS ! Command exit status codes are expected to follow the con- ventions defined in <sysexits.h>. ! Problems and transactions are logged to syslogd(8). Cor- ! rupted message files are marked so that the queue manager can move them to the corrupt queue for further inspection. SECURITY ! This program needs a dual personality 1) to access the ! private Postfix queue and IPC mechanisms, and 2) to exe- cute external commands as the specified user. It is there- fore security sensitive. CONFIGURATION PARAMETERS ! The following main.cf parameters are especially relevant ! ! ! ! 3 ! ! ! ! ! ! PIPE(8) PIPE(8) ! ! ! to this program. See the Postfix main.cf file for syntax ! details and for default values. Use the postfix reload command after a configuration change. Miscellaneous *************** *** 182,225 **** exported to non-Postfix processes. mail_owner ! The process privileges used while not running an external command. Resource controls ! In the text below, transport is the first field in a mas- ter.cf entry. transport_destination_concurrency_limit Limit the number of parallel deliveries to the same ! ! ! ! 3 ! ! ! ! ! ! PIPE(8) PIPE(8) ! ! ! destination, for delivery via the named transport. ! The default limit is taken from the default_desti- ! nation_concurrency_limit parameter. The limit is enforced by the Postfix queue manager. transport_destination_recipient_limit ! Limit the number of recipients per message deliv- ! ery, for delivery via the named transport. The ! default limit is taken from the default_destina- ! tion_recipient_limit parameter. The limit is enforced by the Postfix queue manager. transport_time_limit ! Limit the time for delivery to external command, ! for delivery via the named transport. The default ! limit is taken from the command_time_limit parame- ! ter. The limit is enforced by the Postfix queue manager. SEE ALSO --- 213,244 ---- exported to non-Postfix processes. mail_owner ! The process privileges used while not running an external command. Resource controls ! In the text below, transport is the first field in a mas- ter.cf entry. transport_destination_concurrency_limit Limit the number of parallel deliveries to the same ! destination, for delivery via the named transport. ! The default limit is taken from the default_desti- ! nation_concurrency_limit parameter. The limit is enforced by the Postfix queue manager. transport_destination_recipient_limit ! Limit the number of recipients per message deliv- ! ery, for delivery via the named transport. The ! default limit is taken from the default_destina- ! tion_recipient_limit parameter. The limit is enforced by the Postfix queue manager. transport_time_limit ! Limit the time for delivery to external command, ! for delivery via the named transport. The default ! limit is taken from the command_time_limit parame- ! ter. The limit is enforced by the Postfix queue manager. SEE ALSO *************** *** 229,235 **** syslogd(8) system logging LICENSE ! The Secure Mailer license must be distributed with this software. AUTHOR(S) --- 248,254 ---- syslogd(8) system logging LICENSE ! The Secure Mailer license must be distributed with this software. AUTHOR(S) *************** *** 237,261 **** IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA - - - - - - - - - - - - - - - - - - - --- 256,261 ---- diff -cr ../release-20010228/html/uce.html ./html/uce.html *** ../release-20010228/html/uce.html Sun Feb 25 18:09:31 2001 --- ./html/uce.html Wed Mar 28 20:47:49 2001 *************** *** 109,116 ****
    Syntax:
    Specify a list of zero or more lookup tables. Whenever a header ! matches a table, a REJECT result means reject the message, and a ! SKIP result means delete the header from the message.

    --- 109,116 ----

    Syntax:
    Specify a list of zero or more lookup tables. Whenever a header ! matches a table, a REJECT result means reject the message, and an ! IGNORE result means delete the header from the message.

    diff -cr ../release-20010228/man/man5/access.5 ./man/man5/access.5 *** ../release-20010228/man/man5/access.5 Wed Jan 24 20:52:54 2001 --- ./man/man5/access.5 Wed Mar 28 20:10:34 2001 *************** *** 69,75 **** .nf .ad .fi ! .IP "[\fB45\fR]\fIXX text\fR" Reject the address etc. that matches the pattern, and respond with the numerical code and text. .IP \fBREJECT\fR --- 69,75 ---- .nf .ad .fi ! .IP "[\fB45\fR]\fINN text\fR" Reject the address etc. that matches the pattern, and respond with the numerical code and text. .IP \fBREJECT\fR *************** *** 78,84 **** .IP \fBOK\fR Accept the address etc. that matches the pattern. .IP \fIrestriction...\fR ! Apply the named UCE restriction (\fBpermit\fR, \fRreject\fR, \fBreject_unauth_destination\fR, and so on). .SH REGULAR EXPRESSION TABLES .na --- 78,84 ---- .IP \fBOK\fR Accept the address etc. that matches the pattern. .IP \fIrestriction...\fR ! Apply the named UCE restriction(s) (\fBpermit\fR, \fRreject\fR, \fBreject_unauth_destination\fR, and so on). .SH REGULAR EXPRESSION TABLES .na diff -cr ../release-20010228/man/man8/pipe.8 ./man/man8/pipe.8 *** ../release-20010228/man/man8/pipe.8 Thu Feb 22 14:14:55 2001 --- ./man/man8/pipe.8 Wed Mar 28 20:10:48 2001 *************** *** 13,21 **** .ad .fi The \fBpipe\fR daemon processes requests from the Postfix queue ! manager to deliver messages to external commands. Each delivery ! request specifies a queue file, a sender address, a domain or host ! to deliver to, and one or more recipients. This program expects to be run from the \fBmaster\fR(8) process manager. --- 13,19 ---- .ad .fi The \fBpipe\fR daemon processes requests from the Postfix queue ! manager to deliver messages to external commands. This program expects to be run from the \fBmaster\fR(8) process manager. *************** *** 23,28 **** --- 21,44 ---- as finished, or it informs the queue manager that delivery should be tried again at a later time. Delivery problem reports are sent to the \fBbounce\fR(8) or \fBdefer\fR(8) daemon as appropriate. + .SH SINGLE-RECIPIENT DELIVERY + .na + .nf + .ad + .fi + Some external commands cannot handle more than one recipient + per delivery request. Examples of such transports are pagers, + fax machines, and so on. + + To prevent Postfix from sending multiple recipients per delivery + request, specify + + .ti +4 + \fItransport\fB_destination_recipient_limit = 1\fR + + in the Postfix \fBmain.cf\fR file, where \fItransport\fR + is the name in the first column of the Postfix \fBmaster.cf\fR + entry for the pipe-based delivery transport. .SH COMMAND ATTRIBUTE SYNTAX .na .nf *************** *** 82,99 **** --- 98,118 ---- This macro expands to the extension part of a recipient address. For example, with an address \fIuser+foo@domain\fR the extension is \fIfoo\fR. + .sp A command-line argument that contains \fB${\fBextension\fR}\fR expands into as many command-line arguments as there are recipients. .IP \fB${\fBmailbox\fR}\fR This macro expands to the complete local part of a recipient address. For example, with an address \fIuser+foo@domain\fR the mailbox is \fIuser+foo\fR. + .sp A command-line argument that contains \fB${\fBmailbox\fR}\fR expands into as many command-line arguments as there are recipients. .IP \fB${\fBnexthop\fR}\fR This macro expands to the next-hop hostname. .IP \fB${\fBrecipient\fR}\fR This macro expands to the complete recipient address. + .sp 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 *************** *** 105,110 **** --- 124,130 ---- This macro expands to the username part of a recipient address. For example, with an address \fIuser+foo@domain\fR the username part is \fIuser\fR. + .sp A command-line argument that contains \fB${\fBuser\fR}\fR expands into as many command-line arguments as there are recipients. .RE diff -cr ../release-20010228/proto/access ./proto/access *** ../release-20010228/proto/access Tue Jan 23 19:09:07 2001 --- ./proto/access Wed Mar 28 20:11:07 2001 *************** *** 57,63 **** # ACTIONS # .ad # .fi ! # .IP "[\fB45\fR]\fIXX text\fR" # Reject the address etc. that matches the pattern, and respond with # the numerical code and text. # .IP \fBREJECT\fR --- 57,63 ---- # ACTIONS # .ad # .fi ! # .IP "[\fB45\fR]\fINN text\fR" # Reject the address etc. that matches the pattern, and respond with # the numerical code and text. # .IP \fBREJECT\fR *************** *** 66,72 **** # .IP \fBOK\fR # Accept the address etc. that matches the pattern. # .IP \fIrestriction...\fR ! # Apply the named UCE restriction (\fBpermit\fR, \fRreject\fR, # \fBreject_unauth_destination\fR, and so on). # REGULAR EXPRESSION TABLES # .ad --- 66,72 ---- # .IP \fBOK\fR # Accept the address etc. that matches the pattern. # .IP \fIrestriction...\fR ! # Apply the named UCE restriction(s) (\fBpermit\fR, \fRreject\fR, # \fBreject_unauth_destination\fR, and so on). # REGULAR EXPRESSION TABLES # .ad diff -cr ../release-20010228/src/cleanup/cleanup.c ./src/cleanup/cleanup.c *** ../release-20010228/src/cleanup/cleanup.c Wed Dec 13 19:15:27 2000 --- ./src/cleanup/cleanup.c Wed Mar 28 20:05:26 2001 *************** *** 215,222 **** if (CLEANUP_OUT_OK(state) == 0 && type > 0) { if ((state->errs & CLEANUP_STAT_CONT) == 0) msg_warn("%s: skipping further client input", state->queue_id); ! while ((type = rec_get(src, buf, 0)) > 0 ! && type != REC_TYPE_END) /* void */ ; } --- 215,222 ---- if (CLEANUP_OUT_OK(state) == 0 && type > 0) { if ((state->errs & CLEANUP_STAT_CONT) == 0) msg_warn("%s: skipping further client input", state->queue_id); ! while (type != REC_TYPE_END ! && (type = rec_get(src, buf, 0)) > 0) /* void */ ; } diff -cr ../release-20010228/src/cleanup/cleanup_extracted.c ./src/cleanup/cleanup_extracted.c *** ../release-20010228/src/cleanup/cleanup_extracted.c Sat Sep 16 19:04:18 2000 --- ./src/cleanup/cleanup_extracted.c Wed Mar 28 20:05:36 2001 *************** *** 182,188 **** * straightforward. */ if (vstream_fflush(state->dst)) { - msg_warn("%s: write queue file: %m", state->queue_id); if (errno == EFBIG) { msg_warn("%s: queue file size limit exceeded", state->queue_id); state->errs |= CLEANUP_STAT_SIZE; --- 182,187 ---- diff -cr ../release-20010228/src/flush/Makefile.in ./src/flush/Makefile.in *** ../release-20010228/src/flush/Makefile.in Sun Feb 25 18:33:53 2001 --- ./src/flush/Makefile.in Thu Mar 29 12:39:43 2001 *************** *** 62,68 **** flush.o: ../../include/vstring.h flush.o: ../../include/vstring_vstream.h flush.o: ../../include/myflock.h - flush.o: ../../include/valid_hostname.h flush.o: ../../include/htable.h flush.o: ../../include/dict.h flush.o: ../../include/argv.h --- 62,67 ---- diff -cr ../release-20010228/src/flush/flush.c ./src/flush/flush.c *** ../release-20010228/src/flush/flush.c Sun Jan 28 10:26:18 2001 --- ./src/flush/flush.c Wed Mar 28 20:01:01 2001 *************** *** 129,134 **** --- 129,136 ---- #include #include #include + #include + #include /* Utility library. */ *************** *** 138,144 **** #include #include #include - #include #include #include #include --- 140,145 ---- *************** *** 163,169 **** /* Application-specific. */ /* ! * Tunable parameters. */ int var_fflush_refresh; int var_fflush_purge; --- 164,172 ---- /* Application-specific. */ /* ! * Tunable parameters. The fast_flush_domains parameter is not defined here, ! * because it is also used by the global library, and therefore is owned by ! * the library. */ int var_fflush_refresh; int var_fflush_purge; *************** *** 175,191 **** /* * Some hard-wired policy: how many queue IDs we remember while we're ! * flushing a logfile. */ #define FLUSH_DUP_FILTER_SIZE 10000 /* graceful degradation */ /* * Silly little macros. */ - #define STR(x) vstring_str(x) #define STREQ(x,y) (strcmp(x,y) == 0) /* flush_policy_ok - check logging policy */ static int flush_policy_ok(const char *site) --- 178,229 ---- /* * Some hard-wired policy: how many queue IDs we remember while we're ! * flushing a logfile (duplicate elimination). Sites with 1000+ emails ! * queued should arrange for permanent connectivity. */ #define FLUSH_DUP_FILTER_SIZE 10000 /* graceful degradation */ /* * Silly little macros. */ #define STR(x) vstring_str(x) #define STREQ(x,y) (strcmp(x,y) == 0) + /* + * Forward declarations resulting from breaking up routines according to + * name space: domain names versus safe-to-use pathnames. + */ + static int flush_add_path(const char *, const char *); + static int flush_send_path(const char *); + + /* flush_site_to_path - convert domain or [addr] to harmless string */ + + static VSTRING *flush_site_to_path(VSTRING *path, const char *site) + { + int ch; + + /* + * Allocate buffer on the fly; caller still needs to clean up. + */ + if (path == 0) + path = vstring_alloc(10); + + /* + * Mask characters that could upset the name-to-queue-file mapping code. + */ + while ((ch = *(unsigned const char *) site++) != 0) + if (ISALNUM(ch)) + VSTRING_ADDCH(path, ch); + else + VSTRING_ADDCH(path, '_'); + VSTRING_TERMINATE(path); + + if (msg_verbose) + msg_info("site %s to path %s", site, STR(path)); + + return (path); + } + /* flush_policy_ok - check logging policy */ static int flush_policy_ok(const char *site) *************** *** 193,204 **** return (domain_list_match(flush_domains, site)); } ! /* flush_add_service - append queue ID to per-site fast flush log */ static int flush_add_service(const char *site, const char *queue_id) { char *myname = "flush_add_service"; ! VSTREAM *log; if (msg_verbose) msg_info("%s: site %s queue_id %s", myname, site, queue_id); --- 231,243 ---- return (domain_list_match(flush_domains, site)); } ! /* flush_add_service - append queue ID to per-site fast flush logfile */ static int flush_add_service(const char *site, const char *queue_id) { char *myname = "flush_add_service"; ! VSTRING *site_path; ! int status; if (msg_verbose) msg_info("%s: site %s queue_id %s", myname, site, queue_id); *************** *** 210,221 **** return (FLUSH_STAT_OK); /* * Open the logfile or bust. */ ! if ((log = mail_queue_open(MAIL_QUEUE_FLUSH, site, O_CREAT | O_APPEND | O_WRONLY, 0600)) == 0) ! msg_fatal("%s: open fast flush log for site %s: %m", ! myname, site); /* * We must lock the logfile, so that we don't lose information due to --- 249,282 ---- return (FLUSH_STAT_OK); /* + * Map site to path and update log. + */ + site_path = flush_site_to_path((VSTRING *) 0, site); + status = flush_add_path(STR(site_path), queue_id); + vstring_free(site_path); + + return (status); + } + + /* flush_add_path - add record to log */ + + static int flush_add_path(const char *path, const char *queue_id) + { + char *myname = "flush_add_path"; + VSTREAM *log; + + /* + * Sanity check. + */ + if (!mail_queue_id_ok(path)) + return (FLUSH_STAT_BAD); + + /* * Open the logfile or bust. */ ! if ((log = mail_queue_open(MAIL_QUEUE_FLUSH, path, O_CREAT | O_APPEND | O_WRONLY, 0600)) == 0) ! msg_fatal("%s: open fast flush logfile %s: %m", myname, path); /* * We must lock the logfile, so that we don't lose information due to *************** *** 223,246 **** * will eventually take care of the problem, but it will take a while. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_EXCLUSIVE) < 0) ! msg_fatal("%s: lock fast flush log for site %s: %m", myname, site); /* ! * Append the queue ID. With 15 bits if microsecond time, a queue ID is * not recycled often enough for false hits to be a problem. If it does, * then we could add other signature information, such as the file size * in bytes. */ vstream_fprintf(log, "%s\n", queue_id); /* * Clean up. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_NONE) < 0) ! msg_fatal("%s: unlock fast flush log for site %s: %m", ! myname, site); if (vstream_fclose(log) != 0) ! msg_warn("write fast flush log for site %s: %m", site); return (FLUSH_STAT_OK); } --- 284,308 ---- * will eventually take care of the problem, but it will take a while. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_EXCLUSIVE) < 0) ! msg_fatal("%s: lock fast flush logfile %s: %m", myname, path); /* ! * Append the queue ID. With 15 bits of microsecond time, a queue ID is * not recycled often enough for false hits to be a problem. If it does, * then we could add other signature information, such as the file size * in bytes. */ vstream_fprintf(log, "%s\n", queue_id); + if (vstream_fflush(log)) + msg_warn("write fast flush logfile %s: %m", path); /* * Clean up. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_NONE) < 0) ! msg_fatal("%s: unlock fast flush logfile %s: %m", myname, path); if (vstream_fclose(log) != 0) ! msg_warn("write fast flush logfile %s: %m", path); return (FLUSH_STAT_OK); } *************** *** 250,255 **** --- 312,344 ---- static int flush_send_service(const char *site) { char *myname = "flush_send_service"; + VSTRING *site_path; + int status; + + if (msg_verbose) + msg_info("%s: site %s", myname, site); + + /* + * If this site is not eligible for logging, deliver all queued mail. + */ + if (flush_policy_ok(site) == 0) + return (mail_flush_deferred()); + + /* + * Map site name to path name and flush the log. + */ + site_path = flush_site_to_path((VSTRING *) 0, site); + status = flush_send_path(STR(site_path)); + vstring_free(site_path); + + return (status); + } + + /* flush_send_path - flush logfile file */ + + static int flush_send_path(const char *path) + { + const char *myname = "flush_send_path"; VSTRING *queue_id; VSTRING *queue_file; VSTREAM *log; *************** *** 261,282 **** HTABLE *dup_filter; int count; - if (msg_verbose) - msg_info("%s: site %s", myname, site); - /* ! * If this site is not eligible for logging, deliver all queued mail. */ ! if (flush_policy_ok(site) == 0) ! return (mail_flush_deferred()); /* * Open the logfile. If the file does not exist, then there is no queued * mail for this destination. */ ! if ((log = mail_queue_open(MAIL_QUEUE_FLUSH, site, O_RDWR, 0600)) == 0) { if (errno != ENOENT) ! msg_fatal("%s: open fast flush log for site %s: %m", myname, site); return (FLUSH_STAT_OK); } --- 350,368 ---- HTABLE *dup_filter; int count; /* ! * Sanity check. */ ! if (!mail_queue_id_ok(path)) ! return (FLUSH_STAT_BAD); /* * Open the logfile. If the file does not exist, then there is no queued * mail for this destination. */ ! if ((log = mail_queue_open(MAIL_QUEUE_FLUSH, path, O_RDWR, 0600)) == 0) { if (errno != ENOENT) ! msg_fatal("%s: open fast flush logfile %s: %m", myname, path); return (FLUSH_STAT_OK); } *************** *** 287,293 **** * watchdog will take care of it. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_EXCLUSIVE) < 0) ! msg_fatal("%s: lock fast flush log for site %s: %m", myname, site); /* * This is the part that dominates running time: schedule the listed --- 373,379 ---- * watchdog will take care of it. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_EXCLUSIVE) < 0) ! msg_fatal("%s: lock fast flush logfile %s: %m", myname, path); /* * This is the part that dominates running time: schedule the listed *************** *** 312,326 **** tbuf.actime = tbuf.modtime = event_time(); for (count = 0; vstring_get_nonl(queue_id, log) != VSTREAM_EOF; count++) { if (!mail_queue_id_ok(STR(queue_id))) { ! msg_warn("bad queue id \"%.30s...\" in fast flush log for site %s", ! STR(queue_id), site); continue; } if (dup_filter->used >= FLUSH_DUP_FILTER_SIZE || htable_find(dup_filter, STR(queue_id)) == 0) { if (msg_verbose) ! msg_info("%s: site %s: update %s time stamps", ! myname, site, STR(queue_id)); if (dup_filter->used <= FLUSH_DUP_FILTER_SIZE) htable_enter(dup_filter, STR(queue_id), 0); --- 398,412 ---- tbuf.actime = tbuf.modtime = event_time(); for (count = 0; vstring_get_nonl(queue_id, log) != VSTREAM_EOF; count++) { if (!mail_queue_id_ok(STR(queue_id))) { ! msg_warn("bad queue id \"%.30s...\" in fast flush logfile %s", ! STR(queue_id), path); continue; } if (dup_filter->used >= FLUSH_DUP_FILTER_SIZE || htable_find(dup_filter, STR(queue_id)) == 0) { if (msg_verbose) ! msg_info("%s: logfile %s: update queue file %s time stamps", ! myname, path, STR(queue_id)); if (dup_filter->used <= FLUSH_DUP_FILTER_SIZE) htable_enter(dup_filter, STR(queue_id), 0); *************** *** 344,351 **** } } else { if (msg_verbose) ! msg_info("%s: site %s: skip file %s as duplicate", ! myname, site, STR(queue_file)); } } htable_free(dup_filter, (void (*) (char *)) 0); --- 430,437 ---- } } else { if (msg_verbose) ! msg_info("%s: logfile %s: skip queue file %s as duplicate", ! myname, path, STR(queue_file)); } } htable_free(dup_filter, (void (*) (char *)) 0); *************** *** 356,374 **** * Truncate the fast flush log. */ if (count > 0 && ftruncate(vstream_fileno(log), (off_t) 0) < 0) ! msg_fatal("%s: truncate fast flush log for site %s: %m", myname, site); /* * Request delivery and clean up. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_NONE) < 0) ! msg_fatal("%s: unlock fast flush log for site %s: %m", ! myname, site); if (vstream_fclose(log) != 0) ! msg_warn("read fast flush log for site %s: %m", site); if (count > 0) { if (msg_verbose) ! msg_info("%s: requesting delivery for site %s", myname, site); mail_trigger(MAIL_CLASS_PUBLIC, MAIL_SERVICE_QUEUE, qmgr_trigger, sizeof(qmgr_trigger)); } --- 442,459 ---- * Truncate the fast flush log. */ if (count > 0 && ftruncate(vstream_fileno(log), (off_t) 0) < 0) ! msg_fatal("%s: truncate fast flush logfile %s: %m", myname, path); /* * Request delivery and clean up. */ if (myflock(vstream_fileno(log), INTERNAL_LOCK, MYFLOCK_OP_NONE) < 0) ! msg_fatal("%s: unlock fast flush logfile %s: %m", myname, path); if (vstream_fclose(log) != 0) ! msg_warn("%s: read fast flush logfile %s: %m", myname, path); if (count > 0) { if (msg_verbose) ! msg_info("%s: requesting delivery for logfile %s", myname, path); mail_trigger(MAIL_CLASS_PUBLIC, MAIL_SERVICE_QUEUE, qmgr_trigger, sizeof(qmgr_trigger)); } *************** *** 381,403 **** { char *myname = "flush_refresh_service"; SCAN_DIR *scan; ! char *site; struct stat st; VSTRING *path = vstring_alloc(10); scan = scan_dir_open(MAIL_QUEUE_FLUSH); ! while ((site = mail_scan_dir_next(scan)) != 0) { ! if (!mail_queue_id_ok(site)) continue; /* XXX grumble. */ ! mail_queue_path(path, MAIL_QUEUE_FLUSH, site); ! if (flush_policy_ok(site) == 0) { ! if (unlink(STR(path)) < 0) ! msg_warn("remove %s: %m", STR(path)); ! else if (msg_verbose) ! msg_info("%s: spurious fast flush logfile name: %s", ! myname, site); ! continue; ! } if (stat(STR(path), &st) < 0) { if (errno != ENOENT) msg_warn("%s: stat %s: %m", myname, STR(path)); --- 466,480 ---- { char *myname = "flush_refresh_service"; SCAN_DIR *scan; ! char *site_path; struct stat st; VSTRING *path = vstring_alloc(10); scan = scan_dir_open(MAIL_QUEUE_FLUSH); ! while ((site_path = mail_scan_dir_next(scan)) != 0) { ! if (!mail_queue_id_ok(site_path)) continue; /* XXX grumble. */ ! mail_queue_path(path, MAIL_QUEUE_FLUSH, site_path); if (stat(STR(path), &st) < 0) { if (errno != ENOENT) msg_warn("%s: stat %s: %m", myname, STR(path)); *************** *** 408,427 **** if (st.st_size == 0) { if (st.st_mtime + var_fflush_purge < event_time()) { if (unlink(STR(path)) < 0) ! msg_warn("remove %s: %m", STR(path)); else if (msg_verbose) msg_info("%s: unlink %s, empty and unchanged for %d days", myname, STR(path), var_fflush_purge / 86400); } else if (msg_verbose) ! msg_info("%s: skip site %s - empty log", myname, site); } else if (st.st_atime + max_age < event_time()) { if (msg_verbose) ! msg_info("%s: flush site %s", myname, site); ! flush_send_service(site); } else { if (msg_verbose) ! msg_info("%s: skip site %s, unread for <%d hours(s) ", ! myname, site, max_age / 3600); } } scan_dir_close(scan); --- 485,504 ---- if (st.st_size == 0) { if (st.st_mtime + var_fflush_purge < event_time()) { if (unlink(STR(path)) < 0) ! msg_warn("remove logfile %s: %m", STR(path)); else if (msg_verbose) msg_info("%s: unlink %s, empty and unchanged for %d days", myname, STR(path), var_fflush_purge / 86400); } else if (msg_verbose) ! msg_info("%s: skip logfile %s - empty log", myname, site_path); } else if (st.st_atime + max_age < event_time()) { if (msg_verbose) ! msg_info("%s: flush logfile %s", myname, site_path); ! flush_send_path(site_path); } else { if (msg_verbose) ! msg_info("%s: skip logfile %s, unread for <%d hours(s) ", ! myname, site_path, max_age / 3600); } } scan_dir_close(scan); *************** *** 454,462 **** * This routine runs whenever a client connects to the UNIX-domain socket * dedicated to the fast flush service. What we see below is a little * protocol to (1) read a request from the client (the name of the site) ! * and (2) acknowledge that we have received the request. Since the site ! * name maps onto the file system, make sure the site name is a valid ! * SMTP hostname. * * All connection-management stuff is handled by the common code in * single_server.c. --- 531,537 ---- * This routine runs whenever a client connects to the UNIX-domain socket * dedicated to the fast flush service. What we see below is a little * protocol to (1) read a request from the client (the name of the site) ! * and (2) acknowledge that we have received the request. * * All connection-management stuff is handled by the common code in * single_server.c. *************** *** 466,479 **** site = vstring_alloc(10); queue_id = vstring_alloc(10); if (mail_command_read(client_stream, "%s %s", site, queue_id) == 2 - && valid_hostname(STR(site), DONT_GRIPE) && mail_queue_id_ok(STR(queue_id))) status = flush_add_service(lowercase(STR(site)), STR(queue_id)); mail_print(client_stream, "%d", status); } else if (STREQ(STR(request), FLUSH_REQ_SEND)) { site = vstring_alloc(10); ! if (mail_command_read(client_stream, "%s", site) == 1 ! && valid_hostname(STR(site), DONT_GRIPE)) status = flush_send_service(lowercase(STR(site))); mail_print(client_stream, "%d", status); } else if (STREQ(STR(request), FLUSH_REQ_REFRESH) --- 541,552 ---- site = vstring_alloc(10); queue_id = vstring_alloc(10); if (mail_command_read(client_stream, "%s %s", site, queue_id) == 2 && mail_queue_id_ok(STR(queue_id))) status = flush_add_service(lowercase(STR(site)), STR(queue_id)); mail_print(client_stream, "%d", status); } else if (STREQ(STR(request), FLUSH_REQ_SEND)) { site = vstring_alloc(10); ! if (mail_command_read(client_stream, "%s", site) == 1) status = flush_send_service(lowercase(STR(site))); mail_print(client_stream, "%d", status); } else if (STREQ(STR(request), FLUSH_REQ_REFRESH) diff -cr ../release-20010228/src/global/rewrite_clnt.c ./src/global/rewrite_clnt.c *** ../release-20010228/src/global/rewrite_clnt.c Sat Dec 11 19:19:46 1999 --- ./src/global/rewrite_clnt.c Wed Mar 28 20:12:19 2001 *************** *** 46,51 **** --- 46,52 ---- #include #include #include + #include /* Utility library. */ diff -cr ../release-20010228/src/global/tok822_parse.c ./src/global/tok822_parse.c *** ../release-20010228/src/global/tok822_parse.c Sat May 20 11:16:08 2000 --- ./src/global/tok822_parse.c Thu Mar 29 15:14:53 2001 *************** *** 252,258 **** VSTRING_ADDCH(vp, ')'); break; case TOK822_COMMENT_TEXT: ! tok822_copy_quoted(vp, vstring_str(tp->vstr), "()\\\r\n"); break; case TOK822_QSTRING: VSTRING_ADDCH(vp, '"'); --- 252,258 ---- VSTRING_ADDCH(vp, ')'); break; case TOK822_COMMENT_TEXT: ! tok822_copy_quoted(vp, vstring_str(tp->vstr), "()\\"); break; case TOK822_QSTRING: VSTRING_ADDCH(vp, '"'); *************** *** 540,546 **** #include #include ! #include /* tok822_print - display token */ --- 540,546 ---- #include #include ! #include /* tok822_print - display token */ *************** *** 577,583 **** TOK822 *list; VSTRING *buf = vstring_alloc(100); ! while (vstring_fgets_nonl(buf, VSTREAM_IN)) { if (!isatty(vstream_fileno(VSTREAM_IN))) vstream_printf(">>>%s<<<\n\n", vstring_str(buf)); list = tok822_parse(vstring_str(buf)); --- 577,587 ---- TOK822 *list; VSTRING *buf = vstring_alloc(100); ! while (readlline(buf, VSTREAM_IN, (int *) 0, READLL_KEEPNL)) { ! while (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\n') { ! vstring_end(buf)[-1] = 0; ! vstring_truncate(buf, VSTRING_LEN(buf) - 1); ! } if (!isatty(vstream_fileno(VSTREAM_IN))) vstream_printf(">>>%s<<<\n\n", vstring_str(buf)); list = tok822_parse(vstring_str(buf)); diff -cr ../release-20010228/src/global/tok822_parse.in ./src/global/tok822_parse.in *** ../release-20010228/src/global/tok822_parse.in Thu Apr 20 17:58:12 2000 --- ./src/global/tok822_parse.in Thu Mar 29 15:09:33 2001 *************** *** 11,13 **** --- 11,15 ---- wietse@[stuff wietse@["stuff] named group: foo@bar, baz@barf; + wietse@foo (wietse + venema) diff -cr ../release-20010228/src/global/tok822_parse.ref ./src/global/tok822_parse.ref *** ../release-20010228/src/global/tok822_parse.ref Thu Apr 20 17:58:13 2000 --- ./src/global/tok822_parse.ref Thu Mar 29 15:19:49 2001 *************** *** 264,266 **** --- 264,290 ---- named group: foo@bar, baz@barf; + >>>wietse@foo (wietse + venema)<<< + + Parse tree: + address + atom "wietse" + OP "@" + atom "foo" + comment + text "wietse + venema" + + Internalized: + wietse@foo (wietse + venema) + + Externalized, no newlines inserted: + wietse@foo (wietse + venema) + + Externalized, newlines inserted: + wietse@foo (wietse + venema) + diff -cr ../release-20010228/src/lmtp/lmtp.c ./src/lmtp/lmtp.c *** ../release-20010228/src/lmtp/lmtp.c Thu Feb 22 13:11:20 2001 --- ./src/lmtp/lmtp.c Wed Mar 28 20:14:25 2001 *************** *** 330,335 **** --- 330,339 ---- /* * Disconnect if we're going to a different destination. Discard * transcript and status information for sending QUIT. + * + * XXX Should transform nexthop into canonical form (unix:/path or + * inet:host:port) before doing connection cache lookup. See also the + * connection cache updating code in lmtp_connect.c. */ if (strcasecmp(state->session->dest, request->nexthop) != 0) { lmtp_quit(state); diff -cr ../release-20010228/src/lmtp/lmtp_connect.c ./src/lmtp/lmtp_connect.c *** ../release-20010228/src/lmtp/lmtp_connect.c Sat Dec 16 20:33:45 2000 --- ./src/lmtp/lmtp_connect.c Wed Mar 28 20:13:50 2001 *************** *** 116,122 **** /* lmtp_connect_unix - connect to UNIX-domain address */ ! static LMTP_SESSION *lmtp_connect_unix(const char *addr, VSTRING *why) { #undef sun char *myname = "lmtp_connect_unix"; --- 116,123 ---- /* lmtp_connect_unix - connect to UNIX-domain address */ ! static LMTP_SESSION *lmtp_connect_unix(const char *addr, ! const char *destination, VSTRING *why) { #undef sun char *myname = "lmtp_connect_unix"; *************** *** 156,162 **** msg_info("%s: trying: %s...", myname, addr); return (lmtp_connect_sock(sock, (struct sockaddr *) & sun, sizeof(sun), ! addr, addr, addr, why)); } /* lmtp_connect_addr - connect to explicit address */ --- 157,163 ---- msg_info("%s: trying: %s...", myname, addr); return (lmtp_connect_sock(sock, (struct sockaddr *) & sun, sizeof(sun), ! addr, addr, destination, why)); } /* lmtp_connect_addr - connect to explicit address */ *************** *** 358,370 **** * XXX Ad-hoc transport parsing and connection management. Some or all * should be moved away to a reusable library routine so that every * program benefits from it. */ if (strncmp(destination, "unix:", 5) == 0) ! return (lmtp_connect_unix(destination + 5, why)); if (strncmp(destination, "inet:", 5) == 0) ! destination += 5; ! dest_buf = lmtp_parse_destination(destination, def_service, ! &host, &port); if (msg_verbose) msg_info("%s: connecting to %s port %d", myname, host, ntohs(port)); session = lmtp_connect_host(host, port, destination, why); --- 359,377 ---- * XXX Ad-hoc transport parsing and connection management. Some or all * should be moved away to a reusable library routine so that every * program benefits from it. + * + * XXX Should transform destination into canonical form (unix:/path or + * inet:host:port before entering it into the connection cache. See also + * the connection cache lookup code in lmtp.c. */ if (strncmp(destination, "unix:", 5) == 0) ! return (lmtp_connect_unix(destination + 5, destination, why)); if (strncmp(destination, "inet:", 5) == 0) ! dest_buf = lmtp_parse_destination(destination + 5, def_service, ! &host, &port); ! else ! dest_buf = lmtp_parse_destination(destination, def_service, ! &host, &port); if (msg_verbose) msg_info("%s: connecting to %s port %d", myname, host, ntohs(port)); session = lmtp_connect_host(host, port, destination, why); diff -cr ../release-20010228/src/master/master_conf.c ./src/master/master_conf.c *** ../release-20010228/src/master/master_conf.c Sun Oct 1 19:39:02 2000 --- ./src/master/master_conf.c Wed Mar 28 20:14:52 2001 *************** *** 36,41 **** --- 36,42 ---- #include #include + #include /* Utility library. */ diff -cr ../release-20010228/src/master/master_sig.c ./src/master/master_sig.c *** ../release-20010228/src/master/master_sig.c Tue Feb 27 14:51:45 2001 --- ./src/master/master_sig.c Wed Mar 28 20:15:26 2001 *************** *** 152,158 **** static void master_sigdeath(int sig) { ! char *myname = "master_sigsetup"; struct sigaction action; pid_t pid = getpid(); --- 152,158 ---- static void master_sigdeath(int sig) { ! char *myname = "master_sigdeath"; struct sigaction action; pid_t pid = getpid(); diff -cr ../release-20010228/src/master/master_status.c ./src/master/master_status.c *** ../release-20010228/src/master/master_status.c Mon Nov 20 13:05:45 2000 --- ./src/master/master_status.c Wed Mar 28 20:15:48 2001 *************** *** 113,119 **** } if (proc->serv != serv) msg_panic("%s: pointer corruption: %p != %p", ! myname, (char *) proc->serv, (char *) serv); /* * Update our idea of the child process status. Allow redundant status --- 113,119 ---- } if (proc->serv != serv) msg_panic("%s: pointer corruption: %p != %p", ! myname, (void *) proc->serv, (void *) serv); /* * Update our idea of the child process status. Allow redundant status diff -cr ../release-20010228/src/pipe/pipe.c ./src/pipe/pipe.c *** ../release-20010228/src/pipe/pipe.c Fri Feb 16 16:25:01 2001 --- ./src/pipe/pipe.c Thu Mar 29 15:07:59 2001 *************** *** 7,15 **** /* \fBpipe\fR [generic Postfix daemon options] command_attributes... /* DESCRIPTION /* The \fBpipe\fR daemon processes requests from the Postfix queue ! /* manager to deliver messages to external commands. Each delivery ! /* request specifies a queue file, a sender address, a domain or host ! /* to deliver to, and one or more recipients. /* This program expects to be run from the \fBmaster\fR(8) process /* manager. /* --- 7,13 ---- /* \fBpipe\fR [generic Postfix daemon options] command_attributes... /* DESCRIPTION /* The \fBpipe\fR daemon processes requests from the Postfix queue ! /* manager to deliver messages to external commands. /* This program expects to be run from the \fBmaster\fR(8) process /* manager. /* *************** *** 17,22 **** --- 15,36 ---- /* as finished, or it informs the queue manager that delivery should /* be tried again at a later time. Delivery problem reports are sent /* to the \fBbounce\fR(8) or \fBdefer\fR(8) daemon as appropriate. + /* SINGLE-RECIPIENT DELIVERY + /* .ad + /* .fi + /* Some external commands cannot handle more than one recipient + /* per delivery request. Examples of such transports are pagers, + /* fax machines, and so on. + /* + /* To prevent Postfix from sending multiple recipients per delivery + /* request, specify + /* + /* .ti +4 + /* \fItransport\fB_destination_recipient_limit = 1\fR + /* + /* in the Postfix \fBmain.cf\fR file, where \fItransport\fR + /* is the name in the first column of the Postfix \fBmaster.cf\fR + /* entry for the pipe-based delivery transport. /* COMMAND ATTRIBUTE SYNTAX /* .ad /* .fi *************** *** 74,91 **** --- 88,108 ---- /* This macro expands to the extension part of a recipient address. /* For example, with an address \fIuser+foo@domain\fR the extension is /* \fIfoo\fR. + /* .sp /* A command-line argument that contains \fB${\fBextension\fR}\fR expands /* into as many command-line arguments as there are recipients. /* .IP \fB${\fBmailbox\fR}\fR /* This macro expands to the complete local part of a recipient address. /* For example, with an address \fIuser+foo@domain\fR the mailbox is /* \fIuser+foo\fR. + /* .sp /* A command-line argument that contains \fB${\fBmailbox\fR}\fR /* expands into as many command-line arguments as there are recipients. /* .IP \fB${\fBnexthop\fR}\fR /* This macro expands to the next-hop hostname. /* .IP \fB${\fBrecipient\fR}\fR /* This macro expands to the complete recipient address. + /* .sp /* 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 *************** *** 97,102 **** --- 114,120 ---- /* This macro expands to the username part of a recipient address. /* For example, with an address \fIuser+foo@domain\fR the username /* part is \fIuser\fR. + /* .sp /* A command-line argument that contains \fB${\fBuser\fR}\fR expands /* into as many command-line arguments as there are recipients. /* .RE diff -cr ../release-20010228/src/qmgr/qmgr_active.c ./src/qmgr/qmgr_active.c *** ../release-20010228/src/qmgr/qmgr_active.c Tue Jan 2 13:20:21 2001 --- ./src/qmgr/qmgr_active.c Wed Mar 28 20:00:23 2001 *************** *** 149,155 **** tbuf.actime = tbuf.modtime = event_time() + delay; path = mail_queue_path((VSTRING *) 0, queue_name, queue_id); ! if (utime(path, &tbuf) < 0) msg_fatal("%s: update %s time stamps: %m", myname, path); if (mail_queue_rename(queue_id, queue_name, dest_queue)) { if (errno != ENOENT) --- 149,155 ---- tbuf.actime = tbuf.modtime = event_time() + delay; path = mail_queue_path((VSTRING *) 0, queue_name, queue_id); ! if (utime(path, &tbuf) < 0 && errno != ENOENT) msg_fatal("%s: update %s time stamps: %m", myname, path); if (mail_queue_rename(queue_id, queue_name, dest_queue)) { if (errno != ENOENT) diff -cr ../release-20010228/src/showq/showq.c ./src/showq/showq.c *** ../release-20010228/src/showq/showq.c Thu Feb 22 20:29:06 2001 --- ./src/showq/showq.c Wed Mar 28 20:16:16 2001 *************** *** 273,278 **** --- 273,279 ---- } else if (errno != ENOENT) msg_fatal("open %s %s: %m", *queue, id); file_count++; + vstream_fflush(client); } vstream_fflush(client); } diff -cr ../release-20010228/src/util/dict_ldap.c ./src/util/dict_ldap.c *** ../release-20010228/src/util/dict_ldap.c Sun Feb 4 13:09:25 2001 --- ./src/util/dict_ldap.c Thu Mar 29 12:27:40 2001 *************** *** 104,109 **** --- 104,113 ---- #include "dict.h" #include "dict_ldap.h" + /* AAARGH!! */ + + #include "../global/mail_conf.h" + /* * Structure containing all the configuration parameters for a given * LDAP source, plus its connection handle. diff -cr ../release-20010228/src/util/msg_syslog.c ./src/util/msg_syslog.c *** ../release-20010228/src/util/msg_syslog.c Mon Nov 20 13:23:41 2000 --- ./src/util/msg_syslog.c Wed Mar 28 20:17:12 2001 *************** *** 48,53 **** --- 48,54 ---- #include #include #include + #include /* Application-specific. */ diff -cr ../release-20010228/src/util/rand_sleep.c ./src/util/rand_sleep.c *** ../release-20010228/src/util/rand_sleep.c Sat Feb 3 19:00:22 2001 --- ./src/util/rand_sleep.c Wed Mar 28 20:17:36 2001 *************** *** 67,74 **** * Use the semi-crappy random number generator. */ if (my_pid == 0) ! srandom((my_pid = getpid()) ^ time((time_t *) 0)); ! usec = (delay - variation / 2) + variation * (double) random() / RAND_MAX; doze(usec); } --- 67,74 ---- * Use the semi-crappy random number generator. */ if (my_pid == 0) ! srand((my_pid = getpid()) ^ time((time_t *) 0)); ! usec = (delay - variation / 2) + variation * (double) rand() / RAND_MAX; doze(usec); } diff -cr ../release-20010228/src/util/sys_defs.h ./src/util/sys_defs.h *** ../release-20010228/src/util/sys_defs.h Fri Feb 23 11:03:54 2001 --- ./src/util/sys_defs.h Wed Mar 28 20:18:35 2001 *************** *** 329,338 **** --- 329,340 ---- #define USE_STATVFS #define STATVFS_IN_SYS_STATVFS_H #define STRCASECMP_IN_STRINGS_H + #if 0 extern time_t time(time_t *); extern int seteuid(uid_t); extern int setegid(gid_t); extern int initgroups(const char *, int); + #endif #endif *************** *** 399,404 **** --- 401,410 ---- #if defined(IRIX5) #define MISSING_USLEEP + #endif + + #if defined(IRIX6) + #define HAS_POSIX_REGEXP #endif /* diff -cr ../release-20010228/src/util/watchdog.c ./src/util/watchdog.c *** ../release-20010228/src/util/watchdog.c Mon Nov 20 13:06:41 2000 --- ./src/util/watchdog.c Wed Mar 28 20:18:55 2001 *************** *** 133,139 **** if ((wp = watchdog_curr) == 0) msg_panic("%s: no instance", myname); if (msg_verbose) ! msg_info("%s: %p %d", myname, (char *) wp, wp->trip_run); if (++(wp->trip_run) < WATCHDOG_STEPS) { alarm(wp->timeout); } else { --- 133,139 ---- if ((wp = watchdog_curr) == 0) msg_panic("%s: no instance", myname); if (msg_verbose) ! msg_info("%s: %p %d", myname, (void *) wp, wp->trip_run); if (++(wp->trip_run) < WATCHDOG_STEPS) { alarm(wp->timeout); } else { *************** *** 169,175 **** if (sigaction(SIGALRM, &sig_action, &wp->saved_action) < 0) msg_fatal("%s: sigaction(SIGALRM): %m", myname); if (msg_verbose) ! msg_info("%s: %p %d", myname, (char *) wp, timeout); return (watchdog_curr = wp); } --- 169,175 ---- if (sigaction(SIGALRM, &sig_action, &wp->saved_action) < 0) msg_fatal("%s: sigaction(SIGALRM): %m", myname); if (msg_verbose) ! msg_info("%s: %p %d", myname, (void *) wp, timeout); return (watchdog_curr = wp); } *************** *** 187,193 **** alarm(wp->saved_time); myfree((char *) wp); if (msg_verbose) ! msg_info("%s: %p", myname, (char *) wp); } /* watchdog_start - enable watchdog timer */ --- 187,193 ---- alarm(wp->saved_time); myfree((char *) wp); if (msg_verbose) ! msg_info("%s: %p", myname, (void *) wp); } /* watchdog_start - enable watchdog timer */ *************** *** 201,207 **** wp->trip_run = 0; alarm(wp->timeout); if (msg_verbose) ! msg_info("%s: %p", myname, (char *) wp); } /* watchdog_stop - disable watchdog timer */ --- 201,207 ---- wp->trip_run = 0; alarm(wp->timeout); if (msg_verbose) ! msg_info("%s: %p", myname, (void *) wp); } /* watchdog_stop - disable watchdog timer */ *************** *** 214,220 **** msg_panic("%s: wrong watchdog instance", myname); alarm(0); if (msg_verbose) ! msg_info("%s: %p", myname, (char *) wp); } /* watchdog_pat - pat the dog so it stays quiet */ --- 214,220 ---- msg_panic("%s: wrong watchdog instance", myname); alarm(0); if (msg_verbose) ! msg_info("%s: %p", myname, (void *) wp); } /* watchdog_pat - pat the dog so it stays quiet */ *************** *** 226,232 **** if (watchdog_curr) watchdog_curr->trip_run = 0; if (msg_verbose) ! msg_info("%s: %p", myname, (char *) watchdog_curr); } #ifdef TEST --- 226,232 ---- if (watchdog_curr) watchdog_curr->trip_run = 0; if (msg_verbose) ! msg_info("%s: %p", myname, (void *) watchdog_curr); } #ifdef TEST