Prereq: "Postfix-19990906-pl05" diff -cr --new-file ../postfix-19990906-pl05/global/mail_version.h ./global/mail_version.h *** ../postfix-19990906-pl05/global/mail_version.h Thu Sep 23 12:45:31 1999 --- ./global/mail_version.h Thu Nov 4 09:48:21 1999 *************** *** 15,21 **** * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-19990906-pl05" extern char *var_mail_version; /* LICENSE --- 15,21 ---- * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-19990906-pl06" extern char *var_mail_version; /* LICENSE diff -cr --new-file ../postfix-19990906-pl05/.indent.pro ./.indent.pro *** ../postfix-19990906-pl05/.indent.pro Thu Jun 24 20:07:30 1999 --- ./.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/HISTORY ./HISTORY *** ../postfix-19990906-pl05/HISTORY Thu Sep 23 12:46:58 1999 --- ./HISTORY Sat Nov 6 10:51:32 1999 *************** *** 3053,3059 **** 19990908 Portability: Unixware has only after sendmail ! is installed. Changed postlock.c to use global/sys_exists.h. 19990922 --- 3053,3064 ---- 19990908 Portability: Unixware has only after sendmail ! is installed. Changed postlock.c to use global/sys_exits.h. ! ! 19990910 ! ! Cleanup: removed spurious sender address checks for <>. ! File: smtpd/smtpd_check.c. 19990922 *************** *** 3069,3076 **** could be sent back with recipients missing from the error report. Reported by Giulio Orsero @ tiscalinet.it. ! 19990922 Bugfix: the above bugfix broke bounces of mail with bad address syntax and relocated users. Problem diagnosed by Dick Porter @ acm.org. --- 3074,3128 ---- could be sent back with recipients missing from the error report. Reported by Giulio Orsero @ tiscalinet.it. ! 19990923 Bugfix: the above bugfix broke bounces of mail with bad address syntax and relocated users. Problem diagnosed by Dick Porter @ acm.org. + + Documentation: added DO NOT EDIT THIS FILE. EDIT MAIN.CF + INSTEAD notices to the sample-xxx.cf files. + + 19991007 + + Compatibility: ignore the sendmail -U (initial user + submission) option. Thomas Quinot @ cuivre.fr.eu.org. + + 19991103 + + Code cleanup: don't send postmaster notifications when an + SMTP client sends a DATA command while no recipients were + accepted. This can happen when a pipelined client runs + into an UCE block. File: smtpd/smtpd.c. + + 19991104 + + Robustness: do not apply UCE header checks to mail that is + generated by Postfix (bounces, forwarded mail etc.). Files: + smtpd/smtpd.c, pickup/pickup.c, cleanup/cleanup_message.c. + + Robustness: new generic watchdog module that can deal with + clocks that jump occasionally. Files: util/watchdog.c, + master/master.c, master/{single,multi,trigger}_server.c. + This hopefully ends the false watchdog alarms that happen + when clocks are set or when laptops are resumed. + + Code cleanup: BSMTP requires dot quoting as per RFC 821. + Based on code by Florian Lohoff @ rfc822.org. Files: + global/mail_copy.[hc], pipe/pipe.c. + + 19991105 + + Bugfix: the crufty code in inet_addr_local() did not find + IP aliases. File: util/inet_addr_local.c. + + Portability: the INSTALL.sh utility did not find users or + groups in NIS or Netinfo tables. The script no longer + searches the /etc/passwd and /etc/group files. Instead it + now queries the unix:passwd.byname and unix:group.byname + maps. For this, a -q (query) option was added to postmap + (and to postalias, for symmetry). Files: util/dict_unix.c, + postalias/postalias.c, postmap/postmap.c, INSTALL.sh. + + Bugfix: LDAP lookup timeout settings were ignored. Patch + by John Hensley. File: util/dict_ldap.c. diff -cr --new-file ../postfix-19990906-pl05/INSTALL.sh ./INSTALL.sh *** ../postfix-19990906-pl05/INSTALL.sh Mon Sep 6 18:39:53 1999 --- ./INSTALL.sh Fri Nov 5 11:10:25 1999 *************** *** 28,36 **** command_directory - directory with Postfix administrative commands. queue_directory - directory with Postfix queues. ! sendmail_path - full pathname of the sendmail command. ! newaliases_path - full pathname of the newaliases command. ! mailq_path - full pathname of the mailq command. owner - owner of Postfix queue files. --- 28,36 ---- command_directory - directory with Postfix administrative commands. queue_directory - directory with Postfix queues. ! sendmail_path - full pathname of the Postfix sendmail command. ! newaliases_path - full pathname of the Postfix newaliases command. ! mailq_path - full pathname of the Postfix mailq command. owner - owner of Postfix queue files. *************** *** 138,144 **** esac done ! grep "^$owner:" /etc/passwd >/dev/null || { echo "$owner needs an entry in the passwd file" 1>&2 echo "Remember, $owner must have a dedicated user id and group id." 1>&2 exit 1 --- 138,144 ---- esac done ! bin/postmap -q "$owner" unix:passwd.byname >/dev/null || { echo "$owner needs an entry in the passwd file" 1>&2 echo "Remember, $owner must have a dedicated user id and group id." 1>&2 exit 1 *************** *** 146,152 **** case $setgid in no) ;; ! *) grep "^$setgid:" /etc/group >/dev/null || { echo "$setgid needs an entry in the group file" 1>&2 echo "Remember, $setgid must have a dedicated group id." 1>&2 exit 1 --- 146,152 ---- case $setgid in no) ;; ! *) bin/postmap -q "$setgid" unix:group.byname >/dev/null || { echo "$setgid needs an entry in the group file" 1>&2 echo "Remember, $setgid must have a dedicated group id." 1>&2 exit 1 diff -cr --new-file ../postfix-19990906-pl05/bounce/.indent.pro ./bounce/.indent.pro *** ../postfix-19990906-pl05/bounce/.indent.pro Thu Jun 24 20:07:30 1999 --- ./bounce/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/cleanup/.indent.pro ./cleanup/.indent.pro *** ../postfix-19990906-pl05/cleanup/.indent.pro Thu Jun 24 20:07:30 1999 --- ./cleanup/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/cleanup/cleanup_message.c ./cleanup/cleanup_message.c *** ../postfix-19990906-pl05/cleanup/cleanup_message.c Wed Jun 23 21:14:20 1999 --- ./cleanup/cleanup_message.c Thu Nov 4 09:31:30 1999 *************** *** 234,240 **** if (msg_verbose) msg_info("%s: '%s'", myname, vstring_str(cleanup_header_buf)); ! if (cleanup_header_checks) { char *header = vstring_str(cleanup_header_buf); const char *value; --- 234,240 ---- if (msg_verbose) msg_info("%s: '%s'", myname, vstring_str(cleanup_header_buf)); ! if ((cleanup_flags & CLEANUP_FLAG_FILTER) && cleanup_header_checks) { char *header = vstring_str(cleanup_header_buf); const char *value; diff -cr --new-file ../postfix-19990906-pl05/conf/sample-aliases.cf ./conf/sample-aliases.cf *** ../postfix-19990906-pl05/conf/sample-aliases.cf Tue Dec 8 19:43:42 1998 --- ./conf/sample-aliases.cf Thu Nov 4 20:52:27 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control alias database lookups. # diff -cr --new-file ../postfix-19990906-pl05/conf/sample-canonical.cf ./conf/sample-canonical.cf *** ../postfix-19990906-pl05/conf/sample-canonical.cf Mon Dec 21 18:39:48 1998 --- ./conf/sample-canonical.cf Thu Nov 4 20:52:31 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control canonical address map lookups. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-debug.cf ./conf/sample-debug.cf *** ../postfix-19990906-pl05/conf/sample-debug.cf Tue Dec 8 19:04:46 1998 --- ./conf/sample-debug.cf Thu Nov 4 20:52:35 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control debugging features. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-ldap.cf ./conf/sample-ldap.cf *** ../postfix-19990906-pl05/conf/sample-ldap.cf Tue Dec 8 19:04:46 1998 --- ./conf/sample-ldap.cf Thu Nov 4 20:52:39 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control LDAP lookups. Source code for LDAP # lookup is available separately from http://www.postfix.org/ diff -cr --new-file ../postfix-19990906-pl05/conf/sample-local.cf ./conf/sample-local.cf *** ../postfix-19990906-pl05/conf/sample-local.cf Sun Jun 27 18:53:57 1999 --- ./conf/sample-local.cf Thu Nov 4 20:52:44 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control local delivery. # diff -cr --new-file ../postfix-19990906-pl05/conf/sample-misc.cf ./conf/sample-misc.cf *** ../postfix-19990906-pl05/conf/sample-misc.cf Thu Jul 8 13:29:55 1999 --- ./conf/sample-misc.cf Thu Nov 4 20:52:48 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings for miscellaneous Postfix # configuration parameters. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-pcre.cf ./conf/sample-pcre.cf *** ../postfix-19990906-pl05/conf/sample-pcre.cf Tue Mar 16 19:03:04 1999 --- ./conf/sample-pcre.cf Thu Nov 4 20:52:52 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # # Sample pcre (PERL-compatible regular expression) map file # diff -cr --new-file ../postfix-19990906-pl05/conf/sample-rate.cf ./conf/sample-rate.cf *** ../postfix-19990906-pl05/conf/sample-rate.cf Wed Jan 6 17:17:14 1999 --- ./conf/sample-rate.cf Thu Nov 4 20:52:56 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix parameters that # control delivery rates. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-regexp.cf ./conf/sample-regexp.cf *** ../postfix-19990906-pl05/conf/sample-regexp.cf Tue Aug 31 18:00:43 1999 --- ./conf/sample-regexp.cf Thu Nov 4 20:53:02 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # Sample regexp lookup "table". # # Format is /regexp/flags or /regexp/flags!/regexp/flags diff -cr --new-file ../postfix-19990906-pl05/conf/sample-relocated.cf ./conf/sample-relocated.cf *** ../postfix-19990906-pl05/conf/sample-relocated.cf Mon Dec 21 18:41:20 1998 --- ./conf/sample-relocated.cf Thu Nov 4 20:53:06 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control relocated database lookups. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-resource.cf ./conf/sample-resource.cf *** ../postfix-19990906-pl05/conf/sample-resource.cf Tue Dec 8 19:15:11 1998 --- ./conf/sample-resource.cf Thu Nov 4 20:53:09 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of general Postfix resource # control parameters. # diff -cr --new-file ../postfix-19990906-pl05/conf/sample-rewrite.cf ./conf/sample-rewrite.cf *** ../postfix-19990906-pl05/conf/sample-rewrite.cf Tue Jan 19 09:30:52 1999 --- ./conf/sample-rewrite.cf Thu Nov 4 20:53:12 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control address rewriting. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-smtp.cf ./conf/sample-smtp.cf *** ../postfix-19990906-pl05/conf/sample-smtp.cf Thu Apr 8 19:41:40 1999 --- ./conf/sample-smtp.cf Thu Nov 4 20:53:15 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control the SMTP client program. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-smtpd.cf ./conf/sample-smtpd.cf *** ../postfix-19990906-pl05/conf/sample-smtpd.cf Mon Sep 6 18:37:56 1999 --- ./conf/sample-smtpd.cf Thu Nov 4 20:53:18 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration parameters # that control the SMTP server program. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-transport.cf ./conf/sample-transport.cf *** ../postfix-19990906-pl05/conf/sample-transport.cf Mon Dec 21 18:40:23 1998 --- ./conf/sample-transport.cf Thu Nov 4 20:53:21 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control the optional transport table lookups. diff -cr --new-file ../postfix-19990906-pl05/conf/sample-virtual.cf ./conf/sample-virtual.cf *** ../postfix-19990906-pl05/conf/sample-virtual.cf Mon Dec 21 18:40:34 1998 --- ./conf/sample-virtual.cf Thu Nov 4 20:53:25 1999 *************** *** 1,3 **** --- 1,6 ---- + # DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE STUFF + # HERE JUST SERVES AS AN EXAMPLE. + # # This file contains example settings of Postfix configuration # parameters that control virtual database lookups. diff -cr --new-file ../postfix-19990906-pl05/dns/.indent.pro ./dns/.indent.pro *** ../postfix-19990906-pl05/dns/.indent.pro Thu Jun 24 20:07:30 1999 --- ./dns/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/error/.indent.pro ./error/.indent.pro *** ../postfix-19990906-pl05/error/.indent.pro Thu Jun 24 20:07:30 1999 --- ./error/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/fsstone/.indent.pro ./fsstone/.indent.pro *** ../postfix-19990906-pl05/fsstone/.indent.pro Thu Jun 24 20:07:30 1999 --- ./fsstone/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/global/.indent.pro ./global/.indent.pro *** ../postfix-19990906-pl05/global/.indent.pro Thu Jun 24 20:07:30 1999 --- ./global/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/global/mail_copy.c ./global/mail_copy.c *** ../postfix-19990906-pl05/global/mail_copy.c Fri Mar 26 08:40:31 1999 --- ./global/mail_copy.c Sat Nov 6 18:47:42 1999 *************** *** 33,39 **** /* The binary OR of zero or more of the following: /* .RS /* .IP MAIL_COPY_QUOTE ! /* prepend a `>' character to lines beginning with `From '. /* .IP MAIL_COPY_TOFILE /* On systems that support this, use fsync() to flush the /* data to stable storage, and truncate the destination --- 33,41 ---- /* The binary OR of zero or more of the following: /* .RS /* .IP MAIL_COPY_QUOTE ! /* Prepend a `>' character to lines beginning with `From '. ! /* .IP MAIL_COPY_DOT ! /* Prepend a `.' character to lines beginning with `.'. /* .IP MAIL_COPY_TOFILE /* On systems that support this, use fsync() to flush the /* data to stable storage, and truncate the destination *************** *** 166,171 **** --- 168,175 ---- bp = vstring_str(buf); if ((flags & MAIL_COPY_QUOTE) && *bp == 'F' && !strncmp(bp, "From ", 5)) VSTREAM_PUTC('>', dst); + if ((flags & MAIL_COPY_DOT) && *bp == '.') + VSTREAM_PUTC('.', dst); if (VSTRING_LEN(buf) && VSTREAM_FWRITE_BUF(dst, buf) != VSTRING_LEN(buf)) break; if (type == REC_TYPE_NORM && VSTREAM_PUTC('\n', dst) == VSTREAM_EOF) diff -cr --new-file ../postfix-19990906-pl05/global/mail_copy.h ./global/mail_copy.h *** ../postfix-19990906-pl05/global/mail_copy.h Thu Mar 4 10:10:57 1999 --- ./global/mail_copy.h Thu Nov 4 20:33:56 1999 *************** *** 28,34 **** #define MAIL_COPY_FROM (1<<2) /* prepend From_ */ #define MAIL_COPY_DELIVERED (1<<3) /* prepend Delivered-To: */ #define MAIL_COPY_RETURN_PATH (1<<4) /* prepend Return-Path: */ ! #define MAIL_COPY_MBOX (~0) /* all turned on */ #define MAIL_COPY_NONE 0 /* all turned off */ /* LICENSE --- 28,35 ---- #define MAIL_COPY_FROM (1<<2) /* prepend From_ */ #define MAIL_COPY_DELIVERED (1<<3) /* prepend Delivered-To: */ #define MAIL_COPY_RETURN_PATH (1<<4) /* prepend Return-Path: */ ! #define MAIL_COPY_DOT (1<<5) /* escape dots - needed for bsmtp */ ! #define MAIL_COPY_MBOX (~MAIL_COPY_DOT) /* all except dots */ #define MAIL_COPY_NONE 0 /* all turned off */ /* LICENSE diff -cr --new-file ../postfix-19990906-pl05/html/mailq.1.html ./html/mailq.1.html *** ../postfix-19990906-pl05/html/mailq.1.html Sun Sep 5 23:13:48 1999 --- ./html/mailq.1.html Thu Nov 4 20:58:21 1999 *************** *** 100,105 **** --- 100,108 ---- Log mailer traffic. Use the debug_peer_list and debug_peer_level configuration parameters instead. + -U (ignored) + Initial user submission. + -bd Go into daemon mode. This mode of operation is implemented by executing the postfix start command. *************** *** 121,129 **** address where delivery problems are sent to, unless the message contains an Errors-To: message header. - -h hop_count (ignored) - Hop count limit. Use the hopcount_limit configura- - tion parameter instead. --- 124,129 ---- *************** *** 137,142 **** --- 137,146 ---- SENDMAIL(1) SENDMAIL(1) + -h hop_count (ignored) + Hop count limit. Use the hopcount_limit configura- + tion parameter instead. + -i (ignored) Lines beginning with "." get special treatment only with -bs. *************** *** 187,196 **** SECURITY By design, this program is not set-user (or group) id. - However, it must handle data from untrusted users or - untrusted machines. Thus, the usual precautions need to - be taken against malicious inputs. - --- 191,196 ---- *************** *** 203,208 **** --- 203,212 ---- SENDMAIL(1) SENDMAIL(1) + However, it must handle data from untrusted users or + untrusted machines. Thus, the usual precautions need to + be taken against malicious inputs. + DIAGNOSTICS Problems are logged to syslogd(8) and to the standard error stream. *************** *** 252,262 **** debug_peer_list List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose log- ! ging level by the amount specified in the ! debug_peer_level parameter. ! ! --- 256,262 ---- debug_peer_list List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose *************** *** 269,274 **** --- 269,277 ---- SENDMAIL(1) SENDMAIL(1) + logging level by the amount specified in the + debug_peer_level parameter. + fork_attempts Number of attempts to fork() a process before giv- ing up. *************** *** 320,332 **** Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA ! 5 --- 323,398 ---- Wietse Venema IBM T.J. Watson Research P.O. Box 704 + + + + 5 + + + + + + SENDMAIL(1) SENDMAIL(1) + + Yorktown Heights, NY 10598, USA ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 6 diff -cr --new-file ../postfix-19990906-pl05/html/newaliases.1.html ./html/newaliases.1.html *** ../postfix-19990906-pl05/html/newaliases.1.html Sun Sep 5 23:13:48 1999 --- ./html/newaliases.1.html Thu Nov 4 20:58:21 1999 *************** *** 100,105 **** --- 100,108 ---- Log mailer traffic. Use the debug_peer_list and debug_peer_level configuration parameters instead. + -U (ignored) + Initial user submission. + -bd Go into daemon mode. This mode of operation is implemented by executing the postfix start command. *************** *** 121,129 **** address where delivery problems are sent to, unless the message contains an Errors-To: message header. - -h hop_count (ignored) - Hop count limit. Use the hopcount_limit configura- - tion parameter instead. --- 124,129 ---- *************** *** 137,142 **** --- 137,146 ---- SENDMAIL(1) SENDMAIL(1) + -h hop_count (ignored) + Hop count limit. Use the hopcount_limit configura- + tion parameter instead. + -i (ignored) Lines beginning with "." get special treatment only with -bs. *************** *** 187,196 **** SECURITY By design, this program is not set-user (or group) id. - However, it must handle data from untrusted users or - untrusted machines. Thus, the usual precautions need to - be taken against malicious inputs. - --- 191,196 ---- *************** *** 203,208 **** --- 203,212 ---- SENDMAIL(1) SENDMAIL(1) + However, it must handle data from untrusted users or + untrusted machines. Thus, the usual precautions need to + be taken against malicious inputs. + DIAGNOSTICS Problems are logged to syslogd(8) and to the standard error stream. *************** *** 252,262 **** debug_peer_list List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose log- ! ging level by the amount specified in the ! debug_peer_level parameter. ! ! --- 256,262 ---- debug_peer_list List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose *************** *** 269,274 **** --- 269,277 ---- SENDMAIL(1) SENDMAIL(1) + logging level by the amount specified in the + debug_peer_level parameter. + fork_attempts Number of attempts to fork() a process before giv- ing up. *************** *** 320,332 **** Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA ! 5 --- 323,398 ---- Wietse Venema IBM T.J. Watson Research P.O. Box 704 + + + + 5 + + + + + + SENDMAIL(1) SENDMAIL(1) + + Yorktown Heights, NY 10598, USA ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 6 diff -cr --new-file ../postfix-19990906-pl05/html/pipe.8.html ./html/pipe.8.html *** ../postfix-19990906-pl05/html/pipe.8.html Tue Aug 31 17:24:58 1999 --- ./html/pipe.8.html Sun Nov 7 11:34:23 1999 *************** *** 30,36 **** file at the end of a service definition. The syntax is as follows: ! flags=FR> (optional) Optional message processing flags. By default, a message is copied unchanged. --- 30,36 ---- file at the end of a service definition. The syntax is as follows: ! flags=FR.> (optional) Optional message processing flags. By default, a message is copied unchanged. *************** *** 43,49 **** R Prepend a Return-Path: message header with the envelope sender address. ! > Prepend > to lines starting with "From ". This is expected by, for example, UUCP soft- ware. --- 43,52 ---- 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. *************** *** 51,65 **** 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 of username. - argv=command... (required) - The command to be executed. This must be specified - 1 --- 54,65 ---- 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 of username. 1 *************** *** 71,101 **** PIPE(8) PIPE(8) 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} --- 71,103 ---- PIPE(8) PIPE(8) + 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} *************** *** 103,130 **** ${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 address. ${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 --- 105,130 ---- ${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 address. ${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. *************** *** 137,196 **** PIPE(8) PIPE(8) ! conventions 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 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 bounce(8) non-delivery status reports master(8) process manager qmgr(8) queue manager - syslogd(8) system logging - --- 137,196 ---- PIPE(8) PIPE(8) ! 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 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 bounce(8) non-delivery status reports master(8) process manager qmgr(8) queue manager *************** *** 203,210 **** PIPE(8) PIPE(8) LICENSE ! The Secure Mailer license must be distributed with this software. AUTHOR(S) --- 203,212 ---- PIPE(8) PIPE(8) + syslogd(8) system logging + LICENSE ! The Secure Mailer license must be distributed with this software. AUTHOR(S) *************** *** 212,219 **** IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA - - --- 214,219 ---- diff -cr --new-file ../postfix-19990906-pl05/html/postalias.1.html ./html/postalias.1.html *** ../postfix-19990906-pl05/html/postalias.1.html Sun Sep 5 23:13:48 1999 --- ./html/postalias.1.html Sun Nov 7 11:34:24 1999 *************** *** 9,23 **** postalias - Postfix alias database maintenance SYNOPSIS ! postalias [-c config_dir] [-i] [-v] [-w] [file_type:]file_name ... DESCRIPTION ! The postalias command creates a new Postfix alias ! database, or updates an existing one. The input and output ! file formats are expected to be compatible with Sendmail ! version 8, and are expected to be suitable for the use as ! NIS alias maps. While a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on --- 9,23 ---- postalias - Postfix alias database maintenance SYNOPSIS ! postalias [-ivw] [-c config_dir] [-q key] [file_type:]file_name ... DESCRIPTION ! The postalias command creates or queries one or more Post- ! fix alias databases, or updates an existing one. The input ! and output file formats are expected to be compatible with ! Sendmail version 8, and are expected to be suitable for ! the use as NIS alias maps. While a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on *************** *** 35,42 **** default, postalias creates a new database from the entries in file_name. -v Enable verbose logging for debugging purposes. Mul- ! tiple -v options make the software increasingly verbose. -w Do not warn about duplicate entries; silently --- 35,47 ---- default, postalias creates a new database from the entries in file_name. + -q key Search the specified maps for key and print the + first value found on the standard output stream. + The exit status is non-zero if the requested infor- + mation was not found. + -v Enable verbose logging for debugging purposes. Mul- ! tiple -v options make the software increasingly verbose. -w Do not warn about duplicate entries; silently *************** *** 47,65 **** file_type The type of database to be produced. ! btree The output is a btree file, named ! file_name.db. This is available only on ! systems with support for db databases. ! ! dbm The output consists of two files, named ! file_name.pag and file_name.dir. This is ! available only on systems with support for ! dbm databases. ! ! hash The output is a hashed file, named file_name.db. This is available only on systems with support for db databases. 1 --- 52,65 ---- file_type The type of database to be produced. ! btree The output is a btree file, named file_name.db. This is available only on systems with support for db databases. + dbm The output consists of two files, named + file_name.pag and file_name.dir. This is + available only on systems with support for + 1 *************** *** 71,87 **** POSTALIAS(1) POSTALIAS(1) ! When no file_type is specified, the software uses ! the database type specified via the database_type ! configuration parameter. The default value for this parameter depends on the host environment. file_name ! The name of the alias database source file when rebuilding a database. DIAGNOSTICS ! Problems are logged to the standard error stream. No out- put means no problems were detected. Duplicate entries are skipped and are flagged with a warning. --- 71,93 ---- POSTALIAS(1) POSTALIAS(1) ! dbm databases. ! ! hash The output is a hashed file, named ! file_name.db. This is available only on ! systems with support for db databases. ! ! When no file_type is specified, the software uses ! the database type specified via the database_type ! configuration parameter. The default value for this parameter depends on the host environment. file_name ! The name of the alias database source file when rebuilding a database. DIAGNOSTICS ! Problems are logged to the standard error stream. No out- put means no problems were detected. Duplicate entries are skipped and are flagged with a warning. *************** *** 93,104 **** Enable verbose logging for debugging purposes. 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. database_type ! Default alias database type. On many UNIX systems, the default type is either dbm or hash. STANDARDS --- 99,110 ---- Enable verbose logging for debugging purposes. 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. database_type ! Default alias database type. On many UNIX systems, the default type is either dbm or hash. STANDARDS *************** *** 109,115 **** sendmail(1) mail posting and compatibility interface. LICENSE ! The Secure Mailer license must be distributed with this software. AUTHOR(S) --- 115,121 ---- sendmail(1) mail posting and compatibility interface. LICENSE ! The Secure Mailer license must be distributed with this software. AUTHOR(S) *************** *** 117,128 **** IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA - - - - - - --- 123,128 ---- diff -cr --new-file ../postfix-19990906-pl05/html/postmap.1.html ./html/postmap.1.html *** ../postfix-19990906-pl05/html/postmap.1.html Sun Sep 5 23:13:52 1999 --- ./html/postmap.1.html Sun Nov 7 11:34:24 1999 *************** *** 9,21 **** postmap - Postfix lookup table management SYNOPSIS ! postmap [-c config_dir] [-i] [-v] [-w] ! [file_type:]file_name DESCRIPTION ! The postmap command creates a new Postfix lookup table, or ! updates an existing one. The input and output formats are ! expected to be compatible with: makemap file_type file_name < file_name --- 9,21 ---- postmap - Postfix lookup table management SYNOPSIS ! postmap [-ivw] [-c config_dir] [-q key] ! [file_type:]file_name ... DESCRIPTION ! The postmap command creates or queries one or more Postfix ! lookup tables, or updates an existing one. The input and ! output file formats are expected to be compatible with: makemap file_type file_name < file_name *************** *** 54,64 **** default, postmap creates a new database from the entries in file_name. ! -v Enable verbose logging for debugging purposes. Mul- ! tiple -v options make the software increasingly ! verbose. - B-w Do not warn about duplicate entries; silently --- 54,64 ---- default, postmap creates a new database from the entries in file_name. ! -q key Search the specified maps for key and print the ! first value found on the standard output stream. ! The exit status is non-zero if the requested infor- ! mation was not found. *************** *** 71,76 **** --- 71,81 ---- POSTMAP(1) POSTMAP(1) + -v Enable verbose logging for debugging purposes. Mul- + tiple -v options make the software increasingly + verbose. + + -w Do not warn about duplicate entries; silently ignore them. Arguments: *************** *** 78,102 **** file_type The type of database to be produced. ! btree The output file is a btree file, named ! file_name.db. This is available only on systems with support for db databases. ! dbm The output consists of two files, named ! file_name.pag and file_name.dir. This is ! available only on systems with support for dbm databases. ! hash The output file is a hashed file, named ! file_name.db. This is available only on systems with support for db databases. ! When no file_type is specified, the software uses ! the database type specified via the database_type configuration parameter. file_name ! The name of the lookup table source file when rebuilding a database. DIAGNOSTICS --- 83,107 ---- file_type The type of database to be produced. ! btree The output file is a btree file, named ! file_name.db. This is available only on systems with support for db databases. ! dbm The output consists of two files, named ! file_name.pag and file_name.dir. This is ! available only on systems with support for dbm databases. ! hash The output file is a hashed file, named ! file_name.db. This is available only on systems with support for db databases. ! When no file_type is specified, the software uses ! the database type specified via the database_type configuration parameter. file_name ! The name of the lookup table source file when rebuilding a database. DIAGNOSTICS *************** *** 113,131 **** CONFIGURATION PARAMETERS database_type ! Default output database type. On many UNIX sys- ! tems, the default database type is either hash or dbm. LICENSE ! The Secure Mailer license must be distributed with this software. - AUTHOR(S) - Wietse Venema - IBM T.J. Watson Research - P.O. Box 704 - 2 --- 118,131 ---- CONFIGURATION PARAMETERS database_type ! Default output database type. On many UNIX sys- ! tems, the default database type is either hash or dbm. LICENSE ! The Secure Mailer license must be distributed with this software. 2 *************** *** 137,147 **** POSTMAP(1) POSTMAP(1) Yorktown Heights, NY 10598, USA - - - - --- 137,147 ---- POSTMAP(1) POSTMAP(1) + AUTHOR(S) + Wietse Venema + IBM T.J. Watson Research + P.O. Box 704 Yorktown Heights, NY 10598, USA diff -cr --new-file ../postfix-19990906-pl05/html/sendmail.1.html ./html/sendmail.1.html *** ../postfix-19990906-pl05/html/sendmail.1.html Sun Sep 5 23:13:48 1999 --- ./html/sendmail.1.html Thu Nov 4 20:58:21 1999 *************** *** 100,105 **** --- 100,108 ---- Log mailer traffic. Use the debug_peer_list and debug_peer_level configuration parameters instead. + -U (ignored) + Initial user submission. + -bd Go into daemon mode. This mode of operation is implemented by executing the postfix start command. *************** *** 121,129 **** address where delivery problems are sent to, unless the message contains an Errors-To: message header. - -h hop_count (ignored) - Hop count limit. Use the hopcount_limit configura- - tion parameter instead. --- 124,129 ---- *************** *** 137,142 **** --- 137,146 ---- SENDMAIL(1) SENDMAIL(1) + -h hop_count (ignored) + Hop count limit. Use the hopcount_limit configura- + tion parameter instead. + -i (ignored) Lines beginning with "." get special treatment only with -bs. *************** *** 187,196 **** SECURITY By design, this program is not set-user (or group) id. - However, it must handle data from untrusted users or - untrusted machines. Thus, the usual precautions need to - be taken against malicious inputs. - --- 191,196 ---- *************** *** 203,208 **** --- 203,212 ---- SENDMAIL(1) SENDMAIL(1) + However, it must handle data from untrusted users or + untrusted machines. Thus, the usual precautions need to + be taken against malicious inputs. + DIAGNOSTICS Problems are logged to syslogd(8) and to the standard error stream. *************** *** 252,262 **** debug_peer_list List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose log- ! ging level by the amount specified in the ! debug_peer_level parameter. ! ! --- 256,262 ---- debug_peer_list List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose *************** *** 269,274 **** --- 269,277 ---- SENDMAIL(1) SENDMAIL(1) + logging level by the amount specified in the + debug_peer_level parameter. + fork_attempts Number of attempts to fork() a process before giv- ing up. *************** *** 320,332 **** Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA ! 5 --- 323,398 ---- Wietse Venema IBM T.J. Watson Research P.O. Box 704 + + + + 5 + + + + + + SENDMAIL(1) SENDMAIL(1) + + Yorktown Heights, NY 10598, USA ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 6 diff -cr --new-file ../postfix-19990906-pl05/local/.indent.pro ./local/.indent.pro *** ../postfix-19990906-pl05/local/.indent.pro Thu Jun 24 20:07:30 1999 --- ./local/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/man/man1/postalias.1 ./man/man1/postalias.1 *** ../postfix-19990906-pl05/man/man1/postalias.1 Sun Sep 5 23:13:31 1999 --- ./man/man1/postalias.1 Sun Nov 7 11:34:15 1999 *************** *** 9,23 **** .na .nf .fi ! \fBpostalias\fR [\fB-c \fIconfig_dir\fR] [\fB-i\fR] [\fB-v\fR] ! [\fB-w\fR] [\fIfile_type\fR:]\fIfile_name\fR ... .SH DESCRIPTION .ad .fi ! The \fBpostalias\fR command creates a new Postfix alias database, ! or updates an existing one. The input and output file formats ! are expected to be compatible with Sendmail version 8, and are ! expected to be suitable for the use as NIS alias maps. While a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the --- 9,23 ---- .na .nf .fi ! \fBpostalias\fR [\fB-ivw\fR] [\fB-c \fIconfig_dir\fR] [\fB-q \fIkey\fR] ! [\fIfile_type\fR:]\fIfile_name\fR ... .SH DESCRIPTION .ad .fi ! The \fBpostalias\fR command creates or queries one or more Postfix ! alias databases, or updates an existing one. The input and output ! file formats are expected to be compatible with Sendmail version 8, ! and are expected to be suitable for the use as NIS alias maps. While a database update is in progress, signal delivery is postponed, and an exclusive, advisory, lock is placed on the *************** *** 31,36 **** --- 31,40 ---- Incremental mode. Read entries from standard input and do not truncate an existing database. By default, \fBpostalias\fR creates a new database from the entries in \fBfile_name\fR. + .IP "\fB-q \fIkey\fR" + Search the specified maps for \fIkey\fR and print the first value + found on the standard output stream. The exit status is non-zero + if the requested information was not found. .IP \fB-v\fR Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. diff -cr --new-file ../postfix-19990906-pl05/man/man1/postmap.1 ./man/man1/postmap.1 *** ../postfix-19990906-pl05/man/man1/postmap.1 Sun Sep 5 23:13:32 1999 --- ./man/man1/postmap.1 Sun Nov 7 11:34:15 1999 *************** *** 9,22 **** .na .nf .fi ! \fBpostmap\fR [\fB-c \fIconfig_dir\fR] [\fB-i\fR] [\fB-v\fR] ! [\fB-w\fR] [\fIfile_type\fR:]\fIfile_name\fR .SH DESCRIPTION .ad .fi ! The \fBpostmap\fR command creates a new Postfix lookup table, ! or updates an existing one. The input and output formats are ! expected to be compatible with: .ti +4 \fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR --- 9,22 ---- .na .nf .fi ! \fBpostmap\fR [\fB-ivw\fR] [\fB-c \fIconfig_dir\fR] [\fB-q \fIkey\fR] ! [\fIfile_type\fR:]\fIfile_name\fR ... .SH DESCRIPTION .ad .fi ! The \fBpostmap\fR command creates or queries one or more Postfix ! lookup tables, or updates an existing one. The input and output ! file formats are expected to be compatible with: .ti +4 \fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR *************** *** 50,59 **** Incremental mode. Read entries from standard input and do not truncate an existing database. By default, \fBpostmap\fR creates a new database from the entries in \fBfile_name\fR. .IP \fB-v\fR Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. ! .IP \f\B-w\fR Do not warn about duplicate entries; silently ignore them. .PP Arguments: --- 50,63 ---- Incremental mode. Read entries from standard input and do not truncate an existing database. By default, \fBpostmap\fR creates a new database from the entries in \fBfile_name\fR. + .IP "\fB-q \fIkey\fR" + Search the specified maps for \fIkey\fR and print the first value + found on the standard output stream. The exit status is non-zero + if the requested information was not found. .IP \fB-v\fR Enable verbose logging for debugging purposes. Multiple \fB-v\fR options make the software increasingly verbose. ! .IP \fB-w\fR Do not warn about duplicate entries; silently ignore them. .PP Arguments: diff -cr --new-file ../postfix-19990906-pl05/man/man1/sendmail.1 ./man/man1/sendmail.1 *** ../postfix-19990906-pl05/man/man1/sendmail.1 Sun Sep 5 23:13:32 1999 --- ./man/man1/sendmail.1 Thu Nov 4 20:58:15 1999 *************** *** 76,81 **** --- 76,83 ---- .IP "\fB-X \fIlog_file\fR (ignored)" Log mailer traffic. Use the \fBdebug_peer_list\fR and \fBdebug_peer_level\fR configuration parameters instead. + .IP "\fB-U\fR (ignored)" + Initial user submission. .IP \fB-bd\fR Go into daemon mode. This mode of operation is implemented by executing the \fBpostfix start\fR command. diff -cr --new-file ../postfix-19990906-pl05/man/man8/pipe.8 ./man/man8/pipe.8 *** ../postfix-19990906-pl05/man/man8/pipe.8 Tue Aug 31 17:25:06 1999 --- ./man/man8/pipe.8 Sun Nov 7 11:34:15 1999 *************** *** 30,36 **** .fi The external command attributes are given in the \fBmaster.cf\fR file at the end of a service definition. The syntax is as follows: ! .IP "\fBflags=FR>\fR (optional)" Optional message processing flags. By default, a message is copied unchanged. .RS --- 30,36 ---- .fi The external command attributes are given in the \fBmaster.cf\fR file at the end of a service definition. The syntax is as follows: ! .IP "\fBflags=FR.>\fR (optional)" Optional message processing flags. By default, a message is copied unchanged. .RS *************** *** 42,47 **** --- 42,50 ---- .IP \fBR\fR Prepend a \fBReturn-Path:\fR message header with the envelope sender address. + .IP \fB.\fR + Prepend \fB.\fR to lines starting with "\fB.\fR". This is needed + by, for example, \fBBSMTP\fR software. .IP \fB>\fR Prepend \fB>\fR to lines starting with "\fBFrom \fR". This is expected by, for example, \fBUUCP\fR software. diff -cr --new-file ../postfix-19990906-pl05/master/.indent.pro ./master/.indent.pro *** ../postfix-19990906-pl05/master/.indent.pro Thu Jun 24 20:07:30 1999 --- ./master/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/master/Makefile.in ./master/Makefile.in *** ../postfix-19990906-pl05/master/Makefile.in Sun Sep 5 22:36:07 1999 --- ./master/Makefile.in Sun Nov 7 12:43:21 1999 *************** *** 90,95 **** --- 90,96 ---- master.o: ../include/vstream.h master.o: ../include/stringops.h master.o: ../include/myflock.h + master.o: ../include/watchdog.h master.o: ../include/mail_params.h master.o: ../include/debug_process.h master.o: ../include/mail_task.h *************** *** 202,207 **** --- 203,209 ---- multi_server.o: ../include/sane_accept.h multi_server.o: ../include/myflock.h multi_server.o: ../include/safe_open.h + multi_server.o: ../include/watchdog.h multi_server.o: ../include/mail_task.h multi_server.o: ../include/debug_process.h multi_server.o: ../include/mail_params.h *************** *** 227,232 **** --- 229,235 ---- single_server.o: ../include/myflock.h single_server.o: ../include/safe_open.h single_server.o: ../include/listen.h + single_server.o: ../include/watchdog.h single_server.o: ../include/mail_params.h single_server.o: ../include/mail_task.h single_server.o: ../include/debug_process.h *************** *** 252,257 **** --- 255,261 ---- trigger_server.o: ../include/myflock.h trigger_server.o: ../include/safe_open.h trigger_server.o: ../include/listen.h + trigger_server.o: ../include/watchdog.h trigger_server.o: ../include/mail_params.h trigger_server.o: ../include/mail_task.h trigger_server.o: ../include/debug_process.h diff -cr --new-file ../postfix-19990906-pl05/master/master.c ./master/master.c *** ../postfix-19990906-pl05/master/master.c Sun Sep 5 18:13:57 1999 --- ./master/master.c Thu Nov 4 14:16:59 1999 *************** *** 142,147 **** --- 142,148 ---- #include #include #include + #include /* Global library. */ *************** *** 155,173 **** #include "master.h" - /* master_watchdog - something got stuck */ - - static NORETURN master_watchdog(int unused_sig) - { - - /* - * This runs as a signal handler. We should not do anything that could - * involve memory managent, but exiting without explanation would be - * worse. - */ - msg_fatal("watchdog timer"); - } - int main(int argc, char **argv) { static VSTREAM *lock_fp; --- 156,161 ---- *************** *** 180,185 **** --- 168,174 ---- int test_lock = 0; int fd_limit = open_limit(0); VSTRING *why; + WATCHDOG *watchdog; /* * Initialize. *************** *** 332,344 **** * multiple things at the same time, it really is all a single thread, so * that there are no concurrency conflicts within the master process. */ ! signal(SIGALRM, master_watchdog); for (;;) { #ifdef HAS_VOLATILE_LOCKS if (myflock(vstream_fileno(lock_fp), MYFLOCK_EXCLUSIVE) < 0) msg_fatal("refresh exclusive lock: %m"); #endif ! alarm(1000); /* same as trigger servers */ event_loop(-1); if (master_gotsighup) { msg_info("reload configuration"); --- 321,333 ---- * multiple things at the same time, it really is all a single thread, so * that there are no concurrency conflicts within the master process. */ ! watchdog = watchdog_create(1000, (WATCHDOG_FN) 0, (char *) 0); for (;;) { #ifdef HAS_VOLATILE_LOCKS if (myflock(vstream_fileno(lock_fp), MYFLOCK_EXCLUSIVE) < 0) msg_fatal("refresh exclusive lock: %m"); #endif ! watchdog_start(watchdog); /* same as trigger servers */ event_loop(-1); if (master_gotsighup) { msg_info("reload configuration"); diff -cr --new-file ../postfix-19990906-pl05/master/multi_server.c ./master/multi_server.c *** ../postfix-19990906-pl05/master/multi_server.c Fri Apr 30 15:35:20 1999 --- ./master/multi_server.c Fri Nov 5 09:36:13 1999 *************** *** 144,149 **** --- 144,150 ---- #include #include #include + #include /* Global library. */ *************** *** 185,203 **** exit(0); } - /* multi_server_watchdog - something got stuck */ - - static NORETURN multi_server_watchdog(int unused_sig) - { - - /* - * This runs as a signal handler. We should not do anything that could - * involve memory managent, but exiting without explanation would be - * worse. - */ - msg_fatal("watchdog timer"); - } - /* multi_server_abort - terminate after abnormal master exit */ static void multi_server_abort(int unused_event, char *unused_context) --- 186,191 ---- *************** *** 275,286 **** int fd; /* - * Some buggy systems cause Postfix to lock up. - */ - signal(SIGALRM, multi_server_watchdog); - alarm(var_daemon_timeout); - - /* * Be prepared for accept() to fail because some other process already * got the connection (the number of processes competing for clients is * kept small, so this is not a "thundering herd" problem). If the --- 263,268 ---- *************** *** 315,326 **** int fd; /* - * Some buggy systems cause Postfix to lock up. - */ - signal(SIGALRM, multi_server_watchdog); - alarm(var_daemon_timeout); - - /* * Be prepared for accept() to fail because some other process already * got the connection (the number of processes competing for clients is * kept small, so this is not a "thundering herd" problem). If the --- 297,302 ---- *************** *** 369,374 **** --- 345,351 ---- char *lock_path; VSTRING *why; int alone = 0; + WATCHDOG *watchdog; /* * Process environment options as early as we can. *************** *** 585,595 **** } event_enable_read(MASTER_STATUS_FD, multi_server_abort, (char *) 0); close_on_exec(MASTER_STATUS_FD, CLOSE_ON_EXEC); while (var_use_limit == 0 || use_count < var_use_limit || client_count > 0) { delay = loop ? loop(multi_server_name, multi_server_argv) : -1; - if (multi_server_lock != 0 - && myflock(vstream_fileno(multi_server_lock), MYFLOCK_EXCLUSIVE) < 0) - msg_fatal("select lock: %m"); event_loop(delay); } multi_server_exit(); --- 562,580 ---- } event_enable_read(MASTER_STATUS_FD, multi_server_abort, (char *) 0); close_on_exec(MASTER_STATUS_FD, CLOSE_ON_EXEC); + watchdog = watchdog_create(var_daemon_timeout, (WATCHDOG_FN) 0, (char *) 0); + + /* + * The event loop, at last. + */ while (var_use_limit == 0 || use_count < var_use_limit || client_count > 0) { + if (multi_server_lock != 0) { + watchdog_stop(watchdog); + if (myflock(vstream_fileno(multi_server_lock), MYFLOCK_EXCLUSIVE) < 0) + msg_fatal("select lock: %m"); + } + watchdog_start(watchdog); delay = loop ? loop(multi_server_name, multi_server_argv) : -1; event_loop(delay); } multi_server_exit(); diff -cr --new-file ../postfix-19990906-pl05/master/single_server.c ./master/single_server.c *** ../postfix-19990906-pl05/master/single_server.c Fri Apr 30 15:32:43 1999 --- ./master/single_server.c Fri Nov 5 09:36:20 1999 *************** *** 135,140 **** --- 135,141 ---- #include #include #include + #include /* Global library. */ *************** *** 175,193 **** exit(0); } - /* single_server_watchdog - something got stuck */ - - static NORETURN single_server_watchdog(int unused_sig) - { - - /* - * This runs as a signal handler. We should not do anything that could - * involve memory managent, but exiting without explanation would be - * worse. - */ - msg_fatal("watchdog timer"); - } - /* single_server_abort - terminate after abnormal master exit */ static void single_server_abort(int unused_event, char *unused_context) --- 176,181 ---- *************** *** 246,257 **** int fd; /* - * Some buggy systems cause Postfix to lock up. - */ - signal(SIGALRM, single_server_watchdog); - alarm(var_daemon_timeout); - - /* * Be prepared for accept() to fail because some other process already * got the connection. We use select() + accept(), instead of simply * blocking in accept(), because we must be able to detect that the --- 234,239 ---- *************** *** 285,296 **** int fd; /* - * Some buggy systems cause Postfix to lock up. - */ - signal(SIGALRM, single_server_watchdog); - alarm(var_daemon_timeout); - - /* * Be prepared for accept() to fail because some other process already * got the connection. We use select() + accept(), instead of simply * blocking in accept(), because we must be able to detect that the --- 267,272 ---- *************** *** 338,343 **** --- 314,320 ---- char *lock_path; VSTRING *why; int alone = 0; + WATCHDOG *watchdog; /* * Process environment options as early as we can. *************** *** 554,564 **** } event_enable_read(MASTER_STATUS_FD, single_server_abort, (char *) 0); close_on_exec(MASTER_STATUS_FD, CLOSE_ON_EXEC); while (var_use_limit == 0 || use_count < var_use_limit) { delay = loop ? loop(single_server_name, single_server_argv) : -1; - if (single_server_lock != 0 - && myflock(vstream_fileno(single_server_lock), MYFLOCK_EXCLUSIVE) < 0) - msg_fatal("select lock: %m"); event_loop(delay); } single_server_exit(); --- 531,549 ---- } event_enable_read(MASTER_STATUS_FD, single_server_abort, (char *) 0); close_on_exec(MASTER_STATUS_FD, CLOSE_ON_EXEC); + watchdog = watchdog_create(var_daemon_timeout, (WATCHDOG_FN) 0, (char *) 0); + + /* + * The event loop, at last. + */ while (var_use_limit == 0 || use_count < var_use_limit) { + if (single_server_lock != 0) { + watchdog_stop(watchdog); + if (myflock(vstream_fileno(single_server_lock), MYFLOCK_EXCLUSIVE) < 0) + msg_fatal("select lock: %m"); + } + watchdog_start(watchdog); delay = loop ? loop(single_server_name, single_server_argv) : -1; event_loop(delay); } single_server_exit(); diff -cr --new-file ../postfix-19990906-pl05/master/trigger_server.c ./master/trigger_server.c *** ../postfix-19990906-pl05/master/trigger_server.c Fri Apr 30 15:36:30 1999 --- ./master/trigger_server.c Sat Nov 6 09:57:01 1999 *************** *** 143,148 **** --- 143,149 ---- #include #include #include + #include /* Global library. */ *************** *** 182,200 **** exit(0); } - /* trigger_server_watchdog - something got stuck */ - - static NORETURN trigger_server_watchdog(int unused_sig) - { - - /* - * This runs as a signal handler. We should not do anything that could - * involve memory managent, but exiting without explanation would be - * worse. - */ - msg_fatal("watchdog timer"); - } - /* trigger_server_abort - terminate after abnormal master exit */ static void trigger_server_abort(int unused_event, char *unused_context) --- 183,188 ---- *************** *** 250,261 **** msg_info("%s: trigger arrived", myname); /* - * Some buggy systems cause Postfix to lock up. - */ - signal(SIGALRM, trigger_server_watchdog); - alarm(1000); - - /* * Read whatever the other side wrote into the FIFO. The FIFO read end is * non-blocking so we won't get stuck when multiple processes wake up. */ --- 238,243 ---- *************** *** 278,289 **** msg_info("%s: trigger arrived", myname); /* - * Some buggy systems cause Postfix to lock up. - */ - signal(SIGALRM, trigger_server_watchdog); - alarm(1000); - - /* * Read a message from a socket. Be prepared for accept() to fail because * some other process already got the connection. The socket is * non-blocking so we won't get stuck when multiple processes wake up. --- 260,265 ---- *************** *** 339,344 **** --- 315,321 ---- char *lock_path; VSTRING *why; int alone = 0; + WATCHDOG *watchdog; /* * Process environment options as early as we can. *************** *** 566,576 **** } event_enable_read(MASTER_STATUS_FD, trigger_server_abort, (char *) 0); close_on_exec(MASTER_STATUS_FD, CLOSE_ON_EXEC); while (var_use_limit == 0 || use_count < var_use_limit) { delay = loop ? loop(trigger_server_name, trigger_server_argv) : -1; - if (trigger_server_lock != 0 - && myflock(vstream_fileno(trigger_server_lock), MYFLOCK_EXCLUSIVE) < 0) - msg_fatal("select lock: %m"); event_loop(delay); } trigger_server_exit(); --- 543,561 ---- } event_enable_read(MASTER_STATUS_FD, trigger_server_abort, (char *) 0); close_on_exec(MASTER_STATUS_FD, CLOSE_ON_EXEC); + watchdog = watchdog_create(1000, (WATCHDOG_FN) 0, (char *) 0); + + /* + * The event loop, at last. + */ while (var_use_limit == 0 || use_count < var_use_limit) { + if (trigger_server_lock != 0) { + watchdog_stop(watchdog); + if (myflock(vstream_fileno(trigger_server_lock), MYFLOCK_EXCLUSIVE) < 0) + msg_fatal("select lock: %m"); + } + watchdog_start(watchdog); delay = loop ? loop(trigger_server_name, trigger_server_argv) : -1; event_loop(delay); } trigger_server_exit(); diff -cr --new-file ../postfix-19990906-pl05/pickup/.indent.pro ./pickup/.indent.pro *** ../postfix-19990906-pl05/pickup/.indent.pro Thu Jun 24 20:07:30 1999 --- ./pickup/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/pickup/pickup.c ./pickup/pickup.c *** ../postfix-19990906-pl05/pickup/pickup.c Fri Sep 3 16:07:56 1999 --- ./pickup/pickup.c Thu Nov 4 09:51:42 1999 *************** *** 140,146 **** static int cleanup_service_error(PICKUP_INFO *info, int status) { msg_warn("%s: %s", info->path, cleanup_strerror(status)); ! return (status == CLEANUP_STAT_BAD ? REMOVE_MESSAGE_FILE : KEEP_MESSAGE_FILE); } --- 140,146 ---- static int cleanup_service_error(PICKUP_INFO *info, int status) { msg_warn("%s: %s", info->path, cleanup_strerror(status)); ! return ((status & CLEANUP_STAT_BAD) ? REMOVE_MESSAGE_FILE : KEEP_MESSAGE_FILE); } *************** *** 345,354 **** * easier to implement the many possible error exits without forgetting * to close files, or to release memory. */ buf = vstring_alloc(100); cleanup = mail_connect_wait(MAIL_CLASS_PRIVATE, MAIL_SERVICE_CLEANUP); if (mail_scan(cleanup, "%s", buf) != 1 ! || mail_print(cleanup, "%d", CLEANUP_FLAG_BOUNCE) != 0) { status = KEEP_MESSAGE_FILE; } else { info->id = mystrdup(vstring_str(buf)); --- 345,356 ---- * easier to implement the many possible error exits without forgetting * to close files, or to release memory. */ + #define PICKUP_CLEANUP_FLAGS (CLEANUP_FLAG_BOUNCE | CLEANUP_FLAG_FILTER) + buf = vstring_alloc(100); cleanup = mail_connect_wait(MAIL_CLASS_PRIVATE, MAIL_SERVICE_CLEANUP); if (mail_scan(cleanup, "%s", buf) != 1 ! || mail_print(cleanup, "%d", PICKUP_CLEANUP_FLAGS) != 0) { status = KEEP_MESSAGE_FILE; } else { info->id = mystrdup(vstring_str(buf)); diff -cr --new-file ../postfix-19990906-pl05/pipe/.indent.pro ./pipe/.indent.pro *** ../postfix-19990906-pl05/pipe/.indent.pro Thu Jun 24 20:07:30 1999 --- ./pipe/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/pipe/pipe.c ./pipe/pipe.c *** ../postfix-19990906-pl05/pipe/pipe.c Tue Aug 31 13:48:13 1999 --- ./pipe/pipe.c Sat Nov 6 09:58:19 1999 *************** *** 22,28 **** /* .fi /* The external command attributes are given in the \fBmaster.cf\fR /* file at the end of a service definition. The syntax is as follows: ! /* .IP "\fBflags=FR>\fR (optional)" /* Optional message processing flags. By default, a message is /* copied unchanged. /* .RS --- 22,28 ---- /* .fi /* The external command attributes are given in the \fBmaster.cf\fR /* file at the end of a service definition. The syntax is as follows: ! /* .IP "\fBflags=FR.>\fR (optional)" /* Optional message processing flags. By default, a message is /* copied unchanged. /* .RS *************** *** 34,39 **** --- 34,42 ---- /* .IP \fBR\fR /* Prepend a \fBReturn-Path:\fR message header with the envelope sender /* address. + /* .IP \fB.\fR + /* Prepend \fB.\fR to lines starting with "\fB.\fR". This is needed + /* by, for example, \fBBSMTP\fR software. /* .IP \fB>\fR /* Prepend \fB>\fR to lines starting with "\fBFrom \fR". This is expected /* by, for example, \fBUUCP\fR software. *************** *** 429,434 **** --- 432,440 ---- switch (*cp) { case 'F': attr->flags |= MAIL_COPY_FROM; + break; + case '.': + attr->flags |= MAIL_COPY_DOT; break; case '>': attr->flags |= MAIL_COPY_QUOTE; diff -cr --new-file ../postfix-19990906-pl05/postalias/.indent.pro ./postalias/.indent.pro *** ../postfix-19990906-pl05/postalias/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postalias/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postalias/postalias.c ./postalias/postalias.c *** ../postfix-19990906-pl05/postalias/postalias.c Sun Sep 5 18:06:08 1999 --- ./postalias/postalias.c Sat Nov 6 10:25:26 1999 *************** *** 5,17 **** /* Postfix alias database maintenance /* SYNOPSIS /* .fi ! /* \fBpostalias\fR [\fB-c \fIconfig_dir\fR] [\fB-i\fR] [\fB-v\fR] ! /* [\fB-w\fR] [\fIfile_type\fR:]\fIfile_name\fR ... /* DESCRIPTION ! /* The \fBpostalias\fR command creates a new Postfix alias database, ! /* or updates an existing one. The input and output file formats ! /* are expected to be compatible with Sendmail version 8, and are ! /* expected to be suitable for the use as NIS alias maps. /* /* While a database update is in progress, signal delivery is /* postponed, and an exclusive, advisory, lock is placed on the --- 5,17 ---- /* Postfix alias database maintenance /* SYNOPSIS /* .fi ! /* \fBpostalias\fR [\fB-ivw\fR] [\fB-c \fIconfig_dir\fR] [\fB-q \fIkey\fR] ! /* [\fIfile_type\fR:]\fIfile_name\fR ... /* DESCRIPTION ! /* The \fBpostalias\fR command creates or queries one or more Postfix ! /* alias databases, or updates an existing one. The input and output ! /* file formats are expected to be compatible with Sendmail version 8, ! /* and are expected to be suitable for the use as NIS alias maps. /* /* While a database update is in progress, signal delivery is /* postponed, and an exclusive, advisory, lock is placed on the *************** *** 25,30 **** --- 25,34 ---- /* Incremental mode. Read entries from standard input and do not /* truncate an existing database. By default, \fBpostalias\fR creates /* a new database from the entries in \fBfile_name\fR. + /* .IP "\fB-q \fIkey\fR" + /* Search the specified maps for \fIkey\fR and print the first value + /* found on the standard output stream. The exit status is non-zero + /* if the requested information was not found. /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. *************** *** 272,282 **** vstream_fclose(source_fp); } /* usage - explain */ static NORETURN usage(char *myname) { ! msg_fatal("usage: %s [-c config_dir] [-i] [-v] [-w] [output_type:]file...", myname); } --- 276,303 ---- vstream_fclose(source_fp); } + /* postalias_query - query a map and print the result to stdout */ + + static int postalias_query(const char *map_type, const char *map_name, + const char *key) + { + DICT *dict; + const char *value; + + dict = dict_open3(map_type, map_name, O_RDONLY, DICT_FLAG_LOCK); + if ((value = dict_get(dict, key)) != 0) { + vstream_printf("%s\n", value); + vstream_fflush(VSTREAM_OUT); + } + dict_close(dict); + return (value != 0); + } + /* usage - explain */ static NORETURN usage(char *myname) { ! msg_fatal("usage: %s [-ivw] [-c config_dir] [-q key] [map_type:]file...", myname); } *************** *** 289,294 **** --- 310,317 ---- struct stat st; int open_flags = O_RDWR | O_CREAT | O_TRUNC; int dict_flags = DICT_FLAG_DUP_WARN; + char *query = 0; + int found; /* * Be consistent with file permissions. *************** *** 323,329 **** /* * Parse JCL. */ ! while ((ch = GETOPT(argc, argv, "c:ivw")) > 0) { switch (ch) { default: usage(argv[0]); --- 346,352 ---- /* * Parse JCL. */ ! while ((ch = GETOPT(argc, argv, "c:iq:vw")) > 0) { switch (ch) { default: usage(argv[0]); *************** *** 335,340 **** --- 358,366 ---- case 'i': open_flags &= ~O_TRUNC; break; + case 'q': + query = optarg; + break; case 'v': msg_verbose++; break; *************** *** 350,364 **** * Use the map type specified by the user, or fall back to a default * database type. */ ! if (optind + 1 > argc) ! usage(argv[0]); ! while (optind < argc) { ! if ((path_name = split_at(argv[optind], ':')) != 0) { ! postalias(argv[optind], path_name, open_flags, dict_flags); ! } else { ! postalias(var_db_type, argv[optind], open_flags, dict_flags); } ! optind++; } - exit(0); } --- 376,406 ---- * Use the map type specified by the user, or fall back to a default * database type. */ ! if (query == 0) { /* create/update map(s) */ ! if (optind + 1 > argc) ! usage(argv[0]); ! while (optind < argc) { ! if ((path_name = split_at(argv[optind], ':')) != 0) { ! postalias(argv[optind], path_name, open_flags, dict_flags); ! } else { ! postalias(var_db_type, argv[optind], open_flags, dict_flags); ! } ! optind++; ! } ! exit(0); ! } else { /* query map(s) */ ! if (optind + 1 > argc) ! usage(argv[0]); ! while (optind < argc) { ! if ((path_name = split_at(argv[optind], ':')) != 0) { ! found = postalias_query(argv[optind], path_name, query); ! } else { ! found = postalias_query(var_db_type, argv[optind], query); ! } ! if (found) ! exit(0); ! optind++; } ! exit(1); } } diff -cr --new-file ../postfix-19990906-pl05/postcat/.indent.pro ./postcat/.indent.pro *** ../postfix-19990906-pl05/postcat/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postcat/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postconf/.indent.pro ./postconf/.indent.pro *** ../postfix-19990906-pl05/postconf/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postconf/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postdrop/.indent.pro ./postdrop/.indent.pro *** ../postfix-19990906-pl05/postdrop/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postdrop/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postfix/.indent.pro ./postfix/.indent.pro *** ../postfix-19990906-pl05/postfix/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postfix/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postkick/.indent.pro ./postkick/.indent.pro *** ../postfix-19990906-pl05/postkick/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postkick/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postlock/.indent.pro ./postlock/.indent.pro *** ../postfix-19990906-pl05/postlock/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postlock/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postlock/Makefile.in ./postlock/Makefile.in *** ../postfix-19990906-pl05/postlock/Makefile.in Sun Sep 5 22:38:19 1999 --- ./postlock/Makefile.in Sun Nov 7 12:44:11 1999 *************** *** 65,67 **** --- 65,68 ---- postlock.o: ../include/dot_lockfile.h postlock.o: ../include/deliver_flock.h postlock.o: ../include/mail_conf.h + postlock.o: ../include/sys_exits.h diff -cr --new-file ../postfix-19990906-pl05/postlog/.indent.pro ./postlog/.indent.pro *** ../postfix-19990906-pl05/postlog/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postlog/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postmap/.indent.pro ./postmap/.indent.pro *** ../postfix-19990906-pl05/postmap/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postmap/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/postmap/postmap.c ./postmap/postmap.c *** ../postfix-19990906-pl05/postmap/postmap.c Sun Sep 5 18:09:55 1999 --- ./postmap/postmap.c Sat Nov 6 10:23:43 1999 *************** *** 5,16 **** /* Postfix lookup table management /* SYNOPSIS /* .fi ! /* \fBpostmap\fR [\fB-c \fIconfig_dir\fR] [\fB-i\fR] [\fB-v\fR] ! /* [\fB-w\fR] [\fIfile_type\fR:]\fIfile_name\fR /* DESCRIPTION ! /* The \fBpostmap\fR command creates a new Postfix lookup table, ! /* or updates an existing one. The input and output formats are ! /* expected to be compatible with: /* /* .ti +4 /* \fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR --- 5,16 ---- /* Postfix lookup table management /* SYNOPSIS /* .fi ! /* \fBpostmap\fR [\fB-ivw\fR] [\fB-c \fIconfig_dir\fR] [\fB-q \fIkey\fR] ! /* [\fIfile_type\fR:]\fIfile_name\fR ... /* DESCRIPTION ! /* The \fBpostmap\fR command creates or queries one or more Postfix ! /* lookup tables, or updates an existing one. The input and output ! /* file formats are expected to be compatible with: /* /* .ti +4 /* \fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR *************** *** 44,53 **** /* Incremental mode. Read entries from standard input and do not /* truncate an existing database. By default, \fBpostmap\fR creates /* a new database from the entries in \fBfile_name\fR. /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. ! /* .IP \f\B-w\fR /* Do not warn about duplicate entries; silently ignore them. /* .PP /* Arguments: --- 44,57 ---- /* Incremental mode. Read entries from standard input and do not /* truncate an existing database. By default, \fBpostmap\fR creates /* a new database from the entries in \fBfile_name\fR. + /* .IP "\fB-q \fIkey\fR" + /* Search the specified maps for \fIkey\fR and print the first value + /* found on the standard output stream. The exit status is non-zero + /* if the requested information was not found. /* .IP \fB-v\fR /* Enable verbose logging for debugging purposes. Multiple \fB-v\fR /* options make the software increasingly verbose. ! /* .IP \fB-w\fR /* Do not warn about duplicate entries; silently ignore them. /* .PP /* Arguments: *************** *** 226,236 **** vstream_fclose(source_fp); } /* usage - explain */ static NORETURN usage(char *myname) { ! msg_fatal("usage: %s [-c config_dir] [-i] [-v] [-w] [output_type:]file...", myname); } --- 230,257 ---- vstream_fclose(source_fp); } + /* postmap_query - query a map and print the result to stdout */ + + static int postmap_query(const char *map_type, const char *map_name, + const char *key) + { + DICT *dict; + const char *value; + + dict = dict_open3(map_type, map_name, O_RDONLY, DICT_FLAG_LOCK); + if ((value = dict_get(dict, key)) != 0) { + vstream_printf("%s\n", value); + vstream_fflush(VSTREAM_OUT); + } + dict_close(dict); + return (value != 0); + } + /* usage - explain */ static NORETURN usage(char *myname) { ! msg_fatal("usage: %s [-ivw] [-c config_dir] [-q key] [map_type:]file...", myname); } *************** *** 243,248 **** --- 264,271 ---- struct stat st; int open_flags = O_RDWR | O_CREAT | O_TRUNC; int dict_flags = DICT_FLAG_DUP_WARN; + char *query = 0; + int found; /* * Be consistent with file permissions. *************** *** 277,283 **** /* * Parse JCL. */ ! while ((ch = GETOPT(argc, argv, "c:ivw")) > 0) { switch (ch) { default: usage(argv[0]); --- 300,306 ---- /* * Parse JCL. */ ! while ((ch = GETOPT(argc, argv, "c:iq:vw")) > 0) { switch (ch) { default: usage(argv[0]); *************** *** 289,294 **** --- 312,320 ---- case 'i': open_flags &= ~O_TRUNC; break; + case 'q': + query = optarg; + break; case 'v': msg_verbose++; break; *************** *** 304,318 **** * Use the map type specified by the user, or fall back to a default * database type. */ ! if (optind + 1 > argc) ! usage(argv[0]); ! while (optind < argc) { ! if ((path_name = split_at(argv[optind], ':')) != 0) { ! postmap(argv[optind], path_name, open_flags, dict_flags); ! } else { ! postmap(var_db_type, argv[optind], open_flags, dict_flags); } ! optind++; } - exit(0); } --- 330,360 ---- * Use the map type specified by the user, or fall back to a default * database type. */ ! if (query == 0) { /* create/update map(s) */ ! if (optind + 1 > argc) ! usage(argv[0]); ! while (optind < argc) { ! if ((path_name = split_at(argv[optind], ':')) != 0) { ! postmap(argv[optind], path_name, open_flags, dict_flags); ! } else { ! postmap(var_db_type, argv[optind], open_flags, dict_flags); ! } ! optind++; ! } ! exit(0); ! } else { /* query map(s) */ ! if (optind + 1 > argc) ! usage(argv[0]); ! while (optind < argc) { ! if ((path_name = split_at(argv[optind], ':')) != 0) { ! found = postmap_query(argv[optind], path_name, query); ! } else { ! found = postmap_query(var_db_type, argv[optind], query); ! } ! if (found) ! exit(0); ! optind++; } ! exit(1); } } diff -cr --new-file ../postfix-19990906-pl05/postsuper/.indent.pro ./postsuper/.indent.pro *** ../postfix-19990906-pl05/postsuper/.indent.pro Thu Jun 24 20:07:30 1999 --- ./postsuper/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/qmgr/.indent.pro ./qmgr/.indent.pro *** ../postfix-19990906-pl05/qmgr/.indent.pro Thu Jun 24 20:07:30 1999 --- ./qmgr/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/sendmail/.indent.pro ./sendmail/.indent.pro *** ../postfix-19990906-pl05/sendmail/.indent.pro Thu Jun 24 20:07:30 1999 --- ./sendmail/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/sendmail/sendmail.c ./sendmail/sendmail.c *** ../postfix-19990906-pl05/sendmail/sendmail.c Sun Sep 5 18:11:35 1999 --- ./sendmail/sendmail.c Thu Nov 4 20:57:48 1999 *************** *** 70,75 **** --- 70,77 ---- /* .IP "\fB-X \fIlog_file\fR (ignored)" /* Log mailer traffic. Use the \fBdebug_peer_list\fR and /* \fBdebug_peer_level\fR configuration parameters instead. + /* .IP "\fB-U\fR (ignored)" + /* Initial user submission. /* .IP \fB-bd\fR /* Go into daemon mode. This mode of operation is implemented by /* executing the \fBpostfix start\fR command. *************** *** 660,666 **** optind++; continue; } ! if ((c = GETOPT(argc, argv, "B:C:F:IN:R:X:b:ce:f:h:imno:p:r:q:tvx")) <= 0) break; switch (c) { default: --- 662,668 ---- optind++; continue; } ! if ((c = GETOPT(argc, argv, "B:C:F:IN:R:UX:b:ce:f:h:imno:p:r:q:tvx")) <= 0) break; switch (c) { default: diff -cr --new-file ../postfix-19990906-pl05/showq/.indent.pro ./showq/.indent.pro *** ../postfix-19990906-pl05/showq/.indent.pro Thu Jun 24 20:07:30 1999 --- ./showq/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/smtp/.indent.pro ./smtp/.indent.pro *** ../postfix-19990906-pl05/smtp/.indent.pro Thu Jun 24 20:07:30 1999 --- ./smtp/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/smtpd/.indent.pro ./smtpd/.indent.pro *** ../postfix-19990906-pl05/smtpd/.indent.pro Thu Jun 24 20:07:30 1999 --- ./smtpd/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/smtpd/smtpd.c ./smtpd/smtpd.c *** ../postfix-19990906-pl05/smtpd/smtpd.c Wed Jun 23 21:14:24 1999 --- ./smtpd/smtpd.c Thu Nov 4 09:47:32 1999 *************** *** 387,393 **** state->dest = mail_stream_service(MAIL_CLASS_PRIVATE, MAIL_SERVICE_CLEANUP); if (state->dest == 0 ! || mail_print(state->dest->stream, "%d", CLEANUP_FLAG_NONE) != 0) msg_fatal("unable to connect to the %s %s service", MAIL_CLASS_PRIVATE, MAIL_SERVICE_CLEANUP); } --- 387,393 ---- state->dest = mail_stream_service(MAIL_CLASS_PRIVATE, MAIL_SERVICE_CLEANUP); if (state->dest == 0 ! || mail_print(state->dest->stream, "%d", CLEANUP_FLAG_FILTER) != 0) msg_fatal("unable to connect to the %s %s service", MAIL_CLASS_PRIVATE, MAIL_SERVICE_CLEANUP); } *************** *** 591,600 **** int first = 1; /* ! * Sanity checks. */ if (state->rcpt_count == 0) { ! state->error_mask |= MAIL_ERROR_PROTOCOL; smtpd_chat_reply(state, "503 Error: need RCPT command"); return (-1); } --- 591,603 ---- int first = 1; /* ! * Sanity checks. With ESMTP command pipelining the client can send DATA ! * before all recipients are rejected, so don't report that as a protocol ! * error. */ if (state->rcpt_count == 0) { ! if (state->cleanup == 0) ! state->error_mask |= MAIL_ERROR_PROTOCOL; smtpd_chat_reply(state, "503 Error: need RCPT command"); return (-1); } diff -cr --new-file ../postfix-19990906-pl05/smtpd/smtpd_check.c ./smtpd/smtpd_check.c *** ../postfix-19990906-pl05/smtpd/smtpd_check.c Tue Sep 7 15:17:10 1999 --- ./smtpd/smtpd_check.c Sat Nov 6 09:42:33 1999 *************** *** 1373,1391 **** * Sender mail address restrictions. */ if (is_map_command(name, CHECK_SENDER_ACL, cpp)) { ! if (state->sender) *status = check_mail_access(state, **cpp, state->sender, state->sender, SMTPD_NAME_SENDER); return (1); } if (strcasecmp(name, REJECT_UNKNOWN_ADDRESS) == 0) { ! if (state->sender) *status = reject_unknown_address(state, state->sender, state->sender, SMTPD_NAME_SENDER); return (1); } if (strcasecmp(name, REJECT_UNKNOWN_SENDDOM) == 0) { ! if (state->sender) *status = reject_unknown_address(state, state->sender, state->sender, SMTPD_NAME_SENDER); return (1); --- 1373,1391 ---- * Sender mail address restrictions. */ if (is_map_command(name, CHECK_SENDER_ACL, cpp)) { ! if (state->sender && *state->sender) *status = check_mail_access(state, **cpp, state->sender, state->sender, SMTPD_NAME_SENDER); return (1); } if (strcasecmp(name, REJECT_UNKNOWN_ADDRESS) == 0) { ! if (state->sender && *state->sender) *status = reject_unknown_address(state, state->sender, state->sender, SMTPD_NAME_SENDER); return (1); } if (strcasecmp(name, REJECT_UNKNOWN_SENDDOM) == 0) { ! if (state->sender && *state->sender) *status = reject_unknown_address(state, state->sender, state->sender, SMTPD_NAME_SENDER); return (1); diff -cr --new-file ../postfix-19990906-pl05/smtpstone/.indent.pro ./smtpstone/.indent.pro *** ../postfix-19990906-pl05/smtpstone/.indent.pro Thu Jun 24 20:07:30 1999 --- ./smtpstone/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/trivial-rewrite/.indent.pro ./trivial-rewrite/.indent.pro *** ../postfix-19990906-pl05/trivial-rewrite/.indent.pro Thu Jun 24 20:07:30 1999 --- ./trivial-rewrite/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/util/.indent.pro ./util/.indent.pro *** ../postfix-19990906-pl05/util/.indent.pro Thu Jun 24 20:07:30 1999 --- ./util/.indent.pro Thu Nov 4 13:35:03 1999 *************** *** 105,108 **** --- 105,109 ---- -TVSTREAM_POPEN_ARGS -TVSTRING -TWAIT_STATUS_T + -TWATCHDOG -TWATCH_FD diff -cr --new-file ../postfix-19990906-pl05/util/Makefile.in ./util/Makefile.in *** ../postfix-19990906-pl05/util/Makefile.in Sun Sep 5 22:34:02 1999 --- ./util/Makefile.in Sun Nov 7 12:42:37 1999 *************** *** 20,26 **** vstream.c vstream_popen.c vstring.c vstring_vstream.c writable.c \ write_buf.c write_wait.c dict_unix.c dict_pcre.c stream_listen.c \ stream_connect.c stream_trigger.c dict_regexp.c mac_expand.c \ ! clean_env.c OBJS = argv.o argv_split.o attr.o basename.o binhash.o chroot_uid.o \ close_on_exec.o concatenate.o dict.o dict_db.o dict_dbm.o \ dict_env.o dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \ --- 20,26 ---- vstream.c vstream_popen.c vstring.c vstring_vstream.c writable.c \ write_buf.c write_wait.c dict_unix.c dict_pcre.c stream_listen.c \ stream_connect.c stream_trigger.c dict_regexp.c mac_expand.c \ ! clean_env.c watchdog.c OBJS = argv.o argv_split.o attr.o basename.o binhash.o chroot_uid.o \ close_on_exec.o concatenate.o dict.o dict_db.o dict_dbm.o \ dict_env.o dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \ *************** *** 42,48 **** vstream.o vstream_popen.o vstring.o vstring_vstream.o writable.o \ write_buf.o write_wait.o dict_unix.o dict_pcre.o stream_listen.o \ stream_connect.o stream_trigger.o dict_regexp.o mac_expand.o \ ! clean_env.o HDRS = argv.h attr.h binhash.h chroot_uid.h connect.h dict.h dict_db.h \ dict_dbm.h dict_env.h dict_ht.h dict_ldap.h dict_mysql.h \ dict_ni.h dict_nis.h dict_nisplus.h dir_forest.h events.h \ --- 42,48 ---- vstream.o vstream_popen.o vstring.o vstring_vstream.o writable.o \ write_buf.o write_wait.o dict_unix.o dict_pcre.o stream_listen.o \ stream_connect.o stream_trigger.o dict_regexp.o mac_expand.o \ ! clean_env.o watchdog.o HDRS = argv.h attr.h binhash.h chroot_uid.h connect.h dict.h dict_db.h \ dict_dbm.h dict_env.h dict_ht.h dict_ldap.h dict_mysql.h \ dict_ni.h dict_nis.h dict_nisplus.h dir_forest.h events.h \ *************** *** 56,62 **** sigdelay.h split_at.h stat_as.h stringops.h sys_defs.h \ timed_connect.h timed_wait.h trigger.h username.h valid_hostname.h \ vbuf.h vbuf_print.h vstream.h vstring.h vstring_vstream.h \ ! dict_unix.h dict_pcre.h dict_regexp.h mac_expand.h clean_env.h TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \ stream_test.c dup2_pass_on_exec.c WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \ --- 56,63 ---- sigdelay.h split_at.h stat_as.h stringops.h sys_defs.h \ timed_connect.h timed_wait.h trigger.h username.h valid_hostname.h \ vbuf.h vbuf_print.h vstream.h vstring.h vstring_vstream.h \ ! dict_unix.h dict_pcre.h dict_regexp.h mac_expand.h clean_env.h \ ! watchdog.h TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \ stream_test.c dup2_pass_on_exec.c WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \ *************** *** 71,77 **** 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 \ ! vstring vstring_vstream doze select_bug stream_test mac_expand LIB_DIR = ../lib INC_DIR = ../include --- 72,79 ---- 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 \ ! vstring vstring_vstream doze select_bug stream_test mac_expand \ ! watchdog LIB_DIR = ../lib INC_DIR = ../include *************** *** 240,245 **** --- 242,252 ---- $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS) mv junk $@.o + watchdog: $(LIB) + mv $@.o junk + $(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(SYSLIBS) + mv junk $@.o + depend: $(MAKES) (sed '1,/^# do not edit/!d' Makefile.in; \ set -e; for i in [a-z][a-z0-9]*.c; do \ *************** *** 852,857 **** --- 859,869 ---- vstring_vstream.o: vbuf.h vstring_vstream.o: vstream.h vstring_vstream.o: vstring_vstream.h + watchdog.o: watchdog.c + watchdog.o: sys_defs.h + watchdog.o: msg.h + watchdog.o: mymalloc.h + watchdog.o: watchdog.h writable.o: writable.c writable.o: sys_defs.h writable.o: msg.h diff -cr --new-file ../postfix-19990906-pl05/util/dict_ldap.c ./util/dict_ldap.c *** ../postfix-19990906-pl05/util/dict_ldap.c Sun Sep 5 16:03:58 1999 --- ./util/dict_ldap.c Fri Nov 5 09:38:23 1999 *************** *** 399,405 **** /* get configured value of "ldapsource_timeout"; default to 10 */ vstring_sprintf(config_param, "%s_timeout", ldapsource); ! dict_ldap->timeout = get_mail_conf_int(config_param, 10, 0, 0); if (msg_verbose) msg_info("%s: %s is %d", myname, vstring_str(config_param), dict_ldap->timeout); --- 399,405 ---- /* get configured value of "ldapsource_timeout"; default to 10 */ vstring_sprintf(config_param, "%s_timeout", ldapsource); ! dict_ldap->timeout = get_mail_conf_int(vstring_str(config_param), 10, 0, 0); if (msg_verbose) msg_info("%s: %s is %d", myname, vstring_str(config_param), dict_ldap->timeout); diff -cr --new-file ../postfix-19990906-pl05/util/dict_unix.c ./util/dict_unix.c *** ../postfix-19990906-pl05/util/dict_unix.c Mon Mar 29 13:42:34 1999 --- ./util/dict_unix.c Fri Nov 5 15:01:56 1999 *************** *** 19,24 **** --- 19,27 ---- /* .IP passwd.byname /* The table is the UNIX password database. The key is a login name. /* The result is a password file entry in passwd(5) format. + /* .IP group.byname + /* The table is the UNIX group database. The key is a group name. + /* The result is a group file entry in group(5) format. /* SEE ALSO /* dict(3) generic dictionary manager /* DIAGNOSTICS *************** *** 37,44 **** --- 40,49 ---- /* System library. */ #include "sys_defs.h" + #include #include #include + #include /* Utility library. */ *************** *** 76,81 **** --- 81,113 ---- } } + /* dict_unix_getgrnam - find group table entry */ + + static const char *dict_unix_getgrnam(DICT *unused_dict, const char *key) + { + struct group *grp; + static VSTRING *buf; + char **cpp; + + dict_errno = 0; + + if ((grp = getgrnam(key)) == 0) { + return (0); + } else { + if (buf == 0) + buf = vstring_alloc(10); + vstring_sprintf(buf, "%s:%s:%d:", + grp->gr_name, grp->gr_passwd, grp->gr_gid); + for (cpp = grp->gr_mem; *cpp; cpp++) { + vstring_strcat(buf, *cpp); + if (cpp[1]) + VSTRING_ADDCH(buf, ','); + } + VSTRING_TERMINATE(buf); + return (vstring_str(buf)); + } + } + /* dict_unix_update - add or update table entry */ static void dict_unix_update(DICT *dict, const char *unused_name, const char *unused_value) *************** *** 106,111 **** --- 138,144 ---- }; static struct dict_unix_lookup dict_unix_lookup[] = { "passwd.byname", dict_unix_getpwnam, + "group.byname", dict_unix_getgrnam, 0, }; struct dict_unix_lookup *lp; diff -cr --new-file ../postfix-19990906-pl05/util/inet_addr_local.c ./util/inet_addr_local.c *** ../postfix-19990906-pl05/util/inet_addr_local.c Fri Aug 27 08:08:43 1999 --- ./util/inet_addr_local.c Fri Nov 5 09:05:26 1999 *************** *** 72,83 **** { char *myname = "inet_addr_local"; struct ifconf ifc; - struct ifreq ifreq; struct ifreq *ifr; struct ifreq *the_end; int sock; VSTRING *buf = vstring_alloc(1024); int initial_count = addr_list->used; if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) < 0) msg_fatal("%s: socket: %m", myname); --- 72,83 ---- { char *myname = "inet_addr_local"; struct ifconf ifc; struct ifreq *ifr; struct ifreq *the_end; int sock; VSTRING *buf = vstring_alloc(1024); int initial_count = addr_list->used; + struct in_addr addr; if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) < 0) msg_fatal("%s: socket: %m", myname); *************** *** 109,128 **** } /* ! * Get the IP address of each active IP network interface. */ the_end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifr = ifc.ifc_req; ifr < the_end;) { if (ifr->ifr_addr.sa_family == AF_INET) { /* IP interface */ ! ifreq = *ifr; ! if (ioctl(sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) ! msg_fatal("%s: ioctl SIOCGIFFLAGS: %m", myname); ! if (ifreq.ifr_flags & IFF_UP) { /* active interface */ ! if (ioctl(sock, SIOCGIFADDR, (char *) &ifreq) < 0) ! msg_fatal("%s: ioctl SIOCGIFADDR: %m", myname); ! inet_addr_list_append(addr_list, ! &(((struct sockaddr_in *) & ifreq.ifr_addr)->sin_addr)); ! } } ifr = NEXT_INTERFACE(ifr); } --- 109,126 ---- } /* ! * Get the address of each IP network interface. According to BIND we ! * must include interfaces that are down because the machine may still ! * receive packets for that address (yes, via some other interface). ! * Having no way to verify this claim on every machine, I will give them ! * the benefit of the doubt. */ the_end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifr = ifc.ifc_req; ifr < the_end;) { if (ifr->ifr_addr.sa_family == AF_INET) { /* IP interface */ ! addr = ((struct sockaddr_in *) & ifr->ifr_addr)->sin_addr; ! if (addr.s_addr != INADDR_ANY) /* has IP address */ ! inet_addr_list_append(addr_list, &addr); } ifr = NEXT_INTERFACE(ifr); } diff -cr --new-file ../postfix-19990906-pl05/util/timed_wait.c ./util/timed_wait.c *** ../postfix-19990906-pl05/util/timed_wait.c Fri Dec 11 13:55:38 1998 --- ./util/timed_wait.c Thu Nov 4 12:22:11 1999 *************** *** 83,88 **** --- 83,89 ---- char *myname = "timed_waitpid"; struct sigaction action; struct sigaction old_action; + int time_left; int wpid; /* *************** *** 100,106 **** if (sigaction(SIGALRM, &action, &old_action) < 0) msg_fatal("%s: sigaction(SIGALRM): %m", myname); timed_wait_expired = 0; ! alarm(time_limit); /* * Wait for only a limited amount of time. --- 101,107 ---- if (sigaction(SIGALRM, &action, &old_action) < 0) msg_fatal("%s: sigaction(SIGALRM): %m", myname); timed_wait_expired = 0; ! time_left = alarm(time_limit); /* * Wait for only a limited amount of time. *************** *** 114,119 **** --- 115,122 ---- alarm(0); if (sigaction(SIGALRM, &old_action, (struct sigaction *) 0) < 0) msg_fatal("%s: sigaction(SIGALRM): %m", myname); + if (time_left) + alarm(time_left); return (wpid); } diff -cr --new-file ../postfix-19990906-pl05/util/watchdog.c ./util/watchdog.c *** ../postfix-19990906-pl05/util/watchdog.c Wed Dec 31 19:00:00 1969 --- ./util/watchdog.c Sun Nov 7 11:16:14 1999 *************** *** 0 **** --- 1,228 ---- + /*++ + /* NAME + /* watchdog 3 + /* SUMMARY + /* watchdog timer + /* SYNOPSIS + /* #include + /* + /* WATCHDOG *watchdog_create(timeout, action, context) + /* unsigned timeout; + /* void (*action)(WATCHDOG *watchdog, char *context); + /* char *context; + /* + /* void watchdog_start(watchdog) + /* WATCHDOG *watchdog; + /* + /* void watchdog_stop(watchdog) + /* WATCHDOG *watchdog; + /* + /* void watchdog_destroy(watchdog) + /* WATCHDOG *watchdog; + /* DESCRIPTION + /* This module implements watchdog timers that are based on ugly + /* UNIX alarm timers. The module is designed to survive systems + /* with clocks that jump occasionally. + /* + /* Watchdog timers can be stacked. Only one watchdog timer can be + /* active at a time. Only the last created watchdog timer can be + /* manipulated. Watchdog timers must be destroyed in reverse order + /* of creation. + /* + /* watchdog_create() suspends the current watchdog timer, if any, + /* and instantiates a new watchdog timer. + /* + /* watchdog_start() starts or restarts the watchdog timer. + /* + /* watchdog_stop() stops the watchdog timer. + /* + /* watchdog_destroy() stops the watchdog timer, and resumes the + /* watchdog timer instance that was suspended by watchdog_create(). + /* + /* Arguments: + /* .IP timeout + /* The watchdog time limit. When the watchdog timer runs, the + /* process must invoke watchdog_start(), watchdog_stop() or + /* watchdog_destroy() before the time limit is reached. + /* .IP action + /* A null pointer, or pointer to function that is called when the + /* watchdog alarm goes off. The default action is to terminate + /* the process with a fatal error. + /* .IP context + /* Application context that is passed to the action routine. + /* .IP watchdog + /* Must be a pointer to the most recently created watchdog instance. + /* This argument is checked upon each call. + /* BUGS + /* UNIX alarm timers are not stackable, so there can be at most one + /* watchdog instance active at any given time. + /* SEE ALSO + /* msg(3) diagnostics interface + /* DIAGNOSTICS + /* Fatal errors: memory allocation problem, system call failure. + /* Panics: interface violations. + /* LICENSE + /* .ad + /* .fi + /* The Secure Mailer license must be distributed with this software. + /* AUTHOR(S) + /* Wietse Venema + /* IBM T.J. Watson Research + /* P.O. Box 704 + /* Yorktown Heights, NY 10598, USA + /*--*/ + + /* System library. */ + + #include + #include + #include + + /* Utility library. */ + + #include + #include + #include + + /* Application-specific. */ + + /* + * Rather than having one timer that goes off when it is too late, we break + * up the time limit into smaller intervals so that we can deal with clocks + * that jump occasionally. + */ + #define WATCHDOG_STEPS 3 + + /* + * UNIX alarms are not stackable, but we can save and restore state, so that + * watchdogs can at least be nested, sort of. + */ + struct WATCHDOG { + unsigned timeout; /* our time resolution */ + WATCHDOG_FN action; /* application routine */ + char *context; /* application context */ + int trip_run; /* number of successive timeouts */ + WATCHDOG *saved_watchdog; /* saved state */ + struct sigaction saved_action; /* saved state */ + unsigned saved_time; /* saved state */ + }; + + /* + * However, only one watchdog instance can be current, and the caller has to + * restore state before a prior watchdog instance can be manipulated. + */ + static WATCHDOG *watchdog_curr; + + /* watchdog_event - handle timeout event */ + + static void watchdog_event(int unused_sig) + { + char *myname = "watchdog_event"; + WATCHDOG *wp; + + /* + * This routine runs as a signal handler. We should not do anything that + * could involve memory allocation/deallocation, but exiting without + * proper explanation would be unacceptable. + */ + 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 { + if (wp->action) + wp->action(wp, wp->context); + else + msg_fatal("watchdog timeout"); + } + } + + /* watchdog_create - create watchdog instance */ + + WATCHDOG *watchdog_create(unsigned timeout, WATCHDOG_FN action, char *context) + { + char *myname = "watchdog_create"; + struct sigaction sig_action; + WATCHDOG *wp; + + wp = (WATCHDOG *) mymalloc(sizeof(*wp)); + if ((wp->timeout = timeout / WATCHDOG_STEPS) == 0) + msg_panic("%s: timeout %d is too small", myname, timeout); + wp->action = action; + wp->context = context; + wp->saved_watchdog = watchdog_curr; + wp->saved_time = alarm(0); + sigemptyset(&sig_action.sa_mask); + sig_action.sa_flags = SA_RESTART; + sig_action.sa_handler = watchdog_event; + 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); + } + + /* watchdog_destroy - destroy watchdog instance, restore state */ + + void watchdog_destroy(WATCHDOG *wp) + { + char *myname = "watchdog_destroy"; + + watchdog_stop(wp); + watchdog_curr = wp->saved_watchdog; + if (sigaction(SIGALRM, &wp->saved_action, (struct sigaction *) 0) < 0) + msg_fatal("%s: sigaction(SIGALRM): %m", myname); + if (wp->saved_time) + alarm(wp->saved_time); + myfree((char *) wp); + if (msg_verbose) + msg_info("%s: %p", myname, (char *) wp); + } + + /* watchdog_start - enable watchdog timer */ + + void watchdog_start(WATCHDOG *wp) + { + char *myname = "watchdog_start"; + + if (wp != watchdog_curr) + msg_panic("%s: wrong watchdog instance", myname); + wp->trip_run = 0; + alarm(wp->timeout); + if (msg_verbose) + msg_info("%s: %p", myname, (char *) wp); + } + + /* watchdog_stop - disable watchdog timer */ + + void watchdog_stop(WATCHDOG *wp) + { + char *myname = "watchdog_stop"; + + if (wp != watchdog_curr) + msg_panic("%s: wrong watchdog instance", myname); + alarm(0); + if (msg_verbose) + msg_info("%s: %p", myname, (char *) wp); + } + + #ifdef TEST + + #include + + main(int unused_argc, char **unused_argv) + { + WATCHDOG *wp; + + msg_verbose = 1; + + wp = watchdog_create(10, (WATCHDOG_FN) 0, (char *) 0); + do { + watchdog_start(wp); + } while (VSTREAM_GETCHAR() != VSTREAM_EOF); + watchdog_destroy(wp); + } + + #endif diff -cr --new-file ../postfix-19990906-pl05/util/watchdog.h ./util/watchdog.h *** ../postfix-19990906-pl05/util/watchdog.h Wed Dec 31 19:00:00 1969 --- ./util/watchdog.h Thu Nov 4 14:00:43 1999 *************** *** 0 **** --- 1,35 ---- + #ifndef _WATCHDOG_H_INCLUDED_ + #define _WATCHDOG_H_INCLUDED_ + + /*++ + /* NAME + /* watchdog 3h + /* SUMMARY + /* watchdog timer + /* SYNOPSIS + /* #include "watchdog.h" + DESCRIPTION + .nf + + /* + * External interface. + */ + typedef struct WATCHDOG WATCHDOG; + typedef void (*WATCHDOG_FN) (WATCHDOG *, char *); + extern WATCHDOG *watchdog_create(unsigned, WATCHDOG_FN, char *); + extern void watchdog_start(WATCHDOG *); + extern void watchdog_stop(WATCHDOG *); + extern void watchdog_destroy(WATCHDOG *); + + /* LICENSE + /* .ad + /* .fi + /* The Secure Mailer license must be distributed with this software. + /* AUTHOR(S) + /* Wietse Venema + /* IBM T.J. Watson Research + /* P.O. Box 704 + /* Yorktown Heights, NY 10598, USA + /*--*/ + + #endif