From: Wietse Venema Date: Mon, 26 Apr 1999 05:00:00 +0000 (-0500) Subject: snapshot-19990426 X-Git-Tag: v20010228~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86906c64f067d786e12bbea4b21e422ee1653c84;p=thirdparty%2Fpostfix.git snapshot-19990426 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 54133a830..937953528 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -2664,3 +2664,20 @@ Apologies for any names omitted. Prindeville, Mirapoint, Inc., USA. This copies a lot of code from pipe_command(); the next step is to trim that module. + +19990425 + + Workaround: renamed config.h to mail_conf.h etc. in order + to avoid name collisions with LINUX (yes, they have a system + include file calle config.h). For compatibility with people + who have written software for Postfix, there's a config.h + that aliases the old names to the new ones. That file will + go away eventually. + +19990426 + + Feature: error mailer, in order to easily bounce mail for + specific destinations. In the transport table, specify: + "host.domain error:host.domain is unavailable". Too bad + that the transport table triggers on destination domain + only; it would be nice to bounce specific users as well. diff --git a/postfix/Makefile.in b/postfix/Makefile.in index cccfb2469..f4a8a419e 100644 --- a/postfix/Makefile.in +++ b/postfix/Makefile.in @@ -1,7 +1,7 @@ SHELL = /bin/sh WARN = -Wmissing-prototypes OPTS = "CC=$(CC)" -DIRS = util global dns master postfix smtpstone fsstone sendmail \ +DIRS = util global dns master postfix smtpstone fsstone sendmail error \ pickup cleanup smtpd local trivial-rewrite qmgr smtp bounce pipe \ showq postalias postcat postconf postdrop postkick postlock postlog \ postmap postsuper # man html diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 784b74480..4baa9ed89 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,4 +1,4 @@ -Incompatible changes with snapshot-19990423: +Incompatible changes with snapshot-19990426: =========================================== - If an address extension (+foo) matches a user's .forward+foo file @@ -6,7 +6,7 @@ name, the +foo extension is no longer appended to recipient addresses listed in the .forward+foo file. This is more consistent with the way Postfix expands aliases. -Major changes with snapshot-19990423: +Major changes with snapshot-19990426: ===================================== In addition to several little bugfixes, none related to security, diff --git a/postfix/bounce/Makefile.in b/postfix/bounce/Makefile.in index d9d93153a..cb252a20f 100644 --- a/postfix/bounce/Makefile.in +++ b/postfix/bounce/Makefile.in @@ -67,7 +67,7 @@ bounce.o: ../include/mail_proto.h bounce.o: ../include/iostuff.h bounce.o: ../include/mail_queue.h bounce.o: ../include/mail_params.h -bounce.o: ../include/config.h +bounce.o: ../include/mail_conf.h bounce.o: ../include/bounce.h bounce.o: ../include/mail_server.h bounce.o: bounce_service.h @@ -112,7 +112,7 @@ bounce_notify_service.o: ../include/canon_addr.h bounce_notify_service.o: ../include/is_header.h bounce_notify_service.o: ../include/record.h bounce_notify_service.o: ../include/rec_type.h -bounce_notify_service.o: ../include/config.h +bounce_notify_service.o: ../include/mail_conf.h bounce_notify_service.o: ../include/post_mail.h bounce_notify_service.o: ../include/cleanup_user.h bounce_notify_service.o: ../include/mail_addr.h diff --git a/postfix/bounce/bounce.c b/postfix/bounce/bounce.c index 8f1300a53..1faca975b 100644 --- a/postfix/bounce/bounce.c +++ b/postfix/bounce/bounce.c @@ -92,7 +92,7 @@ #include #include #include -#include +#include #include /* Single-threaded server skeleton. */ diff --git a/postfix/bounce/bounce_notify_service.c b/postfix/bounce/bounce_notify_service.c index 5144bd8a6..47c9d4f3f 100644 --- a/postfix/bounce/bounce_notify_service.c +++ b/postfix/bounce/bounce_notify_service.c @@ -77,7 +77,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/postfix/chroot-setup/AIX42 b/postfix/chroot-setup/AIX42 new file mode 100644 index 000000000..4562d4809 --- /dev/null +++ b/postfix/chroot-setup/AIX42 @@ -0,0 +1,11 @@ +mkdir /var/spool/postfix/etc +chmod 755 /var/spool/postfix/etc +for i in /etc/environment /etc/netsvc.conf /etc/localtime +do + test -e $i && cp $i /var/spool/postfix/etc +done +cp /etc/services /etc/resolv.conf /var/spool/postfix/etc +mkdir /var/spool/postfix/dev +chmod 755 /var/spool/postfix/dev +mknod /var/spool/postfix/dev/null c 2 2 +chmod 666 /var/spool/postfix/dev/null diff --git a/postfix/chroot-setup/BSDI2 b/postfix/chroot-setup/BSDI2 new file mode 100644 index 000000000..c3be02132 --- /dev/null +++ b/postfix/chroot-setup/BSDI2 @@ -0,0 +1,3 @@ +mkdir /var/spool/postfix/etc +chmod 755 /var/spool/postfix/etc +cp /etc/localtime /etc/services /etc/resolv.conf /var/spool/postfix/etc diff --git a/postfix/chroot-setup/BSDI3 b/postfix/chroot-setup/BSDI3 new file mode 100644 index 000000000..c3be02132 --- /dev/null +++ b/postfix/chroot-setup/BSDI3 @@ -0,0 +1,3 @@ +mkdir /var/spool/postfix/etc +chmod 755 /var/spool/postfix/etc +cp /etc/localtime /etc/services /etc/resolv.conf /var/spool/postfix/etc diff --git a/postfix/chroot-setup/FREEBSD3 b/postfix/chroot-setup/FREEBSD3 new file mode 100644 index 000000000..5c81341ac --- /dev/null +++ b/postfix/chroot-setup/FREEBSD3 @@ -0,0 +1,3 @@ +mkdir /var/spool/postfix/etc +chmod 755 /var/spool/postfix/etc +cd /etc ; cp host.conf localtime services resolv.conf /var/spool/postfix/etc diff --git a/postfix/chroot-setup/FreeBSD2 b/postfix/chroot-setup/FreeBSD2 new file mode 100644 index 000000000..5c81341ac --- /dev/null +++ b/postfix/chroot-setup/FreeBSD2 @@ -0,0 +1,3 @@ +mkdir /var/spool/postfix/etc +chmod 755 /var/spool/postfix/etc +cd /etc ; cp host.conf localtime services resolv.conf /var/spool/postfix/etc diff --git a/postfix/chroot-setup/HPUX10 b/postfix/chroot-setup/HPUX10 new file mode 100644 index 000000000..ca54c658b --- /dev/null +++ b/postfix/chroot-setup/HPUX10 @@ -0,0 +1,21 @@ +# Setup chroot jail for HP-UX (9 or 10). -- tiggr (Pieter Schoenmakers) + +if test -z "${POSTFIX_DIR}"; then + if test -d /usr/spool/postfix; then + POSTFIX_DIR=/usr/spool/postfix + elif test -d /var/spool/postfix; then + POSTFIX_DIR=/var/spool/postfix + else + echo Please indicate POSTFIX_DIR in the environment >&2 + exit 2; + fi +fi + +set -e + +umask 022 + +cd ${POSTFIX_DIR} + +mkdir etc +cp /etc/services etc diff --git a/postfix/chroot-setup/HPUX9 b/postfix/chroot-setup/HPUX9 new file mode 100644 index 000000000..ca54c658b --- /dev/null +++ b/postfix/chroot-setup/HPUX9 @@ -0,0 +1,21 @@ +# Setup chroot jail for HP-UX (9 or 10). -- tiggr (Pieter Schoenmakers) + +if test -z "${POSTFIX_DIR}"; then + if test -d /usr/spool/postfix; then + POSTFIX_DIR=/usr/spool/postfix + elif test -d /var/spool/postfix; then + POSTFIX_DIR=/var/spool/postfix + else + echo Please indicate POSTFIX_DIR in the environment >&2 + exit 2; + fi +fi + +set -e + +umask 022 + +cd ${POSTFIX_DIR} + +mkdir etc +cp /etc/services etc diff --git a/postfix/chroot-setup/IRIX5 b/postfix/chroot-setup/IRIX5 new file mode 100644 index 000000000..a8e3a4088 --- /dev/null +++ b/postfix/chroot-setup/IRIX5 @@ -0,0 +1,39 @@ +From owner-postfix-testers@porcupine.org Wed Oct 7 17:19:31 1998 +Delivered-To: wietse@porcupine.org +Delivered-To: postfix-testers@porcupine.org +Received: from star.win.or.jp (star.win.or.jp [202.26.20.3]) + by spike.porcupine.org (Postfix) with ESMTP + id 3123445D04; Wed, 7 Oct 1998 17:19:24 -0400 (EDT) +Received: (from ayamura@localhost) + by star.win.or.jp (8.9.1+CL.3.10/8.9.1) id GAA26589; + Thu, 8 Oct 1998 06:19:23 +0900 (JST) + (envelope-from ayamura) +From: Ayamura Kikuchi +To: postfix-testers@porcupine.org +Subject: chroot-setup on IRIX +X-PGP-Fingerprint: 9F 4F FD B6 47 0D 87 65 7B 67 7C A9 70 F3 8C 52 +MIME-Version: 1.0 (generated by SEMI 1.9.0 - "Isurugi") +Content-Type: text/plain; charset=US-ASCII +Date: 08 Oct 1998 06:19:22 +0900 +Message-ID: <86u31g3w9x.fsf@star.ayamura.org> +Lines: 14 +User-Agent: Semi-gnus/6.8.19 SEMI/1.9.0 (Isurugi) FLIM/1.10.1 (Miyamaki) Emacs/20.3.90 (mips-sgi-irix6.2) MULE/4.0 (HANANOEN) +Sender: owner-postfix-testers@porcupine.org +Status: RO + +# Setup chroot jail for IRIX-5.x or 6.x -- Ayamura Kikuchi + +set -e +umask 022 + +#Default POSTFIX_DIR = /var/postfix +#Else set POSTFIX_DIR in environment +POSTFIX_DIR=${POSTFIX_DIR-/var/postfix} + +/bin/mkdir -p ${POSTFIX_DIR}/etc +/bin/chmod 755 ${POSTFIX_DIR} +/bin/cp /etc/services /etc/resolv.conf ${POSTFIX_DIR}/etc + +-- Ayamura Kikuchi + + diff --git a/postfix/chroot-setup/IRIX6 b/postfix/chroot-setup/IRIX6 new file mode 100644 index 000000000..a8e3a4088 --- /dev/null +++ b/postfix/chroot-setup/IRIX6 @@ -0,0 +1,39 @@ +From owner-postfix-testers@porcupine.org Wed Oct 7 17:19:31 1998 +Delivered-To: wietse@porcupine.org +Delivered-To: postfix-testers@porcupine.org +Received: from star.win.or.jp (star.win.or.jp [202.26.20.3]) + by spike.porcupine.org (Postfix) with ESMTP + id 3123445D04; Wed, 7 Oct 1998 17:19:24 -0400 (EDT) +Received: (from ayamura@localhost) + by star.win.or.jp (8.9.1+CL.3.10/8.9.1) id GAA26589; + Thu, 8 Oct 1998 06:19:23 +0900 (JST) + (envelope-from ayamura) +From: Ayamura Kikuchi +To: postfix-testers@porcupine.org +Subject: chroot-setup on IRIX +X-PGP-Fingerprint: 9F 4F FD B6 47 0D 87 65 7B 67 7C A9 70 F3 8C 52 +MIME-Version: 1.0 (generated by SEMI 1.9.0 - "Isurugi") +Content-Type: text/plain; charset=US-ASCII +Date: 08 Oct 1998 06:19:22 +0900 +Message-ID: <86u31g3w9x.fsf@star.ayamura.org> +Lines: 14 +User-Agent: Semi-gnus/6.8.19 SEMI/1.9.0 (Isurugi) FLIM/1.10.1 (Miyamaki) Emacs/20.3.90 (mips-sgi-irix6.2) MULE/4.0 (HANANOEN) +Sender: owner-postfix-testers@porcupine.org +Status: RO + +# Setup chroot jail for IRIX-5.x or 6.x -- Ayamura Kikuchi + +set -e +umask 022 + +#Default POSTFIX_DIR = /var/postfix +#Else set POSTFIX_DIR in environment +POSTFIX_DIR=${POSTFIX_DIR-/var/postfix} + +/bin/mkdir -p ${POSTFIX_DIR}/etc +/bin/chmod 755 ${POSTFIX_DIR} +/bin/cp /etc/services /etc/resolv.conf ${POSTFIX_DIR}/etc + +-- Ayamura Kikuchi + + diff --git a/postfix/chroot-setup/LINUX2 b/postfix/chroot-setup/LINUX2 new file mode 100644 index 000000000..e6b180246 --- /dev/null +++ b/postfix/chroot-setup/LINUX2 @@ -0,0 +1,18 @@ +# Setup chroot jail for Linux + +set -e +umask 022 + +POSTFIX_DIR=${POSTFIX_DIR-/var/spool/postfix} + +cd ${POSTFIX_DIR} + +mkdir etc +cp /etc/localtime /etc/services /etc/resolv.conf etc +mkdir -p usr/lib/zoneinfo +ln -s /etc/localtime usr/lib/zoneinfo + +if [ -e /lib/libnss_dns.so.1 ]; then + mkdir lib + cp /lib/libnss_dns.so.1 lib +fi diff --git a/postfix/chroot-setup/NETBSD1 b/postfix/chroot-setup/NETBSD1 new file mode 100644 index 000000000..534076787 --- /dev/null +++ b/postfix/chroot-setup/NETBSD1 @@ -0,0 +1,3 @@ +mkdir /var/spool/postfix/etc +chmod 755 /var/spool/postfix/etc +cd /etc ; cp localtime services resolv.conf /var/spool/postfix/etc diff --git a/postfix/chroot-setup/NEXTSTEP3 b/postfix/chroot-setup/NEXTSTEP3 new file mode 100644 index 000000000..a2f163ecf --- /dev/null +++ b/postfix/chroot-setup/NEXTSTEP3 @@ -0,0 +1,31 @@ +# Setup chroot jail for NeXT, NEXTSTEP3. +# Some remarks to the NEXTSTEP3 jail apply: +# syslog: +# Logging with syslog(3) uses a sendto ("/dev/log"). For this to work in +# the jail, ${POSTFIX_DIR}/dev/log must be a hard link to /dev/log. This +# fails if /usr/spool/postfix is on another filesystem, and consequently, +# running chrooted will not be possible, unless you like to run your mail +# system without logging (not). +# +# For this trick to work, the following should be run at every reboot, +# preferably from /etc/rc, after syslog has been started (and given time +# to create /dev/log): +# POSTFIX_DIR=/usr/spool/postfix +# rm ${POSTFIX_DIR}/dev/log +# ln /dev/log ${POSTFIX_DIR}/dev/log + +set -e + +umask 022 + +POSTFIX_DIR=${POSTFIX_DIR-/usr/spool/postfix} + +cd ${POSTFIX_DIR} + +# If this fails, running chrooted will be useless. +mkdir dev +ln /dev/log dev + +mkdir etc etc/zoneinfo +cp /etc/zoneinfo/localtime etc/zoneinfo +cp /etc/resolv.conf etc diff --git a/postfix/chroot-setup/OPENSTEP4 b/postfix/chroot-setup/OPENSTEP4 new file mode 100644 index 000000000..a2f163ecf --- /dev/null +++ b/postfix/chroot-setup/OPENSTEP4 @@ -0,0 +1,31 @@ +# Setup chroot jail for NeXT, NEXTSTEP3. +# Some remarks to the NEXTSTEP3 jail apply: +# syslog: +# Logging with syslog(3) uses a sendto ("/dev/log"). For this to work in +# the jail, ${POSTFIX_DIR}/dev/log must be a hard link to /dev/log. This +# fails if /usr/spool/postfix is on another filesystem, and consequently, +# running chrooted will not be possible, unless you like to run your mail +# system without logging (not). +# +# For this trick to work, the following should be run at every reboot, +# preferably from /etc/rc, after syslog has been started (and given time +# to create /dev/log): +# POSTFIX_DIR=/usr/spool/postfix +# rm ${POSTFIX_DIR}/dev/log +# ln /dev/log ${POSTFIX_DIR}/dev/log + +set -e + +umask 022 + +POSTFIX_DIR=${POSTFIX_DIR-/usr/spool/postfix} + +cd ${POSTFIX_DIR} + +# If this fails, running chrooted will be useless. +mkdir dev +ln /dev/log dev + +mkdir etc etc/zoneinfo +cp /etc/zoneinfo/localtime etc/zoneinfo +cp /etc/resolv.conf etc diff --git a/postfix/chroot-setup/OSF1 b/postfix/chroot-setup/OSF1 new file mode 100644 index 000000000..dd6ae6473 --- /dev/null +++ b/postfix/chroot-setup/OSF1 @@ -0,0 +1,21 @@ +******************************************************************* +# setup chroot jail for OSF1 +# prabhat@wonder +set -e +umask 022 + +#Default POSTFIX_DIR = /var/spool/postfix +#Else set POSTFIX_DIR in environment + +POSTFIX_DIR=${POSTFIX_DIR-/var/spool/postfix} + +cd ${POSTFIX_DIR} +mkdir etc +cp /etc/svc.conf /etc/services /etc/resolv.conf etc +# +# The following line added to make the timestamps in syslog to be correct. +# /PetBi@UNIT.LiU.SE +# +cp -r /etc/zoneinfo etc + +#******************************************************************* diff --git a/postfix/chroot-setup/Solaris2 b/postfix/chroot-setup/Solaris2 new file mode 100644 index 000000000..26bf297d3 --- /dev/null +++ b/postfix/chroot-setup/Solaris2 @@ -0,0 +1,72 @@ +#!/bin/sh + +# Create chroot'd area under Solaris 2.5.1 for postfix. +# +# Dug Song + +if [ $# -ne 1 ]; then + echo "Usage: `basename $0` , e.g.: /var/spool/postfix" ; exit 1 +fi + +CHROOT=$1 + +# If CHROOT does not exist but parent does, create CHROOT +if [ ! -d ${CHROOT} ]; then + # lack of -p below is intentional + mkdir ${CHROOT} +fi +if [ ! -d ${CHROOT} -o "${CHROOT}" = "/" -o "${CHROOT}" = "/usr" ]; then + echo "$0: bad chroot directory ${CHROOT}" + exit 2 +fi +for dir in etc/default etc/inet dev usr/lib usr/share/lib/zoneinfo ; do + if [ ! -d ${CHROOT}/${dir} ]; then mkdir -p ${CHROOT}/${dir} ; fi +done +chmod -R 755 ${CHROOT} + +# AFS support. +if [ "`echo $CHROOT | cut -c1-4`" = "/afs" ]; then + echo '\tCreating memory resident /dev...' + mount -F tmpfs -o size=10 swap ${CHROOT}/dev +fi + +# Setup /etc files. +cp /etc/nsswitch.conf ${CHROOT}/etc +cp /etc/netconfig /etc/resolv.conf ${CHROOT}/etc +cp /etc/default/init ${CHROOT}/etc/default +cp /etc/inet/services ${CHROOT}/etc/inet/services +ln -s /etc/inet/services ${CHROOT}/etc/services +find ${CHROOT}/etc -type f -exec chmod 444 {} \; + +# Most of the following are needed for basic operation, except +# for libnsl.so, nss_nis.so, libsocket.so, and straddr.so which are +# needed to resolve NIS names. +cp /usr/lib/ld.so /usr/lib/ld.so.1 ${CHROOT}/usr/lib +for lib in libc libdl libintl libmp libnsl libsocket libw \ + nss_nis nss_nisplus nss_dns nss_files; do + cp /usr/lib/${lib}.so.1 ${CHROOT}/usr/lib + rm -f ${CHROOT}/usr/lib/${lib}.so + ln -s ./${lib}.so.1 ${CHROOT}/usr/lib/${lib}.so +done +cp /usr/lib/straddr.so.2 ${CHROOT}/usr/lib +rm -f ${CHROOT}/usr/lib/straddr.so +ln -s ./straddr.so.2 ${CHROOT}/usr/lib/straddr.so +chmod 555 ${CHROOT}/usr/lib/* + +# Copy timezone database. +(cd ${CHROOT}/usr/share/lib/zoneinfo + (cd /usr/share/lib/zoneinfo; find . -print | cpio -o) | cpio -imdu + find . -print | xargs chmod 555 +) + +# Make device nodes. We need ticotsord, ticlts and udp to resolve NIS names. +for device in zero tcp udp ticotsord ticlts; do + line=`ls -lL /dev/${device} | sed -e 's/,//'` + major=`echo $line | awk '{print $5}'` + minor=`echo $line | awk '{print $6}'` + rm -f ${CHROOT}/dev/${device} + mknod ${CHROOT}/dev/${device} c ${major} ${minor} +done +chmod 666 ${CHROOT}/dev/* + +exit 0 diff --git a/postfix/cleanup/Makefile.in b/postfix/cleanup/Makefile.in index 391f409ff..d7b7baff7 100644 --- a/postfix/cleanup/Makefile.in +++ b/postfix/cleanup/Makefile.in @@ -68,7 +68,8 @@ cleanup.o: ../include/vbuf.h cleanup.o: ../include/vstream.h cleanup.o: ../include/mymalloc.h cleanup.o: ../include/iostuff.h -cleanup.o: ../include/config.h +cleanup.o: ../include/dict.h +cleanup.o: ../include/mail_conf.h cleanup.o: ../include/cleanup_user.h cleanup.o: ../include/mail_queue.h cleanup.o: ../include/mail_proto.h @@ -81,7 +82,6 @@ cleanup.o: ../include/mail_server.h cleanup.o: cleanup.h cleanup.o: ../include/argv.h cleanup.o: ../include/maps.h -cleanup.o: ../include/dict.h cleanup.o: ../include/tok822.h cleanup.o: ../include/resolve_clnt.h cleanup.o: ../include/been_here.h diff --git a/postfix/cleanup/cleanup.c b/postfix/cleanup/cleanup.c index 367693634..6123cfcb3 100644 --- a/postfix/cleanup/cleanup.c +++ b/postfix/cleanup/cleanup.c @@ -133,7 +133,7 @@ /* Global library. */ -#include +#include #include #include #include diff --git a/postfix/conf/main.cf.default b/postfix/conf/main.cf.default index e12daa656..513781317 100644 --- a/postfix/conf/main.cf.default +++ b/postfix/conf/main.cf.default @@ -61,7 +61,7 @@ luser_relay = mail_name = Postfix mail_owner = postfix mail_spool_directory = /var/mail -mail_version = Snapshot-19990423 +mail_version = Snapshot-19990426 mailbox_command = mailbox_transport = maps_rbl_domains = rbl.maps.vix.com diff --git a/postfix/conf/master.cf b/postfix/conf/master.cf index 95a929603..d300bb89a 100644 --- a/postfix/conf/master.cf +++ b/postfix/conf/master.cf @@ -62,6 +62,7 @@ bounce unix - - n - 0 bounce defer unix - - n - 0 bounce smtp unix - - n - - smtp showq unix n - n - - showq +error unix - - n - - error local unix - n n - - local cyrus unix - n n - - pipe flags=R user=cyrus argv=/cyrus/bin/deliver -e -q -m ${extension} ${user} diff --git a/postfix/conf/sample-smtpd.cf b/postfix/conf/sample-smtpd.cf index c77a4a58e..23707f3b4 100644 --- a/postfix/conf/sample-smtpd.cf +++ b/postfix/conf/sample-smtpd.cf @@ -64,14 +64,14 @@ smtpd_hard_error_limit = 100 # The default is to allow connections from any host. The following # restrictions are available: # -# reject_unknown_client:reject the request if the client hostname is unknown. +# reject_unknown_client: reject the request if the client hostname is unknown. # permit_mynetworks: permit if the client address matches $mynetworks. # check_client_access maptype:mapname # maptype:mapname: look up client name, parent domains, client address, # or networks obtained by stripping octets. # Reject if result is REJECT or "[45]xx text" # Permit otherwise. -# reject_maps_rbl:reject if the client is listed under $maps_rbl_domains. +# reject_maps_rbl: reject if the client is listed under $maps_rbl_domains. # reject: reject the request. Place this at the end of a restriction. # permit: permit the request. Place this at the end of a restriction. # @@ -97,8 +97,8 @@ smtpd_helo_required = no # are available: # # permit_mynetworks: permit if the client address matches $mynetworks. -# reject_unknown_client:reject the request if the client hostname is unknown. -# reject_maps_rbl:reject if the client is listed under $maps_rbl_domains. +# reject_unknown_client: reject the request if the client hostname is unknown. +# reject_maps_rbl: reject if the client is listed under $maps_rbl_domains. # reject_invalid_hostname: reject HELO hostname with bad syntax. # reject_unknown_hostname: reject HELO hostname without DNS A or MX record. # reject_non_fqdn_hostname: reject HELO hostname that is not in FQDN form @@ -127,11 +127,11 @@ smtpd_helo_restrictions = # restrictions are available: # # permit_mynetworks: permit if the client address matches $mynetworks. -# reject_unknown_client:reject the request if the client hostname is unknown. -# reject_maps_rbl:reject if the client is listed under $maps_rbl_domains. +# reject_unknown_client: reject the request if the client hostname is unknown. +# reject_maps_rbl: reject if the client is listed under $maps_rbl_domains. # reject_invalid_hostname: reject HELO hostname with bad syntax. # reject_unknown_hostname: reject HELO hostname without DNS A or MX record. -# reject_unknown_sender_domain:reject sender domain without A or MX record. +# reject_unknown_sender_domain: reject sender domain without A or MX record. # check_sender_access maptype:mapname # maptype:mapname: look up sender address, parent domain, or localpart@. # Reject if result is REJECT or "[45]xx text" @@ -163,10 +163,11 @@ smtpd_sender_restrictions = # The following restrictions are available: # # permit_mynetworks: permit if the client address matches $mynetworks. -# reject_unknown_client:reject the request if the client hostname is unknown. -# reject_maps_rbl:reject if the client is listed under $maps_rbl_domains. +# reject_unknown_client: reject the request if the client hostname is unknown. +# reject_maps_rbl: reject if the client is listed under $maps_rbl_domains. # reject_invalid_hostname: reject HELO hostname with bad syntax. # reject_unknown_hostname: reject HELO hostname without DNS A or MX record. +# reject_unknown_sender_domain: reject sender domain without A or MX record. # check_relay_domains: permit only mail from/to domains in $relay_domains. # permit_mx_backup: accept mail for sites that list me as MX host. # reject_unknown_recipient_domain: reject domains without A or MX record. diff --git a/postfix/error/.indent.pro b/postfix/error/.indent.pro new file mode 100644 index 000000000..88212c9ce --- /dev/null +++ b/postfix/error/.indent.pro @@ -0,0 +1,103 @@ +-TALIAS_TOKEN +-TARGV +-TBH_TABLE +-TBINHASH +-TBINHASH_INFO +-TBOUNCE_STAT +-TCLEANUP_STATE +-TCLIENT_LIST +-TCLNT_STREAM +-TCONFIG_BOOL_FN_TABLE +-TCONFIG_BOOL_TABLE +-TCONFIG_INT_FN_TABLE +-TCONFIG_INT_TABLE +-TCONFIG_STR_FN_TABLE +-TCONFIG_STR_TABLE +-TDELIVER_ATTR +-TDELIVER_REQUEST +-TDICT +-TDICT_DB +-TDICT_DBM +-TDICT_ENV +-TDICT_HT +-TDICT_LDAP +-TDICT_NI +-TDICT_NIS +-TDICT_NISPLUS +-TDICT_NODE +-TDICT_OPEN_INFO +-TDICT_PCRE +-TDICT_REGEXP +-TDICT_REGEXP_RULE +-TDICT_UNIX +-TDNS_FIXED +-TDNS_REPLY +-TDNS_RR +-TDOMAIN_LIST +-TEXPAND_ATTR +-TFILE +-TFORWARD_INFO +-TFW_CONTEXT +-THEADER_OPTS +-THTABLE +-THTABLE_INFO +-TINET_ADDR_LIST +-TINT_TABLE +-TLOCAL_STATE +-TMAC_HEAD +-TMAC_PARSE +-TMAIL_PRINT +-TMAIL_SCAN +-TMAPS +-TMASTER_PROC +-TMASTER_SERV +-TMASTER_STATUS +-TMBLOCK +-TMKMAP +-TMKMAP_OPEN_INFO +-TMULTI_SERVER +-TMVECT +-TNAMADR_LIST +-TNAME_MASK +-TPEER_NAME +-TPICKUP_INFO +-TPIPE_ATTR +-TPIPE_PARAMS +-TQMGR_ENTRY +-TQMGR_MESSAGE +-TQMGR_QUEUE +-TQMGR_RCPT_LIST +-TQMGR_RECIPIENT +-TQMGR_SCAN +-TQMGR_TRANSPORT +-TRECIPIENT +-TRECIPIENT_LIST +-TREC_TYPE_NAME +-TRESOLVE_REPLY +-TRESPONSE +-TSCAN_DIR +-TSCAN_INFO +-TSCAN_OBJ +-TSESSION +-TSINGLE_SERVER +-TSINK_COMMAND +-TSINK_STATE +-TSMTPD_STATE +-TSMTPD_TOKEN +-TSMTP_ADDR +-TSMTP_CMD +-TSMTP_RESP +-TSMTP_SESSION +-TSMTP_STATE +-TSOCKADDR_SIZE +-TSTRING_TABLE +-TSYS_EXITS_TABLE +-TTOK822 +-TTRIGGER_SERVER +-TUSER_ATTR +-TVBUF +-TVSTREAM +-TVSTREAM_POPEN_ARGS +-TVSTRING +-TWAIT_STATUS_T +-TWATCH_FD diff --git a/postfix/error/Makefile.in b/postfix/error/Makefile.in new file mode 100644 index 000000000..75477d720 --- /dev/null +++ b/postfix/error/Makefile.in @@ -0,0 +1,65 @@ +SHELL = /bin/sh +SRCS = error.c +OBJS = error.o +HDRS = +TESTSRC = +WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \ + -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \ + -Wunused +DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) +CFLAGS = $(DEBUG) $(OPT) $(DEFS) +TESTPROG= quote_821_local error_unalias +PROG = error +INC_DIR = ../include +LIBS = ../lib/libmaster.a ../lib/libglobal.a ../lib/libutil.a + +.c.o:; $(CC) $(CFLAGS) -c $*.c + +$(PROG): $(OBJS) $(LIBS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS) + +Makefile: Makefile.in + (set -e; echo "# DO NOT EDIT"; $(OPTS) sh ../makedefs; cat $?) >$@ + +test: $(TESTPROG) + +update: ../bin/$(PROG) + +../bin/$(PROG): $(PROG) + cp $(PROG) ../bin + +printfck: $(OBJS) $(PROG) + rm -rf printfck + mkdir printfck + sed '1,/^# do not edit/!d' Makefile >printfck/Makefile + set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done + cd printfck; make "INC_DIR=../../include" `cd ..; ls *.o` + +lint: + lint $(DEFS) $(SRCS) $(LINTFIX) + +clean: + rm -f *.o *core $(PROG) $(TESTPROG) junk + rm -rf printfck + +tidy: clean + +depend: $(MAKES) + (sed '1,/^# do not edit/!d' Makefile.in; \ + set -e; for i in [a-z][a-z0-9]*.c; do \ + $(CC) -E $(DEFS) $(INCL) $$i | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \ + -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \ + done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in + @make -f Makefile.in Makefile + +# do not edit below this line - it is generated by 'make depend' +error.o: error.c +error.o: ../include/sys_defs.h +error.o: ../include/msg.h +error.o: ../include/vstream.h +error.o: ../include/vbuf.h +error.o: ../include/deliver_request.h +error.o: ../include/vstring.h +error.o: ../include/recipient_list.h +error.o: ../include/mail_queue.h +error.o: ../include/mail_server.h diff --git a/postfix/error/error.c b/postfix/error/error.c new file mode 100644 index 000000000..4e3c09da2 --- /dev/null +++ b/postfix/error/error.c @@ -0,0 +1,184 @@ +/*++ +/* NAME +/* error 8 +/* SUMMARY +/* Postfix error mailer +/* SYNOPSIS +/* \fBerror\fR [generic Postfix daemon options] +/* DESCRIPTION +/* The Postfix error mailer processes message delivery requests from +/* the queue manager. Each request specifies a queue file, a sender +/* address, a domain or host name that is treated as the reason for +/* non-delivery, and recipient information. +/* This program expects to be run from the \fBmaster\fR(8) process +/* manager. +/* +/* The error mailer client forces all recipients to bounce, using the +/* domain or host information as the reason for non-delivery, updates +/* the queue file and marks recipients as finished, or it informs the +/* queue manager that delivery should be tried again at a later time. +/* +/* Delivery problem reports are sent to the \fBbounce\fR(8) or +/* \fBdefer\fR(8) daemon as appropriate. +/* SECURITY +/* .ad +/* .fi +/* The error mailer is not security-sensitive. It does not talk +/* to the network, and can be run chrooted at fixed low privilege. +/* STANDARDS +/* None. +/* DIAGNOSTICS +/* Problems and transactions are logged to \fBsyslogd\fR(8). +/* +/* Depending on the setting of the \fBnotify_classes\fR parameter, +/* the postmaster is notified of bounces and of other trouble. +/* BUGS +/* CONFIGURATION PARAMETERS +/* .ad +/* .fi +/* The following \fBmain.cf\fR parameters are especially relevant to +/* this program. See the Postfix \fBmain.cf\fR file for syntax details +/* and for default values. Use the \fBpostfix reload\fR command after +/* a configuration change. +/* .SH Miscellaneous +/* .ad +/* .fi +/* .IP \fBbounce_notice_recipient\fR +/* Postmaster for bounce error notices. +/* .IP \fBnotify_classes\fR +/* When this parameter includes the \fBbounce\fR class, send mail to the +/* postmaster with with the headers of the bounced mail. +/* SEE ALSO +/* bounce(8) non-delivery status reports +/* master(8) process manager +/* qmgr(8) queue manager +/* syslogd(8) system logging +/* 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 + +/* Global library. */ + +#include +#include +#include +#include + +/* Single server skeleton. */ + +#include + +/* deliver_message - deliver message with extreme prejudice */ + +static int deliver_message(DELIVER_REQUEST *request) +{ + char *myname = "deliver_message"; + VSTREAM *src; + int result = 0; + int status; + RECIPIENT *rcpt; + int nrcpt; + + if (msg_verbose) + msg_info("deliver_message: from %s", request->sender); + + /* + * Sanity checks. The smtp server is unprivileged and chrooted, so we can + * afford to distribute the data censoring code, instead of having it all + * in one place. + */ + if (request->nexthop[0] == 0) + msg_fatal("empty nexthop hostname"); + if (request->rcpt_list.len <= 0) + msg_fatal("recipient count: %d", request->rcpt_list.len); + + /* + * Open the queue file. Opening the file can fail for a variety of + * reasons, such as the system running out of resources. Instead of + * throwing away mail, we're raising a fatal error which forces the mail + * system to back off, and retry later. + */ + src = mail_queue_open(request->queue_name, request->queue_id, + O_RDWR, 0); + if (src == 0) + msg_fatal("%s: open %s %s: %m", myname, + request->queue_name, request->queue_id); + if (msg_verbose) + msg_info("%s: file %s", myname, VSTREAM_PATH(src)); + + /* + * Bounce all recipients. + */ + for (nrcpt = 0; nrcpt < request->rcpt_list.len; nrcpt++) { + rcpt = request->rcpt_list.info + nrcpt; + if (rcpt->offset >= 0) { + status = bounce_append(BOUNCE_FLAG_KEEP, request->queue_id, + rcpt->address, "error", + request->arrival_time, + "%s", request->nexthop); + if (status == 0) + deliver_completed(src, rcpt->offset); + result |= status; + } + } + + /* + * Clean up. + */ + if (vstream_fclose(src)) + msg_warn("close %s %s: %m", request->queue_name, request->queue_id); + + return (result); +} + +/* error_service - perform service for client */ + +static void error_service(VSTREAM *client_stream, char *unused_service, char **argv) +{ + DELIVER_REQUEST *request; + int status; + + /* + * Sanity check. This service takes no command-line arguments. + */ + if (argv[0]) + msg_fatal("unexpected command-line argument: %s", argv[0]); + + /* + * This routine runs whenever a client connects to the UNIX-domain socket + * dedicated to the error mailer. What we see below is a little protocol + * to (1) tell the queue manager that we are ready, (2) read a request + * from the queue manager, and (3) report the completion status of that + * request. All connection-management stuff is handled by the common code + * in single_server.c. + */ + if ((request = deliver_request_read(client_stream)) != 0) { + status = deliver_message(request); + deliver_request_done(client_stream, request, status); + } +} + +/* main - pass control to the single-threaded skeleton */ + +int main(int argc, char **argv) +{ + single_server_main(argc, argv, error_service, 0); +} diff --git a/postfix/global/Makefile.in b/postfix/global/Makefile.in index bb618ef14..9f78c7c3e 100644 --- a/postfix/global/Makefile.in +++ b/postfix/global/Makefile.in @@ -1,54 +1,54 @@ SHELL = /bin/sh -SRCS = been_here.c bounce.c canon_addr.c cleanup_strerror.c \ - config.c config_bool.c config_int.c config_str.c debug_peer.c \ - debug_process.c defer.c deliver_completed.c deliver_flock.c \ - deliver_request.c domain_list.c dot_lockfile.c file_id.c \ - header_opts.c is_header.c mail_addr.c mail_addr_crunch.c \ - mail_addr_find.c mail_addr_map.c mail_command_read.c \ - mail_command_write.c mail_connect.c mail_copy.c mail_date.c \ - mail_error.c mail_flush.c mail_open_ok.c mail_params.c \ - mail_pathname.c mail_print.c mail_queue.c mail_run.c mail_scan.c \ - mail_scan_dir.c mail_stream.c mail_task.c mail_trigger.c maps.c \ - mark_corrupt.c mkmap_db.c mkmap_dbm.c mkmap_open.c mynetworks.c \ - mypwd.c namadr_list.c off_cvt.c opened.c own_inet_addr.c \ - peer_name.c pipe_command.c post_mail.c quote_822_local.c \ - rec_streamlf.c rec_type.c recipient_list.c record.c remove.c \ - resolve_clnt.c resolve_local.c rewrite_clnt.c sent.c smtp_stream.c \ - split_addr.c string_list.c sys_exits.c timed_ipc.c tok822_find.c \ - tok822_node.c tok822_parse.c tok822_resolve.c tok822_rewrite.c \ - tok822_tree.c clnt_stream.c deliver_pass.c config_raw.c -OBJS = been_here.o bounce.o canon_addr.o cleanup_strerror.o \ - config.o config_bool.o config_int.o config_str.o debug_peer.o \ - debug_process.o defer.o deliver_completed.o deliver_flock.o \ - deliver_request.o domain_list.o dot_lockfile.o file_id.o \ - header_opts.o is_header.o mail_addr.o mail_addr_crunch.o \ - mail_addr_find.o mail_addr_map.o mail_command_read.o \ - mail_command_write.o mail_connect.o mail_copy.o mail_date.o \ - mail_error.o mail_flush.o mail_open_ok.o mail_params.o \ - mail_pathname.o mail_print.o mail_queue.o mail_run.o mail_scan.o \ - mail_scan_dir.o mail_stream.o mail_task.o mail_trigger.o maps.o \ - mark_corrupt.o mkmap_db.o mkmap_dbm.o mkmap_open.o mynetworks.o \ - mypwd.o namadr_list.o off_cvt.o opened.o own_inet_addr.o \ - peer_name.o pipe_command.o post_mail.o quote_822_local.o \ - rec_streamlf.o rec_type.o recipient_list.o record.o remove.o \ - resolve_clnt.o resolve_local.o rewrite_clnt.o sent.o smtp_stream.o \ - split_addr.o string_list.o sys_exits.o timed_ipc.o tok822_find.o \ - tok822_node.o tok822_parse.o tok822_resolve.o tok822_rewrite.o \ - tok822_tree.o clnt_stream.o deliver_pass.o config_raw.o -HDRS = been_here.h bounce.h canon_addr.h cleanup_user.h \ +SRCS = been_here.c bounce.c canon_addr.c cleanup_strerror.c clnt_stream.c \ + debug_peer.c debug_process.c defer.c deliver_completed.c \ + deliver_flock.c deliver_pass.c deliver_request.c domain_list.c \ + dot_lockfile.c file_id.c header_opts.c is_header.c mail_addr.c \ + mail_addr_crunch.c mail_addr_find.c mail_addr_map.c \ + mail_command_read.c mail_command_write.c mail_conf.c \ + mail_conf_bool.c mail_conf_int.c mail_conf_raw.c mail_conf_str.c \ + mail_connect.c mail_copy.c mail_date.c mail_error.c mail_flush.c \ + mail_open_ok.c mail_params.c mail_pathname.c mail_print.c \ + mail_queue.c mail_run.c mail_scan.c mail_scan_dir.c mail_stream.c \ + mail_task.c mail_trigger.c maps.c mark_corrupt.c mkmap_db.c \ + mkmap_dbm.c mkmap_open.c mynetworks.c mypwd.c namadr_list.c \ + off_cvt.c opened.c own_inet_addr.c peer_name.c pipe_command.c \ + post_mail.c quote_822_local.c rec_streamlf.c rec_type.c \ + recipient_list.c record.c remove.c resolve_clnt.c resolve_local.c \ + rewrite_clnt.c sent.c smtp_stream.c split_addr.c string_list.c \ + sys_exits.c timed_ipc.c tok822_find.c tok822_node.c tok822_parse.c \ + tok822_resolve.c tok822_rewrite.c tok822_tree.c +OBJS = been_here.o bounce.o canon_addr.o cleanup_strerror.o clnt_stream.o \ + debug_peer.o debug_process.o defer.o deliver_completed.o \ + deliver_flock.o deliver_pass.o deliver_request.o domain_list.o \ + dot_lockfile.o file_id.o header_opts.o is_header.o mail_addr.o \ + mail_addr_crunch.o mail_addr_find.o mail_addr_map.o \ + mail_command_read.o mail_command_write.o mail_conf.o \ + mail_conf_bool.o mail_conf_int.o mail_conf_raw.o mail_conf_str.o \ + mail_connect.o mail_copy.o mail_date.o mail_error.o mail_flush.o \ + mail_open_ok.o mail_params.o mail_pathname.o mail_print.o \ + mail_queue.o mail_run.o mail_scan.o mail_scan_dir.o mail_stream.o \ + mail_task.o mail_trigger.o maps.o mark_corrupt.o mkmap_db.o \ + mkmap_dbm.o mkmap_open.o mynetworks.o mypwd.o namadr_list.o \ + off_cvt.o opened.o own_inet_addr.o peer_name.o pipe_command.o \ + post_mail.o quote_822_local.o rec_streamlf.o rec_type.o \ + recipient_list.o record.o remove.o resolve_clnt.o resolve_local.o \ + rewrite_clnt.o sent.o smtp_stream.o split_addr.o string_list.o \ + sys_exits.o timed_ipc.o tok822_find.o tok822_node.o tok822_parse.o \ + tok822_resolve.o tok822_rewrite.o tok822_tree.o +HDRS = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \ config.h debug_peer.h debug_process.h defer.h deliver_completed.h \ - deliver_flock.h deliver_request.h domain_list.h dot_lockfile.h \ - file_id.h header_opts.h is_header.h mail_addr.h mail_addr_crunch.h \ - mail_addr_find.h mail_addr_map.h mail_copy.h mail_date.h \ - mail_error.h mail_flush.h mail_open_ok.h mail_params.h \ - mail_proto.h mail_queue.h mail_run.h mail_scan_dir.h mail_stream.h \ - mail_task.h mail_version.h maps.h mark_corrupt.h mkmap.h \ - mynetworks.h mypwd.h namadr_list.h off_cvt.h opened.h \ + deliver_flock.h deliver_pass.h deliver_request.h domain_list.h \ + dot_lockfile.h file_id.h header_opts.h is_header.h mail_addr.h \ + mail_addr_crunch.h mail_addr_find.h mail_addr_map.h mail_conf.h \ + mail_copy.h mail_date.h mail_error.h mail_flush.h mail_open_ok.h \ + mail_params.h mail_proto.h mail_queue.h mail_run.h mail_scan_dir.h \ + mail_stream.h mail_task.h mail_version.h maps.h mark_corrupt.h \ + mkmap.h mynetworks.h mypwd.h namadr_list.h off_cvt.h opened.h \ own_inet_addr.h peer_name.h pipe_command.h post_mail.h \ quote_822_local.h rec_streamlf.h rec_type.h recipient_list.h \ record.h resolve_clnt.h resolve_local.h rewrite_clnt.h sent.h \ smtp_stream.h split_addr.h string_list.h sys_exits.h timed_ipc.h \ - tok822.h clnt_stream.h deliver_pass.h + tok822.h TESTSRC = rec2stream.c stream2rec.c recdump.c WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \ -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \ @@ -254,44 +254,6 @@ clnt_stream.o: ../include/iostuff.h clnt_stream.o: mail_proto.h clnt_stream.o: mail_params.h clnt_stream.o: clnt_stream.h -config.o: config.c -config.o: ../include/sys_defs.h -config.o: ../include/msg.h -config.o: ../include/mymalloc.h -config.o: ../include/vstream.h -config.o: ../include/vbuf.h -config.o: ../include/vstring.h -config.o: ../include/dict.h -config.o: ../include/safe.h -config.o: ../include/stringops.h -config.o: mail_params.h -config.o: config.h -config_bool.o: config_bool.c -config_bool.o: ../include/sys_defs.h -config_bool.o: ../include/msg.h -config_bool.o: ../include/dict.h -config_bool.o: ../include/vstream.h -config_bool.o: ../include/vbuf.h -config_bool.o: config.h -config_int.o: config_int.c -config_int.o: ../include/sys_defs.h -config_int.o: ../include/msg.h -config_int.o: ../include/mymalloc.h -config_int.o: ../include/dict.h -config_int.o: ../include/vstream.h -config_int.o: ../include/vbuf.h -config_int.o: ../include/stringops.h -config_int.o: config.h -config_raw.o: config_raw.c -config_raw.o: ../include/sys_defs.h -config_raw.o: ../include/msg.h -config_raw.o: ../include/mymalloc.h -config_raw.o: config.h -config_str.o: config_str.c -config_str.o: ../include/sys_defs.h -config_str.o: ../include/msg.h -config_str.o: ../include/mymalloc.h -config_str.o: config.h debug_peer.o: debug_peer.c debug_peer.o: ../include/sys_defs.h debug_peer.o: ../include/msg.h @@ -302,7 +264,7 @@ debug_process.o: debug_process.c debug_process.o: ../include/sys_defs.h debug_process.o: ../include/msg.h debug_process.o: mail_params.h -debug_process.o: config.h +debug_process.o: mail_conf.h debug_process.o: debug_process.h defer.o: defer.c defer.o: ../include/sys_defs.h @@ -439,6 +401,44 @@ mail_command_write.o: ../include/vstream.h mail_command_write.o: ../include/vbuf.h mail_command_write.o: mail_proto.h mail_command_write.o: ../include/iostuff.h +mail_conf.o: mail_conf.c +mail_conf.o: ../include/sys_defs.h +mail_conf.o: ../include/msg.h +mail_conf.o: ../include/mymalloc.h +mail_conf.o: ../include/vstream.h +mail_conf.o: ../include/vbuf.h +mail_conf.o: ../include/vstring.h +mail_conf.o: ../include/dict.h +mail_conf.o: ../include/safe.h +mail_conf.o: ../include/stringops.h +mail_conf.o: mail_params.h +mail_conf.o: mail_conf.h +mail_conf_bool.o: mail_conf_bool.c +mail_conf_bool.o: ../include/sys_defs.h +mail_conf_bool.o: ../include/msg.h +mail_conf_bool.o: ../include/dict.h +mail_conf_bool.o: ../include/vstream.h +mail_conf_bool.o: ../include/vbuf.h +mail_conf_bool.o: mail_conf.h +mail_conf_int.o: mail_conf_int.c +mail_conf_int.o: ../include/sys_defs.h +mail_conf_int.o: ../include/msg.h +mail_conf_int.o: ../include/mymalloc.h +mail_conf_int.o: ../include/dict.h +mail_conf_int.o: ../include/vstream.h +mail_conf_int.o: ../include/vbuf.h +mail_conf_int.o: ../include/stringops.h +mail_conf_int.o: mail_conf.h +mail_conf_raw.o: mail_conf_raw.c +mail_conf_raw.o: ../include/sys_defs.h +mail_conf_raw.o: ../include/msg.h +mail_conf_raw.o: ../include/mymalloc.h +mail_conf_raw.o: mail_conf.h +mail_conf_str.o: mail_conf_str.c +mail_conf_str.o: ../include/sys_defs.h +mail_conf_str.o: ../include/msg.h +mail_conf_str.o: ../include/mymalloc.h +mail_conf_str.o: mail_conf.h mail_connect.o: mail_connect.c mail_connect.o: ../include/sys_defs.h mail_connect.o: ../include/msg.h @@ -497,7 +497,7 @@ mail_params.o: ../include/get_hostname.h mail_params.o: ../include/valid_hostname.h mail_params.o: ../include/stringops.h mail_params.o: mynetworks.h -mail_params.o: config.h +mail_params.o: mail_conf.h mail_params.o: mail_version.h mail_params.o: mail_params.h mail_pathname.o: mail_pathname.c @@ -591,7 +591,7 @@ maps.o: ../include/vstream.h maps.o: ../include/vbuf.h maps.o: ../include/stringops.h maps.o: ../include/split_at.h -maps.o: config.h +maps.o: mail_conf.h maps.o: maps.h mark_corrupt.o: mark_corrupt.c mark_corrupt.o: ../include/sys_defs.h diff --git a/postfix/global/config.h b/postfix/global/config.h index c9868a776..d03a6527e 100644 --- a/postfix/global/config.h +++ b/postfix/global/config.h @@ -5,126 +5,45 @@ /* NAME /* config 3h /* SUMMARY -/* global configuration parameter management +/* compatibility /* SYNOPSIS /* #include /* DESCRIPTION /* .nf /* - * Well known names. These are not configurable. One has to start somewhere. - */ -#define CONFIG_DICT "mail_dict" /* global Postfix dictionary */ - - /* - * Environment variables. - */ -#define CONF_ENV_PATH "MAIL_CONFIG" /* config database */ -#define CONF_ENV_VERB "MAIL_VERBOSE" /* verbose mode on */ -#define CONF_ENV_DEBUG "MAIL_DEBUG" /* verbose mode on */ - - /* - * External representation for booleans. - */ -#define CONFIG_BOOL_YES "yes" -#define CONFIG_BOOL_NO "no" - - /* - * Basic configuration management. - */ -extern void read_config(void); - -extern void config_update(const char *, const char *); -extern const char *config_lookup(const char *); -extern const char *config_eval(const char *); -extern const char *config_lookup_eval(const char *); - - /* - * Specific parameter lookup routines. - */ -extern char *get_config_str(const char *, const char *, int, int); -extern int get_config_int(const char *, int, int, int); -extern int get_config_bool(const char *, int); -extern char *get_config_raw(const char *, const char *, int, int); - -extern int get_config_int2(const char *, const char *, int, int, int); - - /* - * Lookup with function-call defaults. - */ -extern char *get_config_str_fn(const char *, const char *(*) (void), int, int); -extern int get_config_int_fn(const char *, int (*) (void), int, int); -extern int get_config_bool_fn(const char *, int (*) (void)); -extern char *get_config_raw_fn(const char *, const char *(*) (void), int, int); - - /* - * Update dictionary. - */ -extern void set_config_str(const char *, const char *); -extern void set_config_int(const char *, int); -extern void set_config_bool(const char *, int); - - /* - * Tables that allow us to selectively copy values from the global - * configuration file to global variables. - */ -typedef struct { - const char *name; /* config variable name */ - const char *defval; /* default value or null */ - char **target; /* pointer to global variable */ - int min; /* min length or zero */ - int max; /* max length or zero */ -} CONFIG_STR_TABLE; - -typedef struct { - const char *name; /* config variable name */ - int defval; /* default value */ - int *target; /* pointer to global variable */ - int min; /* lower bound or zero */ - int max; /* upper bound or zero */ -} CONFIG_INT_TABLE; - -typedef struct { - const char *name; /* config variable name */ - int defval; /* default value */ - int *target; /* pointer to global variable */ -} CONFIG_BOOL_TABLE; - -extern void get_config_str_table(CONFIG_STR_TABLE *); -extern void get_config_int_table(CONFIG_INT_TABLE *); -extern void get_config_bool_table(CONFIG_BOOL_TABLE *); -extern void get_config_raw_table(CONFIG_STR_TABLE *); - - /* - * Tables to initialize parameters from the global configuration file or - * from function calls. - */ -typedef struct { - const char *name; /* config variable name */ - const char *(*defval) (void); /* default value provider */ - char **target; /* pointer to global variable */ - int min; /* lower bound or zero */ - int max; /* upper bound or zero */ -} CONFIG_STR_FN_TABLE; - -typedef struct { - const char *name; /* config variable name */ - int (*defval) (void); /* default value provider */ - int *target; /* pointer to global variable */ - int min; /* lower bound or zero */ - int max; /* upper bound or zero */ -} CONFIG_INT_FN_TABLE; - -typedef struct { - const char *name; /* config variable name */ - int (*defval) (void); /* default value provider */ - int *target; /* pointer to global variable */ -} CONFIG_BOOL_FN_TABLE; - -extern void get_config_str_fn_table(CONFIG_STR_FN_TABLE *); -extern void get_config_int_fn_table(CONFIG_INT_FN_TABLE *); -extern void get_config_bool_fn_table(CONFIG_BOOL_FN_TABLE *); -extern void get_config_raw_fn_table(CONFIG_STR_FN_TABLE *); + * Global library. + */ +#include + + /* + * Aliases. + */ +#define config_eval mail_conf_eval +#define config_lookup mail_conf_lookup +#define config_lookup_eval mail_conf_lookup_eval +#define config_read mail_conf_read +#define read_config mail_conf_update +#define get_config_bool get_mail_conf_bool +#define get_config_bool_fn get_mail_conf_bool_fn +#define get_config_bool_fn_table get_mail_conf_bool_fn_table +#define get_config_bool_table get_mail_conf_bool_table +#define get_config_int get_mail_conf_int +#define get_config_int2 get_mail_conf_int2 +#define get_config_int_fn get_mail_conf_int_fn +#define get_config_int_fn_table get_mail_conf_int_fn_table +#define get_config_int_table get_mail_conf_int_table +#define get_config_raw get_mail_conf_raw +#define get_config_raw_fn get_mail_conf_raw_fn +#define get_config_raw_fn_table get_mail_conf_raw_fn_table +#define get_config_raw_table get_mail_conf_raw_table +#define get_config_str get_mail_conf_str +#define get_config_str_fn get_mail_conf_str_fn +#define get_config_str_fn_table get_mail_conf_str_fn_table +#define get_config_str_table get_mail_conf_str_table +#define set_config_bool set_mail_conf_bool +#define set_config_int set_mail_conf_int +#define set_config_str set_mail_conf_str /* LICENSE /* .ad diff --git a/postfix/global/debug_process.c b/postfix/global/debug_process.c index 0911afc1d..d04567863 100644 --- a/postfix/global/debug_process.c +++ b/postfix/global/debug_process.c @@ -42,7 +42,7 @@ /* Global library. */ #include "mail_params.h" -#include "config.h" +#include "mail_conf.h" #include "debug_process.h" /* debug_process - run a debugger on this process */ @@ -54,7 +54,7 @@ void debug_process(void) /* * Expand $debugger_command then run it. */ - command = config_lookup_eval(VAR_DEBUG_COMMAND); + command = mail_conf_lookup_eval(VAR_DEBUG_COMMAND); if (*command == 0) msg_fatal("no %s variable set up", VAR_DEBUG_COMMAND); msg_info("running: %s", command); diff --git a/postfix/global/dot_lockfile.c b/postfix/global/dot_lockfile.c index ccedc2f90..599343679 100644 --- a/postfix/global/dot_lockfile.c +++ b/postfix/global/dot_lockfile.c @@ -138,7 +138,7 @@ void dot_unlockfile(const char *path) #include #include #include -#include +#include main(int argc, char **argv) { @@ -147,7 +147,7 @@ main(int argc, char **argv) msg_vstream_init(argv[0], VSTREAM_ERR); if (argc != 2) msg_fatal("usage: %s file-to-be-locked", argv[0]); - read_config(); + mail_conf_read(); if (dot_lockfile(argv[1], why) < 0) msg_fatal("%s", vstring_str(why)); dot_unlockfile(argv[1]); diff --git a/postfix/global/mail_addr_crunch.c b/postfix/global/mail_addr_crunch.c index 560602d50..5f1c3a707 100644 --- a/postfix/global/mail_addr_crunch.c +++ b/postfix/global/mail_addr_crunch.c @@ -112,7 +112,7 @@ ARGV *mail_addr_crunch(const char *string, const char *extension) #include #include #include -#include +#include #include int main(int unused_argc, char **unused_argv) @@ -122,7 +122,7 @@ int main(int unused_argc, char **unused_argv) ARGV *argv; char **cpp; - read_config(); + mail_conf_read(); if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); diff --git a/postfix/global/mail_addr_find.c b/postfix/global/mail_addr_find.c index de8b7fe7e..e5ee6bd2b 100644 --- a/postfix/global/mail_addr_find.c +++ b/postfix/global/mail_addr_find.c @@ -194,7 +194,7 @@ const char *mail_addr_find(MAPS *path, const char *address, char **extp) */ #include #include -#include +#include int main(int argc, char **argv) { @@ -213,7 +213,7 @@ int main(int argc, char **argv) /* * Initialize. */ - read_config(); + mail_conf_read(); path = maps_create(argv[0], argv[1], DICT_FLAG_LOCK); while (vstring_fgets_nonl(buffer, VSTREAM_IN)) { extent = 0; diff --git a/postfix/global/mail_addr_map.c b/postfix/global/mail_addr_map.c index 6949f5fd9..8d9436804 100644 --- a/postfix/global/mail_addr_map.c +++ b/postfix/global/mail_addr_map.c @@ -135,7 +135,7 @@ ARGV *mail_addr_map(MAPS *path, const char *address) * the lookup result. */ #include -#include +#include #include #include #include @@ -155,7 +155,7 @@ int main(int argc, char **argv) /* * Initialize. */ - read_config(); + mail_conf_read(); msg_verbose = 1; if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); diff --git a/postfix/global/config.c b/postfix/global/mail_conf.c similarity index 69% rename from postfix/global/config.c rename to postfix/global/mail_conf.c index 10b8aadc9..bb491892c 100644 --- a/postfix/global/config.c +++ b/postfix/global/mail_conf.c @@ -1,46 +1,46 @@ /*++ /* NAME -/* config 3 +/* mail_conf 3 /* SUMMARY /* global configuration parameter management /* SYNOPSIS -/* #include +/* #include /* -/* void read_config() +/* void mail_conf_read() /* -/* void config_update(name, value) +/* void mail_conf_update(name, value) /* const char *name; /* const char *value; /* -/* const char *config_lookup(name) +/* const char *mail_conf_lookup(name) /* const char *name; /* -/* const char *config_eval(string) +/* const char *mail_conf_eval(string) /* const char *string; /* -/* const char *config_lookup_eval(name) +/* const char *mail_conf_lookup_eval(name) /* const char *name; /* DESCRIPTION -/* read_config() reads the global Postfix configuration file, and +/* mail_conf_read() reads the global Postfix configuration file, and /* stores its values into a global configuration dictionary. /* /* The following routines are wrappers around the generic dictionary /* access routines. /* -/* config_update() updates the named global parameter. This has +/* mail_conf_update() updates the named global parameter. This has /* no effect on parameters whose value has already been looked up. /* The update succeeds or the program terminates with fatal error. /* -/* config_lookup() looks up the value of the named parameter. +/* mail_conf_lookup() looks up the value of the named parameter. /* A null pointer result means the parameter was not found. /* The result is volatile and should be copied if it is to be /* used for any appreciable amount of time. /* -/* config_eval() recursively expands any $parameters in the +/* mail_conf_eval() recursively expands any $parameters in the /* string argument. The result is volatile and should be copied /* if it is to be used for any appreciable amount of time. /* -/* config_lookup_eval() looks up the named parameter, and expands any +/* mail_conf_lookup_eval() looks up the named parameter, and expands any /* $parameters in the result. The result is volatile and should be /* copied if it is to be used for any appreciable amount of time. /* DIAGNOSTICS @@ -52,8 +52,8 @@ /* MAIL_VERBOSE, enable verbose mode /* SEE ALSO /* dict(3) generic dictionary manager -/* config_int(3) integer-valued parameters -/* config_str(3) string-valued parameters +/* mail_conf_int(3) integer-valued parameters +/* mail_conf_str(3) string-valued parameters /* LICENSE /* .ad /* .fi @@ -83,11 +83,11 @@ /* Global library. */ #include "mail_params.h" -#include "config.h" +#include "mail_conf.h" -/* read_config - read global configuration file */ +/* mail_conf_read - read global configuration file */ -void read_config(void) +void mail_conf_read(void) { char *config_dir; char *path; @@ -103,32 +103,32 @@ void read_config(void) myfree(var_config_dir); var_config_dir = mystrdup((config_dir = safe_getenv(CONF_ENV_PATH)) != 0 ? config_dir : DEF_CONFIG_DIR); /* XXX */ - set_config_str(VAR_CONFIG_DIR, var_config_dir); + set_mail_conf_str(VAR_CONFIG_DIR, var_config_dir); path = concatenate(var_config_dir, "/", "main.cf", (char *) 0); dict_load_file(CONFIG_DICT, path); myfree(path); mail_params_init(); } -/* config_eval - expand macros in string */ +/* mail_conf_eval - expand macros in string */ -const char *config_eval(const char *string) +const char *mail_conf_eval(const char *string) { #define RECURSIVE 1 return (dict_eval(CONFIG_DICT, string, RECURSIVE)); } -/* config_lookup - lookup named variable */ +/* mail_conf_lookup - lookup named variable */ -const char *config_lookup(const char *name) +const char *mail_conf_lookup(const char *name) { return (dict_lookup(CONFIG_DICT, name)); } -/* config_lookup_eval - expand named variable */ +/* mail_conf_lookup_eval - expand named variable */ -const char *config_lookup_eval(const char *name) +const char *mail_conf_lookup_eval(const char *name) { const char *value; @@ -139,9 +139,9 @@ const char *config_lookup_eval(const char *name) return (value); } -/* config_update - update parameter */ +/* mail_conf_update - update parameter */ -void config_update(const char *key, const char *value) +void mail_conf_update(const char *key, const char *value) { dict_update(CONFIG_DICT, key, value); } diff --git a/postfix/global/mail_conf.h b/postfix/global/mail_conf.h new file mode 100644 index 000000000..6443ff78d --- /dev/null +++ b/postfix/global/mail_conf.h @@ -0,0 +1,140 @@ +#ifndef _MAIL_CONF_H_INCLUDED_ +#define _MAIL_CONF_H_INCLUDED_ + +/*++ +/* NAME +/* mail_conf 3h +/* SUMMARY +/* global configuration parameter management +/* SYNOPSIS +/* #include +/* DESCRIPTION +/* .nf + + /* + * Well known names. These are not configurable. One has to start somewhere. + */ +#define CONFIG_DICT "mail_dict" /* global Postfix dictionary */ + + /* + * Environment variables. + */ +#define CONF_ENV_PATH "MAIL_CONFIG" /* config database */ +#define CONF_ENV_VERB "MAIL_VERBOSE" /* verbose mode on */ +#define CONF_ENV_DEBUG "MAIL_DEBUG" /* verbose mode on */ + + /* + * External representation for booleans. + */ +#define CONFIG_BOOL_YES "yes" +#define CONFIG_BOOL_NO "no" + + /* + * Basic configuration management. + */ +extern void mail_conf_read(void); + +extern void mail_conf_update(const char *, const char *); +extern const char *mail_conf_lookup(const char *); +extern const char *mail_conf_eval(const char *); +extern const char *mail_conf_lookup_eval(const char *); + + /* + * Specific parameter lookup routines. + */ +extern char *get_mail_conf_str(const char *, const char *, int, int); +extern int get_mail_conf_int(const char *, int, int, int); +extern int get_mail_conf_bool(const char *, int); +extern char *get_mail_conf_raw(const char *, const char *, int, int); + +extern int get_mail_conf_int2(const char *, const char *, int, int, int); + + /* + * Lookup with function-call defaults. + */ +extern char *get_mail_conf_str_fn(const char *, const char *(*) (void), int, int); +extern int get_mail_conf_int_fn(const char *, int (*) (void), int, int); +extern int get_mail_conf_bool_fn(const char *, int (*) (void)); +extern char *get_mail_conf_raw_fn(const char *, const char *(*) (void), int, int); + + /* + * Update dictionary. + */ +extern void set_mail_conf_str(const char *, const char *); +extern void set_mail_conf_int(const char *, int); +extern void set_mail_conf_bool(const char *, int); + + /* + * Tables that allow us to selectively copy values from the global + * configuration file to global variables. + */ +typedef struct { + const char *name; /* config variable name */ + const char *defval; /* default value or null */ + char **target; /* pointer to global variable */ + int min; /* min length or zero */ + int max; /* max length or zero */ +} CONFIG_STR_TABLE; + +typedef struct { + const char *name; /* config variable name */ + int defval; /* default value */ + int *target; /* pointer to global variable */ + int min; /* lower bound or zero */ + int max; /* upper bound or zero */ +} CONFIG_INT_TABLE; + +typedef struct { + const char *name; /* config variable name */ + int defval; /* default value */ + int *target; /* pointer to global variable */ +} CONFIG_BOOL_TABLE; + +extern void get_mail_conf_str_table(CONFIG_STR_TABLE *); +extern void get_mail_conf_int_table(CONFIG_INT_TABLE *); +extern void get_mail_conf_bool_table(CONFIG_BOOL_TABLE *); +extern void get_mail_conf_raw_table(CONFIG_STR_TABLE *); + + /* + * Tables to initialize parameters from the global configuration file or + * from function calls. + */ +typedef struct { + const char *name; /* config variable name */ + const char *(*defval) (void); /* default value provider */ + char **target; /* pointer to global variable */ + int min; /* lower bound or zero */ + int max; /* upper bound or zero */ +} CONFIG_STR_FN_TABLE; + +typedef struct { + const char *name; /* config variable name */ + int (*defval) (void); /* default value provider */ + int *target; /* pointer to global variable */ + int min; /* lower bound or zero */ + int max; /* upper bound or zero */ +} CONFIG_INT_FN_TABLE; + +typedef struct { + const char *name; /* config variable name */ + int (*defval) (void); /* default value provider */ + int *target; /* pointer to global variable */ +} CONFIG_BOOL_FN_TABLE; + +extern void get_mail_conf_str_fn_table(CONFIG_STR_FN_TABLE *); +extern void get_mail_conf_int_fn_table(CONFIG_INT_FN_TABLE *); +extern void get_mail_conf_bool_fn_table(CONFIG_BOOL_FN_TABLE *); +extern void get_mail_conf_raw_fn_table(CONFIG_STR_FN_TABLE *); + +/* 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 diff --git a/postfix/global/config_bool.c b/postfix/global/mail_conf_bool.c similarity index 51% rename from postfix/global/config_bool.c rename to postfix/global/mail_conf_bool.c index 0569760c2..f366e2325 100644 --- a/postfix/global/config_bool.c +++ b/postfix/global/mail_conf_bool.c @@ -1,29 +1,29 @@ /*++ /* NAME -/* config_bool 3 +/* mail_conf_bool 3 /* SUMMARY /* boolean-valued configuration parameter support /* SYNOPSIS -/* #include +/* #include /* -/* int get_config_bool(name, defval) +/* int get_mail_conf_bool(name, defval) /* const char *path; /* const char *name; /* int defval; /* -/* int get_config_bool_fn(name, defval) +/* int get_mail_conf_bool_fn(name, defval) /* const char *path; /* const char *name; /* int (*defval)(); /* -/* void set_config_bool(name, value) +/* void set_mail_conf_bool(name, value) /* const char *name; /* int value; /* -/* void get_config_bool_table(table) +/* void get_mail_conf_bool_table(table) /* CONFIG_BOOL_TABLE *table; /* -/* void get_config_bool_fn_table(table) +/* void get_mail_conf_bool_fn_table(table) /* CONFIG_BOOL_TABLE *table; /* DESCRIPTION /* This module implements configuration parameter support for @@ -32,27 +32,27 @@ /* (false) and "yes" (true). The conversion from external /* representation is case insensitive. /* -/* get_config_bool() looks up the named entry in the global +/* get_mail_conf_bool() looks up the named entry in the global /* configuration dictionary. The specified default value is /* returned when no value was found. /* -/* get_config_bool_fn() is similar but specifies a function that +/* get_mail_conf_bool_fn() is similar but specifies a function that /* provides the default value. The function is called only /* when the default value is needed. /* -/* set_config_bool() updates the named entry in the global +/* set_mail_conf_bool() updates the named entry in the global /* configuration dictionary. This has no effect on values that -/* have been looked up earlier via the get_config_XXX() routines. +/* have been looked up earlier via the get_mail_conf_XXX() routines. /* -/* get_config_bool_table() and get_config_int_fn_table() initialize +/* get_mail_conf_bool_table() and get_mail_conf_int_fn_table() initialize /* lists of variables, as directed by their table arguments. A table /* must be terminated by a null entry. /* DIAGNOSTICS /* Fatal errors: malformed boolean value. /* SEE ALSO /* config(3) general configuration -/* config_str(3) string-valued configuration parameters -/* config_int(3) integer-valued configuration parameters +/* mail_conf_str(3) string-valued configuration parameters +/* mail_conf_int(3) integer-valued configuration parameters /* LICENSE /* .ad /* .fi @@ -81,15 +81,15 @@ /* Global library. */ -#include "config.h" +#include "mail_conf.h" -/* convert_config_bool - look up and convert boolean parameter value */ +/* convert_mail_conf_bool - look up and convert boolean parameter value */ -static int convert_config_bool(const char *name, int *intval) +static int convert_mail_conf_bool(const char *name, int *intval) { const char *strval; - if ((strval = config_lookup_eval(name)) == 0) { + if ((strval = mail_conf_lookup_eval(name)) == 0) { return (0); } else { if (strcasecmp(strval, CONFIG_BOOL_YES) == 0) { @@ -103,53 +103,53 @@ static int convert_config_bool(const char *name, int *intval) } } -/* get_config_bool - evaluate boolean-valued configuration variable */ +/* get_mail_conf_bool - evaluate boolean-valued configuration variable */ -int get_config_bool(const char *name, int defval) +int get_mail_conf_bool(const char *name, int defval) { int intval; - if (convert_config_bool(name, &intval) == 0) - set_config_bool(name, intval = defval); + if (convert_mail_conf_bool(name, &intval) == 0) + set_mail_conf_bool(name, intval = defval); return (intval); } -/* get_config_bool_fn - evaluate boolean-valued configuration variable */ +/* get_mail_conf_bool_fn - evaluate boolean-valued configuration variable */ typedef int (*stupid_indent_int) (void); -int get_config_bool_fn(const char *name, stupid_indent_int defval) +int get_mail_conf_bool_fn(const char *name, stupid_indent_int defval) { int intval; - if (convert_config_bool(name, &intval) == 0) - set_config_bool(name, intval = defval()); + if (convert_mail_conf_bool(name, &intval) == 0) + set_mail_conf_bool(name, intval = defval()); return (intval); } -/* set_config_bool - update boolean-valued configuration dictionary entry */ +/* set_mail_conf_bool - update boolean-valued configuration dictionary entry */ -void set_config_bool(const char *name, int value) +void set_mail_conf_bool(const char *name, int value) { - config_update(name, value ? CONFIG_BOOL_YES : CONFIG_BOOL_NO); + mail_conf_update(name, value ? CONFIG_BOOL_YES : CONFIG_BOOL_NO); } -/* get_config_bool_table - look up table of booleans */ +/* get_mail_conf_bool_table - look up table of booleans */ -void get_config_bool_table(CONFIG_BOOL_TABLE *table) +void get_mail_conf_bool_table(CONFIG_BOOL_TABLE *table) { while (table->name) { - table->target[0] = get_config_bool(table->name, table->defval); + table->target[0] = get_mail_conf_bool(table->name, table->defval); table++; } } -/* get_config_bool_fn_table - look up booleans, defaults are functions */ +/* get_mail_conf_bool_fn_table - look up booleans, defaults are functions */ -void get_config_bool_fn_table(CONFIG_BOOL_FN_TABLE *table) +void get_mail_conf_bool_fn_table(CONFIG_BOOL_FN_TABLE *table) { while (table->name) { - table->target[0] = get_config_bool_fn(table->name, table->defval); + table->target[0] = get_mail_conf_bool_fn(table->name, table->defval); table++; } } diff --git a/postfix/global/config_int.c b/postfix/global/mail_conf_int.c similarity index 50% rename from postfix/global/config_int.c rename to postfix/global/mail_conf_int.c index fba915d70..da4f0ddab 100644 --- a/postfix/global/config_int.c +++ b/postfix/global/mail_conf_int.c @@ -1,34 +1,34 @@ /*++ /* NAME -/* config_int 3 +/* mail_conf_int 3 /* SUMMARY /* integer-valued configuration parameter support /* SYNOPSIS -/* #include +/* #include /* -/* int get_config_int(name, defval, min, max); +/* int get_mail_conf_int(name, defval, min, max); /* const char *name; /* int defval; /* int min; /* int max; /* -/* int get_config_int_fn(name, defval, min, max); +/* int get_mail_conf_int_fn(name, defval, min, max); /* const char *name; /* int (*defval)(); /* int min; /* int max; /* -/* void set_config_int(name, value) +/* void set_mail_conf_int(name, value) /* const char *name; /* int value; /* -/* void get_config_int_table(table) +/* void get_mail_conf_int_table(table) /* CONFIG_INT_TABLE *table; /* -/* void get_config_int_fn_table(table) +/* void get_mail_conf_int_fn_table(table) /* CONFIG_INT_TABLE *table; /* AUXILIARY FUNCTIONS -/* int get_config_int2(name1, name2, defval, min, max); +/* int get_mail_conf_int2(name1, name2, defval, min, max); /* const char *name1; /* const char *name2; /* int defval; @@ -38,32 +38,32 @@ /* This module implements configuration parameter support /* for integer values. /* -/* get_config_int() looks up the named entry in the global +/* get_mail_conf_int() looks up the named entry in the global /* configuration dictionary. The default value is returned /* when no value was found. /* \fImin\fR is zero or specifies a lower limit on the integer /* value or string length; \fImax\fR is zero or specifies an /* upper limit on the integer value or string length. /* -/* get_config_int_fn() is similar but specifies a function that +/* get_mail_conf_int_fn() is similar but specifies a function that /* provides the default value. The function is called only /* when the default value is needed. /* -/* set_config_int() updates the named entry in the global +/* set_mail_conf_int() updates the named entry in the global /* configuration dictionary. This has no effect on values that -/* have been looked up earlier via the get_config_XXX() routines. +/* have been looked up earlier via the get_mail_conf_XXX() routines. /* -/* get_config_int_table() and get_config_int_fn_table() initialize +/* get_mail_conf_int_table() and get_mail_conf_int_fn_table() initialize /* lists of variables, as directed by their table arguments. A table /* must be terminated by a null entry. /* -/* get_config_int2() concatenates the two names and is otherwise -/* identical to get_config_int(). +/* get_mail_conf_int2() concatenates the two names and is otherwise +/* identical to get_mail_conf_int(). /* DIAGNOSTICS /* Fatal errors: malformed numerical value. /* SEE ALSO /* config(3) general configuration -/* config_str(3) string-valued configuration parameters +/* mail_conf_str(3) string-valued configuration parameters /* LICENSE /* .ad /* .fi @@ -90,16 +90,16 @@ /* Global library. */ -#include "config.h" +#include "mail_conf.h" -/* convert_config_int - look up and convert integer parameter value */ +/* convert_mail_conf_int - look up and convert integer parameter value */ -static int convert_config_int(const char *name, int *intval) +static int convert_mail_conf_int(const char *name, int *intval) { const char *strval; char junk; - if ((strval = config_lookup_eval(name)) != 0) { + if ((strval = mail_conf_lookup_eval(name)) != 0) { if (sscanf(strval, "%d%c", intval, &junk) != 1) msg_fatal("bad numerical configuration: %s = %s", name, strval); return (1); @@ -107,9 +107,9 @@ static int convert_config_int(const char *name, int *intval) return (0); } -/* check_config_int - validate integer value */ +/* check_mail_conf_int - validate integer value */ -static void check_config_int(const char *name, int intval, int min, int max) +static void check_mail_conf_int(const char *name, int intval, int min, int max) { if (min && intval < min) msg_fatal("invalid %s: %d (min %d)", name, intval, min); @@ -117,76 +117,76 @@ static void check_config_int(const char *name, int intval, int min, int max) msg_fatal("invalid %s: %d (max %d)", name, intval, max); } -/* get_config_int - evaluate integer-valued configuration variable */ +/* get_mail_conf_int - evaluate integer-valued configuration variable */ -int get_config_int(const char *name, int defval, int min, int max) +int get_mail_conf_int(const char *name, int defval, int min, int max) { int intval; - if (convert_config_int(name, &intval) == 0) - set_config_int(name, intval = defval); - check_config_int(name, intval, min, max); + if (convert_mail_conf_int(name, &intval) == 0) + set_mail_conf_int(name, intval = defval); + check_mail_conf_int(name, intval, min, max); return (intval); } -/* get_config_int2 - evaluate integer-valued configuration variable */ +/* get_mail_conf_int2 - evaluate integer-valued configuration variable */ -int get_config_int2(const char *name1, const char *name2, int defval, +int get_mail_conf_int2(const char *name1, const char *name2, int defval, int min, int max) { int intval; char *name; name = concatenate(name1, name2, (char *) 0); - if (convert_config_int(name, &intval) == 0) - set_config_int(name, intval = defval); - check_config_int(name, intval, min, max); + if (convert_mail_conf_int(name, &intval) == 0) + set_mail_conf_int(name, intval = defval); + check_mail_conf_int(name, intval, min, max); myfree(name); return (intval); } -/* get_config_int_fn - evaluate integer-valued configuration variable */ +/* get_mail_conf_int_fn - evaluate integer-valued configuration variable */ typedef int (*stupid_indent_int) (void); -int get_config_int_fn(const char *name, stupid_indent_int defval, +int get_mail_conf_int_fn(const char *name, stupid_indent_int defval, int min, int max) { int intval; - if (convert_config_int(name, &intval) == 0) - set_config_int(name, intval = defval()); - check_config_int(name, intval, min, max); + if (convert_mail_conf_int(name, &intval) == 0) + set_mail_conf_int(name, intval = defval()); + check_mail_conf_int(name, intval, min, max); return (intval); } -/* set_config_int - update integer-valued configuration dictionary entry */ +/* set_mail_conf_int - update integer-valued configuration dictionary entry */ -void set_config_int(const char *name, int value) +void set_mail_conf_int(const char *name, int value) { char buf[BUFSIZ]; /* yeah! crappy code! */ sprintf(buf, "%d", value); /* yeah! more crappy code! */ - config_update(name, buf); + mail_conf_update(name, buf); } -/* get_config_int_table - look up table of integers */ +/* get_mail_conf_int_table - look up table of integers */ -void get_config_int_table(CONFIG_INT_TABLE *table) +void get_mail_conf_int_table(CONFIG_INT_TABLE *table) { while (table->name) { - table->target[0] = get_config_int(table->name, table->defval, + table->target[0] = get_mail_conf_int(table->name, table->defval, table->min, table->max); table++; } } -/* get_config_int_fn_table - look up integers, defaults are functions */ +/* get_mail_conf_int_fn_table - look up integers, defaults are functions */ -void get_config_int_fn_table(CONFIG_INT_FN_TABLE *table) +void get_mail_conf_int_fn_table(CONFIG_INT_FN_TABLE *table) { while (table->name) { - table->target[0] = get_config_int_fn(table->name, table->defval, + table->target[0] = get_mail_conf_int_fn(table->name, table->defval, table->min, table->max); table++; } diff --git a/postfix/global/config_raw.c b/postfix/global/mail_conf_raw.c similarity index 60% rename from postfix/global/config_raw.c rename to postfix/global/mail_conf_raw.c index 2a5558f71..21eda4aea 100644 --- a/postfix/global/config_raw.c +++ b/postfix/global/mail_conf_raw.c @@ -1,44 +1,44 @@ /*++ /* NAME -/* config_raw 3 +/* mail_conf_raw 3 /* SUMMARY /* raw string-valued global configuration parameter support /* SYNOPSIS -/* #include +/* #include /* -/* char *get_config_raw(name, defval, min, max) +/* char *get_mail_conf_raw(name, defval, min, max) /* const char *name; /* const char *defval; /* int min; /* int max; /* -/* char *get_config_raw_fn(name, defval, min, max) +/* char *get_mail_conf_raw_fn(name, defval, min, max) /* const char *name; /* const char *(*defval)(void); /* int min; /* int max; /* -/* void get_config_raw_table(table) +/* void get_mail_conf_raw_table(table) /* CONFIG_STR_TABLE *table; /* -/* void get_config_raw_fn_table(table) +/* void get_mail_conf_raw_fn_table(table) /* CONFIG_STR_TABLE *table; /* DESCRIPTION /* This module implements support for string-valued global /* configuration parameters that are loaded without $name expansion. /* -/* get_config_raw() looks up the named entry in the global +/* get_mail_conf_raw() looks up the named entry in the global /* configuration dictionary. The default value is returned when /* no value was found. String results should be passed to myfree() /* when no longer needed. \fImin\fR is zero or specifies a lower /* bound on the string length; \fImax\fR is zero or specifies an /* upper limit on the string length. /* -/* get_config_raw_fn() is similar but specifies a function that +/* get_mail_conf_raw_fn() is similar but specifies a function that /* provides the default value. The function is called only when /* the default value is used. /* -/* get_config_raw_table() and get_config_raw_fn_table() read +/* get_mail_conf_raw_table() and get_mail_conf_raw_fn_table() read /* lists of variables, as directed by their table arguments. A table /* must be terminated by a null entry. /* DIAGNOSTICS @@ -69,11 +69,11 @@ /* Global library. */ -#include "config.h" +#include "mail_conf.h" -/* check_config_raw - validate string length */ +/* check_mail_conf_raw - validate string length */ -static void check_config_raw(const char *name, const char *strval, +static void check_mail_conf_raw(const char *name, const char *strval, int min, int max) { int len = strlen(strval); @@ -86,59 +86,59 @@ static void check_config_raw(const char *name, const char *strval, len, max, name, strval); } -/* get_config_raw - evaluate string-valued configuration variable */ +/* get_mail_conf_raw - evaluate string-valued configuration variable */ -char *get_config_raw(const char *name, const char *defval, +char *get_mail_conf_raw(const char *name, const char *defval, int min, int max) { const char *strval; - if ((strval = config_lookup(name)) == 0) { + if ((strval = mail_conf_lookup(name)) == 0) { strval = defval; - config_update(name, strval); + mail_conf_update(name, strval); } - check_config_raw(name, strval, min, max); + check_mail_conf_raw(name, strval, min, max); return (mystrdup(strval)); } -/* get_config_raw_fn - evaluate string-valued configuration variable */ +/* get_mail_conf_raw_fn - evaluate string-valued configuration variable */ typedef const char *(*stupid_indent_str) (void); -char *get_config_raw_fn(const char *name, stupid_indent_str defval, +char *get_mail_conf_raw_fn(const char *name, stupid_indent_str defval, int min, int max) { const char *strval; - if ((strval = config_lookup(name)) == 0) { + if ((strval = mail_conf_lookup(name)) == 0) { strval = defval(); - config_update(name, strval); + mail_conf_update(name, strval); } - check_config_raw(name, strval, min, max); + check_mail_conf_raw(name, strval, min, max); return (mystrdup(strval)); } -/* get_config_raw_table - look up table of strings */ +/* get_mail_conf_raw_table - look up table of strings */ -void get_config_raw_table(CONFIG_STR_TABLE *table) +void get_mail_conf_raw_table(CONFIG_STR_TABLE *table) { while (table->name) { if (table->target[0]) myfree(table->target[0]); - table->target[0] = get_config_raw(table->name, table->defval, + table->target[0] = get_mail_conf_raw(table->name, table->defval, table->min, table->max); table++; } } -/* get_config_raw_fn_table - look up strings, defaults are functions */ +/* get_mail_conf_raw_fn_table - look up strings, defaults are functions */ -void get_config_raw_fn_table(CONFIG_STR_FN_TABLE *table) +void get_mail_conf_raw_fn_table(CONFIG_STR_FN_TABLE *table) { while (table->name) { if (table->target[0]) myfree(table->target[0]); - table->target[0] = get_config_raw_fn(table->name, table->defval, + table->target[0] = get_mail_conf_raw_fn(table->name, table->defval, table->min, table->max); table++; } diff --git a/postfix/global/config_str.c b/postfix/global/mail_conf_str.c similarity index 55% rename from postfix/global/config_str.c rename to postfix/global/mail_conf_str.c index 6d2c6c37b..fba5ead46 100644 --- a/postfix/global/config_str.c +++ b/postfix/global/mail_conf_str.c @@ -1,52 +1,52 @@ /*++ /* NAME -/* config_str 3 +/* mail_conf_str 3 /* SUMMARY /* string-valued global configuration parameter support /* SYNOPSIS -/* #include +/* #include /* -/* char *get_config_str(name, defval, min, max) +/* char *get_mail_conf_str(name, defval, min, max) /* const char *name; /* const char *defval; /* int min; /* int max; /* -/* char *get_config_str_fn(name, defval, min, max) +/* char *get_mail_conf_str_fn(name, defval, min, max) /* const char *name; /* const char *(*defval)(void); /* int min; /* int max; /* -/* void set_config_str(name, value) +/* void set_mail_conf_str(name, value) /* const char *name; /* const char *value; /* -/* void get_config_str_table(table) +/* void get_mail_conf_str_table(table) /* CONFIG_STR_TABLE *table; /* -/* void get_config_str_fn_table(table) +/* void get_mail_conf_str_fn_table(table) /* CONFIG_STR_TABLE *table; /* DESCRIPTION /* This module implements support for string-valued global /* configuration parameters. /* -/* get_config_str() looks up the named entry in the global +/* get_mail_conf_str() looks up the named entry in the global /* configuration dictionary. The default value is returned when /* no value was found. String results should be passed to myfree() /* when no longer needed. \fImin\fR is zero or specifies a lower /* bound on the string length; \fImax\fR is zero or specifies an /* upper limit on the string length. /* -/* get_config_str_fn() is similar but specifies a function that +/* get_mail_conf_str_fn() is similar but specifies a function that /* provides the default value. The function is called only when /* the default value is used. /* -/* set_config_str() updates the named entry in the global +/* set_mail_conf_str() updates the named entry in the global /* configuration dictionary. This has no effect on values that -/* have been looked up earlier via the get_config_XXX() routines. +/* have been looked up earlier via the get_mail_conf_XXX() routines. /* -/* get_config_str_table() and get_config_str_fn_table() read +/* get_mail_conf_str_table() and get_mail_conf_str_fn_table() read /* lists of variables, as directed by their table arguments. A table /* must be terminated by a null entry. /* DIAGNOSTICS @@ -77,11 +77,11 @@ /* Global library. */ -#include "config.h" +#include "mail_conf.h" -/* check_config_str - validate string length */ +/* check_mail_conf_str - validate string length */ -static void check_config_str(const char *name, const char *strval, +static void check_mail_conf_str(const char *name, const char *strval, int min, int max) { int len = strlen(strval); @@ -94,66 +94,66 @@ static void check_config_str(const char *name, const char *strval, len, max, name, strval); } -/* get_config_str - evaluate string-valued configuration variable */ +/* get_mail_conf_str - evaluate string-valued configuration variable */ -char *get_config_str(const char *name, const char *defval, +char *get_mail_conf_str(const char *name, const char *defval, int min, int max) { const char *strval; - if ((strval = config_lookup_eval(name)) == 0) { - strval = config_eval(defval); - config_update(name, strval); + if ((strval = mail_conf_lookup_eval(name)) == 0) { + strval = mail_conf_eval(defval); + mail_conf_update(name, strval); } - check_config_str(name, strval, min, max); + check_mail_conf_str(name, strval, min, max); return (mystrdup(strval)); } -/* get_config_str_fn - evaluate string-valued configuration variable */ +/* get_mail_conf_str_fn - evaluate string-valued configuration variable */ typedef const char *(*stupid_indent_str) (void); -char *get_config_str_fn(const char *name, stupid_indent_str defval, +char *get_mail_conf_str_fn(const char *name, stupid_indent_str defval, int min, int max) { const char *strval; - if ((strval = config_lookup_eval(name)) == 0) { - strval = config_eval(defval()); - config_update(name, strval); + if ((strval = mail_conf_lookup_eval(name)) == 0) { + strval = mail_conf_eval(defval()); + mail_conf_update(name, strval); } - check_config_str(name, strval, min, max); + check_mail_conf_str(name, strval, min, max); return (mystrdup(strval)); } -/* set_config_str - update string-valued configuration dictionary entry */ +/* set_mail_conf_str - update string-valued configuration dictionary entry */ -void set_config_str(const char *name, const char *value) +void set_mail_conf_str(const char *name, const char *value) { - config_update(name, value); + mail_conf_update(name, value); } -/* get_config_str_table - look up table of strings */ +/* get_mail_conf_str_table - look up table of strings */ -void get_config_str_table(CONFIG_STR_TABLE *table) +void get_mail_conf_str_table(CONFIG_STR_TABLE *table) { while (table->name) { if (table->target[0]) myfree(table->target[0]); - table->target[0] = get_config_str(table->name, table->defval, + table->target[0] = get_mail_conf_str(table->name, table->defval, table->min, table->max); table++; } } -/* get_config_str_fn_table - look up strings, defaults are functions */ +/* get_mail_conf_str_fn_table - look up strings, defaults are functions */ -void get_config_str_fn_table(CONFIG_STR_FN_TABLE *table) +void get_mail_conf_str_fn_table(CONFIG_STR_FN_TABLE *table) { while (table->name) { if (table->target[0]) myfree(table->target[0]); - table->target[0] = get_config_str_fn(table->name, table->defval, + table->target[0] = get_mail_conf_str_fn(table->name, table->defval, table->min, table->max); table++; } diff --git a/postfix/global/mail_params.c b/postfix/global/mail_params.c index f7388814c..a98e2b018 100644 --- a/postfix/global/mail_params.c +++ b/postfix/global/mail_params.c @@ -103,7 +103,7 @@ /* Global library. */ #include "mynetworks.h" -#include "config.h" +#include "mail_conf.h" #include "mail_version.h" #include "mail_params.h" @@ -176,7 +176,7 @@ static const char *check_myhostname(void) */ name = get_hostname(); if ((dot = strchr(name, '.')) == 0) { - if ((domain = config_lookup_eval(VAR_MYDOMAIN)) == 0) + if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0) msg_fatal("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf", name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir); name = concatenate(name, ".", domain, (char *) 0); @@ -298,16 +298,16 @@ void mail_params_init() * short hostnames in the host table; some sites name their system after * the domain. */ - get_config_str_fn_table(function_str_defaults); + get_mail_conf_str_fn_table(function_str_defaults); if (!valid_hostname(var_myhostname) || !valid_hostname(var_mydomain)) msg_fatal("host or domain name configuration error"); /* * Variables that are needed by almost every program. */ - get_config_str_table(other_str_defaults); - get_config_int_table(other_int_defaults); - get_config_bool_table(bool_defaults); + get_mail_conf_str_table(other_str_defaults); + get_mail_conf_int_table(other_int_defaults); + get_mail_conf_bool_table(bool_defaults); check_default_privs(); check_mail_owner(); @@ -317,12 +317,12 @@ void mail_params_init() * XXX Perhaps we should just register variables, and let the evaluator * figure out in what order to evaluate things. */ - get_config_str_fn_table(function_str_defaults_2); + get_mail_conf_str_fn_table(function_str_defaults_2); /* * The PID variable cannot be set from the configuration file!! */ - set_config_int(VAR_PID, var_pid = getpid()); + set_mail_conf_int(VAR_PID, var_pid = getpid()); /* * Neither can the start time variable. It isn't even visible. diff --git a/postfix/global/mail_proto.h b/postfix/global/mail_proto.h index d3934dc53..977df5604 100644 --- a/postfix/global/mail_proto.h +++ b/postfix/global/mail_proto.h @@ -39,6 +39,7 @@ #define MAIL_SERVICE_SMTP "smtp" #define MAIL_SERVICE_SMTPD "smtpd" #define MAIL_SERVICE_SHOWQ "showq" +#define MAIL_SERVICE_ERROR "error" /* * Well-known socket or FIFO directories. The main difference is in file diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index d2702bd0d..faa66cf08 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-19990423" +#define DEF_MAIL_VERSION "Snapshot-19990426" extern char *var_mail_version; /* LICENSE diff --git a/postfix/global/maps.c b/postfix/global/maps.c index 02af45d4c..26e41b755 100644 --- a/postfix/global/maps.c +++ b/postfix/global/maps.c @@ -97,7 +97,7 @@ /* Global library. */ -#include "config.h" +#include "mail_conf.h" #include "maps.h" /* maps_create - initialize */ diff --git a/postfix/global/resolve_clnt.c b/postfix/global/resolve_clnt.c index 3c6ef7ce0..ae47df04b 100644 --- a/postfix/global/resolve_clnt.c +++ b/postfix/global/resolve_clnt.c @@ -155,7 +155,7 @@ void resolve_clnt_free(RESOLVE_REPLY *reply) #include #include #include -#include +#include static NORETURN usage(char *myname) { @@ -180,7 +180,7 @@ main(int argc, char **argv) msg_vstream_init(argv[0], VSTREAM_ERR); - read_config(); + mail_conf_read(); msg_info("using config files in %s", var_config_dir); if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); diff --git a/postfix/global/resolve_local.c b/postfix/global/resolve_local.c index 6588fddc0..42fbae7b3 100644 --- a/postfix/global/resolve_local.c +++ b/postfix/global/resolve_local.c @@ -122,13 +122,13 @@ int resolve_local(const char *addr) #ifdef TEST #include -#include +#include int main(int argc, char **argv) { if (argc != 2) msg_fatal("usage: %s domain", argv[0]); - read_config(); + mail_conf_read(); vstream_printf("%s\n", resolve_local(argv[1]) ? "yes" : "no"); vstream_fflush(VSTREAM_OUT); } diff --git a/postfix/global/rewrite_clnt.c b/postfix/global/rewrite_clnt.c index a2545a78e..cfbec3c50 100644 --- a/postfix/global/rewrite_clnt.c +++ b/postfix/global/rewrite_clnt.c @@ -148,7 +148,7 @@ VSTRING *rewrite_clnt_internal(const char *ruleset, const char *addr, VSTRING *r #include #include #include -#include +#include #include static NORETURN usage(char *myname) @@ -174,7 +174,7 @@ main(int argc, char **argv) msg_vstream_init(argv[0], VSTREAM_ERR); - read_config(); + mail_conf_read(); msg_info("using config files in %s", var_config_dir); if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); diff --git a/postfix/local/Makefile.in b/postfix/local/Makefile.in index 96972411b..7f4a5f6ae 100644 --- a/postfix/local/Makefile.in +++ b/postfix/local/Makefile.in @@ -157,7 +157,7 @@ dotforward.o: ../include/mypwd.h dotforward.o: ../include/bounce.h dotforward.o: ../include/been_here.h dotforward.o: ../include/mail_params.h -dotforward.o: ../include/config.h +dotforward.o: ../include/mail_conf.h dotforward.o: local.h dotforward.o: ../include/tok822.h dotforward.o: ../include/resolve_clnt.h @@ -274,13 +274,14 @@ local.o: ../include/vstream.h local.o: ../include/iostuff.h local.o: ../include/name_mask.h local.o: ../include/set_eugid.h +local.o: ../include/dict.h local.o: ../include/mail_queue.h local.o: ../include/recipient_list.h local.o: ../include/deliver_request.h local.o: ../include/deliver_completed.h local.o: ../include/mail_params.h local.o: ../include/mail_addr.h -local.o: ../include/config.h +local.o: ../include/mail_conf.h local.o: ../include/been_here.h local.o: ../include/mail_server.h local.o: local.h diff --git a/postfix/local/dotforward.c b/postfix/local/dotforward.c index 1f49e7671..6c18f5647 100644 --- a/postfix/local/dotforward.c +++ b/postfix/local/dotforward.c @@ -75,7 +75,7 @@ #include #include #include -#include +#include /* Application-specific. */ @@ -191,10 +191,10 @@ int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) /* * Skip this module if per-user forwarding is disabled. XXX We need to - * extend the config_XXX() interface to request no expansion of $names in + * extend the mail_conf_XXX() interface to request no expansion of $names in * the given value or in the default value. */ - if ((forward_path = config_lookup(VAR_FORWARD_PATH)) == 0) + if ((forward_path = mail_conf_lookup(VAR_FORWARD_PATH)) == 0) forward_path = DEF_FORWARD_PATH; if (*forward_path == 0) return (NO); diff --git a/postfix/local/local.c b/postfix/local/local.c index 09d21b1d3..e865bb267 100644 --- a/postfix/local/local.c +++ b/postfix/local/local.c @@ -347,7 +347,7 @@ #include #include #include -#include +#include #include #include diff --git a/postfix/mantools/README b/postfix/mantools/README new file mode 100644 index 000000000..230cdc91a --- /dev/null +++ b/postfix/mantools/README @@ -0,0 +1,17 @@ +Scripts and tools to format embedded manual pages, or to format C +source code files. Each has an embedded man page in the source. + +ccformat c code formatter + usage: ccformat (copy stdin to stdout) + usage: ccformat files... (format files in place) + +enter set project-specific environment + usage: enter project-name + +mansect extract manual page section from source file + usage: mansect file.suffix + usage: mansect -type file + +srctoman extract man page from source file + usage: srctoman file.suffix + usage: srctoman -type file diff --git a/postfix/mantools/ccformat b/postfix/mantools/ccformat new file mode 100755 index 000000000..bdc74d647 --- /dev/null +++ b/postfix/mantools/ccformat @@ -0,0 +1,206 @@ +#!/bin/sh + +# ccformat - convert C code to standard format + +# @(#) ccformat.sh 1.3 11/5/89 14:39:29 + +# how to supress newlines in echo + +case `echo -n` in +"") n=-n; c=;; + *) n=; c='\c';; +esac + +# initialize + +TMPF=/tmp/ccformat.$$ +ERROR= +TROFF= +BCK= +FLAGS="-st -di8 -npsl -bap -bad -bbb -bc -i4 -d0 -nip -nfc1 -cd41 -c49" + +trap 'rm -f .ind.$$ $TMPF; exit 1' 1 2 3 15 + +# parse command options + +while : +do + case $1 in + -t) TROFF=-troff;; + -b) case $# in + 1) ERROR="-b option requires backup argument"; break;; + *) BCK=$2; shift;; + esac;; + -T) case $# in + 1) ERROR="-T option requires typename argument"; break;; + *) FLAGS="$FLAGS -T$2"; shift;; + esac;; + -*) ERROR="invalid option: $1"; break;; + *) break;; + esac + shift +done + +# check for invalid commands + +test -z "$ERROR" || { + echo "$0: $ERROR" 1>&2 + echo "usage: $0 [-b backup] [-t] [-T typename] [file(s)]" 1>&2 + exit 1; } + +# format the files + +case $# in + 0) indent $TROFF $FLAGS;; + *) case "$TROFF" in +-troff) for i in $* + do + indent $TROFF $FLAGS $i + done;; + *) for i in $* + do + echo $n $i... $c + test -z "$BCK" || cp $i $i"$BCK" || { echo backup FAILED; exit 1; } + { # some versions of indent return garbage exit status -- gack! + (indent $FLAGS <$i 2>.ind.$$ >$TMPF || test ! -s .ind.$$) >$TMPF && + # try a device full check + echo >>$TMPF && ( + # ignore interrupts while we overwrite the original file + trap '' 1 2 3 15; cp $TMPF $i + ) && echo replaced; } || { echo replacement FAILED; exit 1; } + done;; + esac;; +esac + +rm -f $TMPF .ind.$$ + +exit + +#++ +# NAME +# ccformat 1 +# SUMMARY +# convert C source text to standard format +# PROJECT +# sdetools +# SYNOPSIS +# ccformat [-b backup] [-t] [-T typename] [file(s)] +# DESCRIPTION +# The \fIccformat\fR command adjusts the layout of C program text +# such that it approximates the Kernighan and Ritchie coding style. +# +# If no file names are specified, \fIccformat\fR reads +# from standard input and writes the result to standard output. +# This is convenient for source formatting from within a text +# editor program. +# +# Otherwise, the named files are overwritten with their +# formatted equivalent. The \fI-b\fR option (see below) provides +# a way to create backup copies of the original files. +# +# Alternatively, the command can be used as a preprocessor for +# pretty-printing with the \fInroff\fR or \fItroff\fR commands +# (see the -t option below). In this case, output is always written +# to standard output and no change is made to source files. +# +# The following options are recognized: +# .TP +# -b backup +# Requests that a copy of the original files be saved. The backup +# file name is constructed by appending the specified \fIbackup\fR +# string to the original file name. +# This option is ignored when the \fI-t\fR +# option is specifid. +# .TP +# -t +# Makes the program act as a preprocessor +# for pretty-printing with \fInroff\fR or \fItroff\fR. +# For example, in order to produce a pretty-printed +# version on the line printer, use +# + ccformat -t file(s) | nroff -mindent | col | lp +# .TP +# -T typename +# Adds \fItypename\fR to the list of type keywords. +# Names accumulate: -T can be specified more +# than once. You need to specify all the +# typenames that appear in your program that +# are defined by typedefs - nothing will be +# harmed if you miss a few, but the program +# won't be formatted as nicely as it should. +# PROGRAM LAYOUT +# .fi +# .ad +# The following program layout is produced: +# .TP +# comments +# Comments starting in the first column are left untouched. +# These are often carefully laid out by the programmer. +# .sp +# Comments that appear in-between statements are lined up with +# the surrounding program text, and are adjusted to accomodate +# as many words on a line as possible. +# However, a blank line in the middle of a comment is respected. +# .sp +# Trailing comments after declarations begin at column 41 +# (5 tab stops). +# Trailing comments after executable statements start at +# column 49 (6 tab stops). +# .TP +# indentation +# Statements are indented by multiples of four columns. +# There is only one statement per line. A control statement +# is always placed on a separate line. +# .TP +# braces +# If an opening brace is preceded by a control statement (\fCif, +# else, do, for\fR or \fCswitch\fR), it is placed on the same line +# as the control statement. +# .sp +# A closing brace is placed at the same level of indentation as the +# program text that precedes the corresponding opening brace. +# If a closing brace is followed by a control statement (\fCelse\fR +# or \fCwhile\fR), that control statement is placed on the same line +# as the closing brace. +# .sp +# In practice, brace placement is as +# exemplified by the books on C by B.W. Kernighan and D.M. Ritchie. +# .TP +# blanks +# Blanks are placed around assignment and arithmetic operators. +# Commas in declarations or parameter lists are followed by one blank. +# .sp +# In the following cases a +# blank line is inserted if it is not already present in the text: +# 1) in front of a block comment, 2) between local declarations and +# executable statements 3) after each function body. +# .TP +# declarations +# In the output, each variable declaration appears on +# a separate line. +# COMMANDS +# indent(1) +# FILES +# /tmp/ccformat.* intermediate files +# SEE ALSO +# indent(1) +# DIAGNOSTICS +# Indent may complain in case of syntax errors. These show +# up as comments in the resulting program text. +# BUGS +# The programs seems to beave even when fed ANSI C or even C++ +# code; this has not been tested thoroughly, however. +# +# Will produce useless files when fed with anything that is +# not C program text. This does not imply a judgement about +# C programs in general. +# AUTHOR(S) +# W.Z. Venema +# Eindhoven University of Technology +# Department of Mathematics and Computer Science +# Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands +# CREATION DATE +# Fri May 6 14:07:04 MET DST 1988 +# STATUS +# ccformat.sh 1.3 11/5/89 14:39:29 (draft) +#-- diff --git a/postfix/mantools/enter b/postfix/mantools/enter new file mode 100755 index 000000000..4287c1a6c --- /dev/null +++ b/postfix/mantools/enter @@ -0,0 +1,145 @@ +#!/bin/sh + +# enter - set up project-specific environment + +# @(#) enter.sh 1.5 11/4/89 15:56:03 + +# initialize + +IFS=" +" + +: ${HOME?} ${SHELL=/bin/sh} make sure these are set + +# sanity checks... + +test $# = 1 || { + echo "Usage: ${0} project" 1>&2; exit 1 +} + +test -r ${HOME}/.${1} || { + echo "${0}: can't read environment file: '${HOME}/.${1}'" 1>&2; exit 1 +} + +test -x ${SHELL} || { + echo "${0}: can't execute command shell: '${SHELL}'" 1>&2; exit 1 +} + +# set up default Bourne-shell prompt + +export PS1; PS1="$1%${PS1- }" + +# load environment + +. ${HOME}/.${1} + +# define UPPER and lower-case environment variables with the project name + +_PNAME_=`echo ${1} | case \`echo -n\` in # assume $1 lower case + "") tr a-z A-Z;; # this is for V7, BSD + *) tr '[a-z]' '[A-Z]';; # and this is for SYSV + esac` +eval ${1}=\${${_PNAME_}=\${${1}}} + +eval test "X\${${1}}" != X || { + echo "${0}: ${HOME}/.${1} should set '${1}' or '${_PNAME_}'" 1>&2; exit 1 +} + +export ${1} MANPATH PATH ${_PNAME_} + +# become a new shell + +echo "Entering project '${1}' - leave with 'exit' or 'control-d'" 1>&2 + +exec ${SHELL} + +echo "project ${1} NOT entered" 1>&2; exit 1; + +#++ +# NAME +# enter 1 +# SUMMARY +# set up a project-specific environment +# PROJECT +# sdetools +# SYNOPSIS +# enter project +# exit +# DESCRIPTION +# The \fIenter\fR command sets up an environment that makes +# it easy to access \fIproject\fR-specific programs and files. +# +# \fIenter\fP consults a file with environment information +# ($HOME/.\fIproject\fR, Bourne-shell syntax) and invokes +# a new command shell of the same type as the login shell. +# Typically, project environment files are maintained and +# given out by the project administrator. +# +# In order to leave the project environment use the \fIexit\fP +# command or type a control-d; +# the details may depend on the type of login shell involved. +# +# As a minimum, the environment file should set an environment +# variable with the same name as the \fIproject\fP. The variable +# name can be either be identical to \fIproject\fP or in upper case. +# For consistency, \fIenter\fP will set both variables to the same value. +# EXAMPLE +# .fi +# .ad +# In this example, +# all files pertaining to a project \fIfoobar\fR are located under the +# directory \fI/usr/foo/bar/foobar\fR. For example, there +# are subdirectories +# \fI/usr/foo/bar/foobar/man\fR with manual pages, +# \fI/usr/foo/bar/foobar/bin\fR with executable +# programs, other directories for object libraries and include files, +# and so on. +# +# In order to enter a project \fIfoobar\fR, the command +# .PP +# .ti +5 +# .ft C +# enter foobar +# .ft +# .PP +# consults a file \fI.foobar\fR (in the user\'s home directory) +# with contents: +# .PP +# .ft C +# .nf +# .in +5 +# export FOOBAR; FOOBAR=/usr/foo/bar/foobar +# export PATH; PATH=$PATH:$FOOBAR/bin +# export MANPATH; MANPATH=$MANPATH:$FOOBAR/man +# .ft +# .fi +# .PP +# The second line automatically makes all project-specific +# executable programs accessible. The third line makes it possible +# to use the standard UNIX \fIman\fR command for retrieval of +# project-specific manual pages. The \fIenter\fR command +# makes sure that both the \fIfoobar\fR and \fIFOOBAR\fR +# environment variables are set to the same value. +# COMMANDS +# sh(1), echo(1), test(1), tr(1), login shell +# FILES +# $HOME/.\fIproject\fR +# ENVIRONMENT VARIABLES +# SHELL, login shell +# HOME, login directory +# PATH, search path for commands +# MANPATH, search path for the \fIman\fR command. +# BUGS +# Name clashes may occur if people have entered several projects +# at the same time. This can be avoided by using unique project names, +# which is a good idea anyway. +# AUTHOR(S) +# W.Z. Venema +# Eindhoven University of Technology +# Department of Mathematics and Computer Science +# Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands +# CREATION DATE +# Tue Apr 19 15:35:41 MET DST 1988 +# STATUS +# enter.sh 1.5 11/4/89 15:56:03 (draft) +#-- diff --git a/postfix/mantools/mansect b/postfix/mantools/mansect new file mode 100755 index 000000000..60262be59 --- /dev/null +++ b/postfix/mantools/mansect @@ -0,0 +1,125 @@ +#!/bin/sh + +# mansect - extract manual chapter number from source comment + +# @(#) mansect.sh 1.2 11/4/89 15:56:37 + +LANG= + +: process arguments + +while : +do + case $1 in + [0-9]) SECT=$1;; + -) LANG=$1; B='[#:]';; + -a) LANG=$1; B='#';; + -c) LANG=$1; B='\/\*';; + -f) LANG=$1; B='[Cc]';; + -m) LANG=$1; B='#';; + -n|-t) LANG=$1; B='\\"';; + -p) LANG=$1; B='{';; + -r) LANG=$1; B='#';; + -C) LANG=$1; B=$2; shift;; + -*) ERROR="unknown option: $1"; break;; + "") ERROR="missing file argument"; break;; + *) break;; + esac + shift +done + +# check error status + +case $ERROR in +"") ;; + *) echo "$0: $ERROR" 1>&2 + echo "usage: $0 [-|-a|-c|-f|-m|-n|-p|-t|-r|-C] file(s)" 1>&2; exit 1;; +esac + +# set up for file suffix processing + +case $LANG in +"") sh='[:#]'; r='#'; rh=$r; awk='#'; mk='#'; + c='\/\*'; d=$c; h=$c; y=$c; l=$c; + f='[Cc]'; fh=$f; p='{'; ph=$p; + ms='\\"'; nr=$ms; mn=$ms; man=$ms; +esac + +# extract chapter number from file + +for i +do + case $LANG in + "") eval B\="\$`expr $i : '.*\.\([^.]*\)$'`" + test "$B" || { echo "$0: unknown suffix: '$i'; assuming c" 1>&2; B=$c; } + esac + sed -n ' + /^'"$B"'++/,/^'"$B"'--/{ + s/[ ]*$// + /^'"$B"' NAME/{ + N + s/^.*\n'"$B"'.*[ ]\([0-9]\)[ ]*$/\1/p + q + } + } +' $i +done + +exit + +#++ +# NAME +# mansect 1 +# SUMMARY +# extract manual chapter number from comment +# PACKAGE +# sdetools +# SYNOPSIS +# mansect [-|-a|-c|-f|-m|-m|-n|-p|-t|-r|-C] file(s) +# DESCRIPTION +# \fImansect\fR extracts the manual chapter number from +# source file comments in the style of \fInewsrc(1)\fR. +# Typically, \fImansect\fR is integrated with \fImake(1)\fR scripts. +# +# Source files are processed in the indicated order; if no +# files are specified the command produces no output. +# +# The source file language can be specified through a command-line +# option, or can be implied by the filename suffix. +# The expected start-of-comment symbol is shown in the last column. +# +# .nf +# .ft C + option suffix language comment + + - .sh shell [:#] + -a .awk awk # + -c .c .h .l .y c lex yacc /* + -f .f .fh fortran [Cc] + -m .mk make # + -n .man .mn .ms .nr nroff troff \\" + -p .p .ph pascal { + -r .r .rh ratfor # + -C any language next argument +# .ft +# COMMANDS +# sh(1), sed(1) +# SEE ALSO +# newsrc(1), xman(1) +# The earlier commands new(1), mod(1), mkman(1) and dssman(1) +# by Ruud Zwart and Ben Noordzij (Erasmus University, Rotterdam) +# DIAGNOSTICS +# The program complaints if an unknown language is specified +# of if the language cannot be deduced from the file suffix. +# AUTHOR(S) +# W.Z. Venema +# Eindhoven University of Technology +# Department of Mathematics and Computer Science +# Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands +# CREATION DATE +# Sun Feb 15 21:40:28 GMT+1:00 1987 +# LAST MODIFICATION +# 11/4/89 15:56:37 +# VERSION/RELEASE +# 1.2 +#-- diff --git a/postfix/mantools/srctoman b/postfix/mantools/srctoman new file mode 100755 index 000000000..59809b8d7 --- /dev/null +++ b/postfix/mantools/srctoman @@ -0,0 +1,200 @@ +#!/bin/sh + +# srctoman - extract manual page from source file comment + +# @(#) srctoman.sh 1.2 11/4/89 15:56:22 + +LANG= + +# process arguments + +while : +do + case $1 in + [0-9]) SECT=$1;; + -) LANG=$1; B='[#:]';; + -awk) LANG=$1; B='#';; + -c) LANG=$1; B='\/\*';; + -f) LANG=$1; B='[Cc]';; + -mk) LANG=$1; B='#';; + -n|-t) LANG=$1; B='\\"';; + -p) LANG=$1; B='{';; + -r) LANG=$1; B='#';; + -C) LANG=$1; B=$2; shift;; + -*) ERROR="unknown option: $1"; break;; + "") ERROR="missing file argument"; break;; + *) break;; + esac + shift +done + +# check error status + +case $ERROR in +"") ;; + *) echo "$0: $ERROR" 1>&2 + echo "usage: $0 [-|-awk|-c|-f|-mk|-n|-p|-t|-r|-C] [section] file(s)" 1>&2; exit 1;; +esac + +# set up for file suffix processing + +case $LANG in +"") sh='[:#]'; r='#'; rh=$r; awk='#'; mk='#'; + c='\/\*'; h=$c; y=$c; l=$c; + f='[Cc]'; fh=$f; p='{'; ph=$p; + ms='\\"'; nr=$ms; mn=$ms; man=$ms; +esac + +# extract comments + +for i in $* +do + case $LANG in + "") eval B\="\$`expr $i : '.*\.\([^.]*\)$'`" + test "$B" || { echo "$0: unknown suffix: $i; assuming c" 1>&2; B=$c; } + esac + sed ' + /^'"$B"'++/,/^'"$B"'--/!d + /^'"$B"'++/d + /^'"$B"'--/d + s/[ ]*$// + /^'"$B"' \([A-Z]\)/{ + s//\1/ + /^NAME[ ]*$/{ + N + s/^.*\n'"$B"'[ ]*// + h + y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/ + s/^.*$/.TH & '"$SECT"'\ +.ad\ +.fi\ +.SH NAME/ + p + g + s/[ ][ ]*[0-9][ ]*$// + a\ +\\- + p + d + } + /^SUMMARY/d + /^DESCRIPTION/s//.SH &\ +.ad\ +.fi/ + /^BUGS/s//.SH &\ +.ad\ +.fi/ + /^DIAGNOSTICS/s//.SH &\ +.ad\ +.fi/ + /^[A-Z][A-Z][A-Z][^a-z]*$/s//.SH &\ +.na\ +.nf/ + p + d + } + s/^'"$B"'[ ]*// + s/^[ ]*$// +' $i +done | expand + +exit + +#++ +# NAME +# srctoman 1 +# SUMMARY +# extract manual page from source file comment +# PACKAGE +# sdetools +# SYNOPSIS +# srctoman [-|-awk|-c|-f|-mk|-m|-n|-p|-t|-r|-C] [section] file(s) +# DESCRIPTION +# \fIsrctoman\fR converts comments in various programming languages to +# UNIX-style manual pages. +# The command processes comments in the style of newsrc(1); +# its standard output is suitable for formatting with nroff(1) or +# troff(1) using the "-man" macro package. +# Typically, srctoman is invoked from make(1) scripts. +# +# Source files are processed in the indicated order; if no +# files are specified the command produces no output. +# +# The source file language can be specified through a command-line +# option, or can be implied by the filename suffix. +# The expected start-of-comment symbol is shown in the last column. +# +# .nf +# .ft C + option language comment + + - shell [:#] + -awk awk # + -c c /* + -f fortran [Cc] + -mk make # + -n nroff \\" + -p pascal { + -t troff \\" + -r ratfor # + -C any language next argument +# + suffix language comment + + .awk awk # + .c c /* + .f fortran [Cc] + .fh fortran [Cc] + .h c /* + .l lex /* + .man nroff,troff \\" + .mk make # + .me nroff,troff \\" + .ms nroff,troff \\" + .nr nroff,troff \\" + .p pascal { + .ph pascal { + .r ratfor # + .rh ratfor # + .sh shell [:#] + .y yacc /* +# .ft +# .PP +# .fi +# +# The required format of comments is discussed below, where SOC +# stands for the start-of-comment symbol of the language being used. +# .IP o +# Start of manual: SOC, followed by `++'. +# .IP o +# Section heading: SOC, blank, section name in upper case. +# .IP o +# All other text: SOC and subsequent blanks or tabs are removed. +# Lines that do not start with SOC are left unchanged (useful for +# inclusion of program text). +# .IP o +# End of manual: SOC, followed by `--'. +# An end-of-comment may follow if the source file language requires this. +# .PP +# The following manual sections receive a special treatment: +# NAME and SUMMARY should appear at the beginning and in +# this order; DESCRIPTION, DIAGNOSTICS and BUGS will be +# right-margin adjusted. +# Other sections may be added freely without confusing srctoman. +# COMMANDS +# sh(1), sed(1), expand(1) +# SEE ALSO +# newsrc(1) +# DIAGNOSTICS +# The program complains if an unknown language is specified +# of if the language cannot be deduced from the file suffix. +# AUTHOR(S) +# W.Z. Venema +# Eindhoven University of Technology +# Department of Mathematics and Computer Science +# Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands +# CREATION DATE +# Fri Jan 17 22:59:27 MET 1986 +# STATUS +# srctoman.sh 1.2 11/4/89 15:56:22 (draft) +#-- diff --git a/postfix/master/Makefile.in b/postfix/master/Makefile.in index d2dcf052c..c0840d633 100644 --- a/postfix/master/Makefile.in +++ b/postfix/master/Makefile.in @@ -89,10 +89,11 @@ master.o: ../include/mymalloc.h master.o: ../include/iostuff.h master.o: ../include/vstream.h master.o: ../include/stringops.h +master.o: ../include/myflock.h master.o: ../include/mail_params.h master.o: ../include/debug_process.h master.o: ../include/mail_task.h -master.o: ../include/config.h +master.o: ../include/mail_conf.h master.o: ../include/open_lock.h master.o: master.h master_avail.o: master_avail.c @@ -170,7 +171,7 @@ master_vars.o: ../include/sys_defs.h master_vars.o: ../include/msg.h master_vars.o: ../include/stringops.h master_vars.o: ../include/mymalloc.h -master_vars.o: ../include/config.h +master_vars.o: ../include/mail_conf.h master_vars.o: ../include/mail_params.h master_vars.o: master.h master_wakeup.o: master_wakeup.c @@ -204,7 +205,7 @@ multi_server.o: ../include/safe_open.h multi_server.o: ../include/mail_task.h multi_server.o: ../include/debug_process.h multi_server.o: ../include/mail_params.h -multi_server.o: ../include/config.h +multi_server.o: ../include/mail_conf.h multi_server.o: ../include/timed_ipc.h multi_server.o: ../include/resolve_local.h multi_server.o: master_proto.h @@ -229,7 +230,7 @@ single_server.o: ../include/listen.h single_server.o: ../include/mail_params.h single_server.o: ../include/mail_task.h single_server.o: ../include/debug_process.h -single_server.o: ../include/config.h +single_server.o: ../include/mail_conf.h single_server.o: ../include/timed_ipc.h single_server.o: ../include/resolve_local.h single_server.o: master_proto.h @@ -254,7 +255,7 @@ trigger_server.o: ../include/listen.h trigger_server.o: ../include/mail_params.h trigger_server.o: ../include/mail_task.h trigger_server.o: ../include/debug_process.h -trigger_server.o: ../include/config.h +trigger_server.o: ../include/mail_conf.h trigger_server.o: ../include/resolve_local.h trigger_server.o: master_proto.h trigger_server.o: mail_server.h diff --git a/postfix/master/mail_server.h b/postfix/master/mail_server.h index 9bf37117c..303f9ca7f 100644 --- a/postfix/master/mail_server.h +++ b/postfix/master/mail_server.h @@ -14,7 +14,7 @@ #include /* - * External interface. Tables are defined in config.h. + * External interface. Tables are defined in mail_conf.h. */ #define MAIL_SERVER_INT_TABLE 1 #define MAIL_SERVER_STR_TABLE 2 diff --git a/postfix/master/master.c b/postfix/master/master.c index 023f2c8c7..463d324ae 100644 --- a/postfix/master/master.c +++ b/postfix/master/master.c @@ -146,7 +146,7 @@ #include #include #include -#include +#include #include /* Application-specific. */ @@ -201,7 +201,7 @@ int main(int argc, char **argv) * Strip and save the process name for diagnostics etc. */ var_procname = mystrdup(basename(argv[0])); - set_config_str(VAR_PROCNAME, var_procname); + set_mail_conf_str(VAR_PROCNAME, var_procname); /* * When running a child process, don't leak any open files that were diff --git a/postfix/master/master_vars.c b/postfix/master/master_vars.c index 669147a95..3332e8c58 100644 --- a/postfix/master/master_vars.c +++ b/postfix/master/master_vars.c @@ -35,7 +35,7 @@ /* Global library. */ -#include +#include #include /* Application-specific. */ @@ -59,8 +59,8 @@ void master_vars_init(void) 0, }; - read_config(); - get_config_int_table(int_table); + mail_conf_read(); + get_mail_conf_int_table(int_table); path = concatenate(var_config_dir, "/master.cf", (char *) 0); fset_master_ent(path); myfree(path); diff --git a/postfix/master/multi_server.c b/postfix/master/multi_server.c index 01d981129..1163f89c2 100644 --- a/postfix/master/multi_server.c +++ b/postfix/master/multi_server.c @@ -150,7 +150,7 @@ #include #include #include -#include +#include #include #include @@ -387,7 +387,7 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...) * May need this every now and then. */ var_procname = mystrdup(basename(argv[0])); - set_config_str(VAR_PROCNAME, var_procname); + set_mail_conf_str(VAR_PROCNAME, var_procname); /* * Initialize logging and exit handler. Do the syslog first, so that its @@ -401,21 +401,21 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...) * Initialize from the configuration file. Allow command-line options to * override compiled-in defaults or configured parameter values. */ - read_config(); + mail_conf_read(); va_start(ap, service); while ((key = va_arg(ap, int)) != 0) { switch (key) { case MAIL_SERVER_INT_TABLE: - get_config_int_table(va_arg(ap, CONFIG_INT_TABLE *)); + get_mail_conf_int_table(va_arg(ap, CONFIG_INT_TABLE *)); break; case MAIL_SERVER_STR_TABLE: - get_config_str_table(va_arg(ap, CONFIG_STR_TABLE *)); + get_mail_conf_str_table(va_arg(ap, CONFIG_STR_TABLE *)); break; case MAIL_SERVER_BOOL_TABLE: - get_config_bool_table(va_arg(ap, CONFIG_BOOL_TABLE *)); + get_mail_conf_bool_table(va_arg(ap, CONFIG_BOOL_TABLE *)); break; case MAIL_SERVER_RAW_TABLE: - get_config_raw_table(va_arg(ap, CONFIG_STR_TABLE *)); + get_mail_conf_raw_table(va_arg(ap, CONFIG_STR_TABLE *)); break; case MAIL_SERVER_PRE_INIT: pre_init = va_arg(ap, MAIL_SERVER_INIT_FN); diff --git a/postfix/master/single_server.c b/postfix/master/single_server.c index 0922ce8c6..708b04142 100644 --- a/postfix/master/single_server.c +++ b/postfix/master/single_server.c @@ -141,7 +141,7 @@ #include #include #include -#include +#include #include #include @@ -356,7 +356,7 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...) * May need this every now and then. */ var_procname = mystrdup(basename(argv[0])); - set_config_str(VAR_PROCNAME, var_procname); + set_mail_conf_str(VAR_PROCNAME, var_procname); /* * Initialize logging and exit handler. Do the syslog first, so that its @@ -370,21 +370,21 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...) * Initialize from the configuration file. Allow command-line options to * override compiled-in defaults or configured parameter values. */ - read_config(); + mail_conf_read(); va_start(ap, service); while ((key = va_arg(ap, int)) != 0) { switch (key) { case MAIL_SERVER_INT_TABLE: - get_config_int_table(va_arg(ap, CONFIG_INT_TABLE *)); + get_mail_conf_int_table(va_arg(ap, CONFIG_INT_TABLE *)); break; case MAIL_SERVER_STR_TABLE: - get_config_str_table(va_arg(ap, CONFIG_STR_TABLE *)); + get_mail_conf_str_table(va_arg(ap, CONFIG_STR_TABLE *)); break; case MAIL_SERVER_BOOL_TABLE: - get_config_bool_table(va_arg(ap, CONFIG_BOOL_TABLE *)); + get_mail_conf_bool_table(va_arg(ap, CONFIG_BOOL_TABLE *)); break; case MAIL_SERVER_RAW_TABLE: - get_config_raw_table(va_arg(ap, CONFIG_STR_TABLE *)); + get_mail_conf_raw_table(va_arg(ap, CONFIG_STR_TABLE *)); break; case MAIL_SERVER_PRE_INIT: pre_init = va_arg(ap, MAIL_SERVER_INIT_FN); diff --git a/postfix/master/trigger_server.c b/postfix/master/trigger_server.c index 1434617e7..d145682a3 100644 --- a/postfix/master/trigger_server.c +++ b/postfix/master/trigger_server.c @@ -149,7 +149,7 @@ #include #include #include -#include +#include #include /* Process manager. */ @@ -357,7 +357,7 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,.. * May need this every now and then. */ var_procname = mystrdup(basename(argv[0])); - set_config_str(VAR_PROCNAME, var_procname); + set_mail_conf_str(VAR_PROCNAME, var_procname); /* * Initialize logging and exit handler. Do the syslog first, so that its @@ -371,21 +371,21 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,.. * Initialize from the configuration file. Allow command-line options to * override compiled-in defaults or configured parameter values. */ - read_config(); + mail_conf_read(); va_start(ap, service); while ((key = va_arg(ap, int)) != 0) { switch (key) { case MAIL_SERVER_INT_TABLE: - get_config_int_table(va_arg(ap, CONFIG_INT_TABLE *)); + get_mail_conf_int_table(va_arg(ap, CONFIG_INT_TABLE *)); break; case MAIL_SERVER_STR_TABLE: - get_config_str_table(va_arg(ap, CONFIG_STR_TABLE *)); + get_mail_conf_str_table(va_arg(ap, CONFIG_STR_TABLE *)); break; case MAIL_SERVER_BOOL_TABLE: - get_config_bool_table(va_arg(ap, CONFIG_BOOL_TABLE *)); + get_mail_conf_bool_table(va_arg(ap, CONFIG_BOOL_TABLE *)); break; case MAIL_SERVER_RAW_TABLE: - get_config_raw_table(va_arg(ap, CONFIG_STR_TABLE *)); + get_mail_conf_raw_table(va_arg(ap, CONFIG_STR_TABLE *)); break; case MAIL_SERVER_PRE_INIT: pre_init = va_arg(ap, MAIL_SERVER_INIT_FN); diff --git a/postfix/pickup/Makefile.in b/postfix/pickup/Makefile.in index 1edbf8c3b..119491852 100644 --- a/postfix/pickup/Makefile.in +++ b/postfix/pickup/Makefile.in @@ -70,7 +70,7 @@ pickup.o: ../include/iostuff.h pickup.o: ../include/cleanup_user.h pickup.o: ../include/mail_date.h pickup.o: ../include/mail_params.h -pickup.o: ../include/config.h +pickup.o: ../include/mail_conf.h pickup.o: ../include/record.h pickup.o: ../include/rec_type.h pickup.o: ../include/mail_server.h diff --git a/postfix/pickup/pickup.c b/postfix/pickup/pickup.c index 7ef02cb0b..5eeb9a10b 100644 --- a/postfix/pickup/pickup.c +++ b/postfix/pickup/pickup.c @@ -95,7 +95,7 @@ #include #include #include -#include +#include #include #include diff --git a/postfix/pipe/Makefile.in b/postfix/pipe/Makefile.in index 59eb45dfb..7693befbf 100644 --- a/postfix/pipe/Makefile.in +++ b/postfix/pipe/Makefile.in @@ -72,7 +72,7 @@ pipe.o: ../include/recipient_list.h pipe.o: ../include/deliver_request.h pipe.o: ../include/mail_queue.h pipe.o: ../include/mail_params.h -pipe.o: ../include/config.h +pipe.o: ../include/mail_conf.h pipe.o: ../include/bounce.h pipe.o: ../include/defer.h pipe.o: ../include/deliver_completed.h diff --git a/postfix/pipe/pipe.c b/postfix/pipe/pipe.c index cc2750112..35b765c0e 100644 --- a/postfix/pipe/pipe.c +++ b/postfix/pipe/pipe.c @@ -183,7 +183,7 @@ #include #include #include -#include +#include #include #include #include @@ -388,7 +388,7 @@ static void get_service_params(PIPE_PARAMS *config, char *service) * Figure out the command time limit for this transport. */ config->time_limit = - get_config_int2(service, "_time_limit", var_command_maxtime, 1, 0); + get_mail_conf_int2(service, "_time_limit", var_command_maxtime, 1, 0); /* * Give the poor tester a clue of what is going on. diff --git a/postfix/postalias/Makefile.in b/postfix/postalias/Makefile.in index 795db706f..3869efbb2 100644 --- a/postfix/postalias/Makefile.in +++ b/postfix/postalias/Makefile.in @@ -67,7 +67,7 @@ postalias.o: ../include/split_at.h postalias.o: ../include/get_hostname.h postalias.o: ../include/tok822.h postalias.o: ../include/resolve_clnt.h -postalias.o: ../include/config.h +postalias.o: ../include/mail_conf.h postalias.o: ../include/mail_params.h postalias.o: ../include/mkmap.h postalias.o: ../include/dict.h diff --git a/postfix/postalias/postalias.c b/postfix/postalias/postalias.c index a3d7ffe89..9e6408165 100644 --- a/postfix/postalias/postalias.c +++ b/postfix/postalias/postalias.c @@ -113,7 +113,7 @@ /* Global library. */ #include -#include +#include #include #include @@ -344,7 +344,7 @@ int main(int argc, char **argv) break; } } - read_config(); + mail_conf_read(); /* * Use the map type specified by the user, or fall back to a default diff --git a/postfix/postconf/Makefile.in b/postfix/postconf/Makefile.in index 4d18315f6..b608720a2 100644 --- a/postfix/postconf/Makefile.in +++ b/postfix/postconf/Makefile.in @@ -77,7 +77,7 @@ postconf.o: ../include/safe.h postconf.o: ../include/mymalloc.h postconf.o: ../include/line_wrap.h postconf.o: ../include/mynetworks.h -postconf.o: ../include/config.h +postconf.o: ../include/mail_conf.h postconf.o: ../include/mail_proto.h postconf.o: ../include/iostuff.h postconf.o: ../include/mail_version.h diff --git a/postfix/postconf/postconf.c b/postfix/postconf/postconf.c index 70df435fb..e681dcea3 100644 --- a/postfix/postconf/postconf.c +++ b/postfix/postconf/postconf.c @@ -69,7 +69,7 @@ /* Global library. */ #include -#include +#include #include #include #include @@ -167,7 +167,7 @@ static const char *check_myhostname(void) */ name = get_hostname(); if ((mode & SHOW_DEFS) == 0 && (dot = strchr(name, '.')) == 0) { - if ((domain = config_lookup_eval(VAR_MYDOMAIN)) == 0) + if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0) msg_fatal("My hostname %s is not a fully qualified name - set %s or %s in %s/main.cf", name, VAR_MYHOSTNAME, VAR_MYDOMAIN, var_config_dir); name = concatenate(name, ".", domain, (char *) 0); @@ -220,7 +220,7 @@ static void read_parameters(void) char *path; /* - * A direct rip-off of read_config(). XXX Avoid code duplication by + * A direct rip-off of mail_conf_read(). XXX Avoid code duplication by * better code decomposition. */ dict_unknown_allowed = 1; @@ -228,7 +228,7 @@ static void read_parameters(void) myfree(var_config_dir); var_config_dir = mystrdup((config_dir = safe_getenv(CONF_ENV_PATH)) != 0 ? config_dir : DEF_CONFIG_DIR); /* XXX */ - set_config_str(VAR_CONFIG_DIR, var_config_dir); + set_mail_conf_str(VAR_CONFIG_DIR, var_config_dir); path = concatenate(var_config_dir, "/", "main.cf", (char *) 0); dict_load_file(CONFIG_DICT, path); myfree(path); diff --git a/postfix/postdrop/Makefile.in b/postfix/postdrop/Makefile.in index de5ada7b5..0ebc839e8 100644 --- a/postfix/postdrop/Makefile.in +++ b/postfix/postdrop/Makefile.in @@ -66,7 +66,7 @@ postdrop.o: ../include/mail_proto.h postdrop.o: ../include/iostuff.h postdrop.o: ../include/mail_queue.h postdrop.o: ../include/mail_params.h -postdrop.o: ../include/config.h +postdrop.o: ../include/mail_conf.h postdrop.o: ../include/mail_task.h postdrop.o: ../include/clean_env.h postdrop.o: ../include/mail_stream.h diff --git a/postfix/postdrop/postdrop.c b/postfix/postdrop/postdrop.c index 3dffaf04d..297f4f040 100644 --- a/postfix/postdrop/postdrop.c +++ b/postfix/postdrop/postdrop.c @@ -87,7 +87,7 @@ #include #include #include -#include +#include #include #include #include @@ -180,7 +180,7 @@ int main(int argc, char **argv) argv[0] = "postdrop"; msg_vstream_init(argv[0], VSTREAM_ERR); msg_syslog_init(mail_task(argv[0]), LOG_PID, LOG_FACILITY); - set_config_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); + set_mail_conf_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); /* * Read the global configuration file and extract configuration @@ -191,7 +191,7 @@ int main(int argc, char **argv) * record-level I/O. With that, we should also take the opportunity to * perform some sanity checks on the input. */ - read_config(); + mail_conf_read(); if (chdir(var_queue_dir)) msg_fatal("chdir %s: %m", var_queue_dir); if (msg_verbose) diff --git a/postfix/postfix/Makefile.in b/postfix/postfix/Makefile.in index c195be500..76135b5ea 100644 --- a/postfix/postfix/Makefile.in +++ b/postfix/postfix/Makefile.in @@ -65,5 +65,5 @@ postfix.o: ../include/msg.h postfix.o: ../include/msg_vstream.h postfix.o: ../include/msg_syslog.h postfix.o: ../include/stringops.h -postfix.o: ../include/config.h +postfix.o: ../include/mail_conf.h postfix.o: ../include/mail_params.h diff --git a/postfix/postfix/postfix.c b/postfix/postfix/postfix.c index d88f6e4d8..d9850c2e3 100644 --- a/postfix/postfix/postfix.c +++ b/postfix/postfix/postfix.c @@ -117,7 +117,7 @@ /* Global library. */ -#include +#include #include /* check_setenv - setenv() with extreme prejudice */ @@ -202,10 +202,10 @@ int main(int argc, char **argv) * utility that makes config parameters easily accessible for shell * scripts. */ - read_config(); + mail_conf_read(); check_setenv("PATH", ROOT_PATH); /* sys_defs.h */ - check_setenv(CONF_ENV_PATH, var_config_dir);/* config.h */ + check_setenv(CONF_ENV_PATH, var_config_dir);/* mail_conf.h */ check_setenv(VAR_COMMAND_DIR, var_command_dir); /* main.cf */ check_setenv(VAR_DAEMON_DIR, var_daemon_dir); /* main.cf */ diff --git a/postfix/postkick/Makefile.in b/postfix/postkick/Makefile.in index 5066343e7..97bfe052d 100644 --- a/postfix/postkick/Makefile.in +++ b/postfix/postkick/Makefile.in @@ -64,4 +64,4 @@ postkick.o: ../include/safe.h postkick.o: ../include/mail_proto.h postkick.o: ../include/iostuff.h postkick.o: ../include/mail_params.h -postkick.o: ../include/config.h +postkick.o: ../include/mail_conf.h diff --git a/postfix/postkick/postkick.c b/postfix/postkick/postkick.c index 044a08390..ee67a4cf3 100644 --- a/postfix/postkick/postkick.c +++ b/postfix/postkick/postkick.c @@ -85,7 +85,7 @@ #include #include -#include +#include static NORETURN usage(char *myname) { @@ -125,7 +125,7 @@ int main(int argc, char **argv) if ((slash = strrchr(argv[0], '/')) != 0) argv[0] = slash + 1; msg_vstream_init(argv[0], VSTREAM_ERR); - set_config_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); + set_mail_conf_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); /* * Parse JCL. @@ -152,7 +152,7 @@ int main(int argc, char **argv) /* * Finish initializations. */ - read_config(); + mail_conf_read(); if (chdir(var_queue_dir)) msg_fatal("chdir %s: %m", var_queue_dir); diff --git a/postfix/postlock/Makefile.in b/postfix/postlock/Makefile.in index 6003b44e8..dca43797f 100644 --- a/postfix/postlock/Makefile.in +++ b/postfix/postlock/Makefile.in @@ -64,4 +64,4 @@ postlock.o: ../include/iostuff.h postlock.o: ../include/mail_params.h postlock.o: ../include/dot_lockfile.h postlock.o: ../include/deliver_flock.h -postlock.o: ../include/config.h +postlock.o: ../include/mail_conf.h diff --git a/postfix/postlock/postlock.c b/postfix/postlock/postlock.c index 558f8f780..9d728d4d4 100644 --- a/postfix/postlock/postlock.c +++ b/postfix/postlock/postlock.c @@ -98,7 +98,7 @@ #include #include #include -#include +#include /* Application-specific. */ @@ -184,7 +184,7 @@ int main(int argc, char **argv) /* * Read the config file. */ - read_config(); + mail_conf_read(); /* * Lock the folder for exclusive access. Lose the lock upon exit. The diff --git a/postfix/postmap/Makefile.in b/postfix/postmap/Makefile.in index 89f364f2e..d09444900 100644 --- a/postfix/postmap/Makefile.in +++ b/postfix/postmap/Makefile.in @@ -64,7 +64,7 @@ postmap.o: ../include/msg_vstream.h postmap.o: ../include/readlline.h postmap.o: ../include/stringops.h postmap.o: ../include/split_at.h -postmap.o: ../include/config.h +postmap.o: ../include/mail_conf.h postmap.o: ../include/mail_params.h postmap.o: ../include/mkmap.h postmap.o: ../include/dict.h diff --git a/postfix/postmap/postmap.c b/postfix/postmap/postmap.c index 2aadc4d82..b50bd6c84 100644 --- a/postfix/postmap/postmap.c +++ b/postfix/postmap/postmap.c @@ -122,7 +122,7 @@ /* Global library. */ -#include +#include #include #include @@ -298,7 +298,7 @@ int main(int argc, char **argv) break; } } - read_config(); + mail_conf_read(); /* * Use the map type specified by the user, or fall back to a default diff --git a/postfix/postsuper/Makefile.in b/postfix/postsuper/Makefile.in index c91df1d93..fa73f4a05 100644 --- a/postfix/postsuper/Makefile.in +++ b/postfix/postsuper/Makefile.in @@ -67,6 +67,6 @@ postsuper.o: ../include/safe.h postsuper.o: ../include/set_ugid.h postsuper.o: ../include/argv.h postsuper.o: ../include/mail_task.h -postsuper.o: ../include/config.h +postsuper.o: ../include/mail_conf.h postsuper.o: ../include/mail_params.h postsuper.o: ../include/mail_queue.h diff --git a/postfix/postsuper/postsuper.c b/postfix/postsuper/postsuper.c index b225f84f2..6453b3023 100644 --- a/postfix/postsuper/postsuper.c +++ b/postfix/postsuper/postsuper.c @@ -80,7 +80,7 @@ /* Global library. */ #include -#include +#include #include #include @@ -329,9 +329,9 @@ main(int argc, char **argv) argv[0] = slash + 1; msg_vstream_init(argv[0], VSTREAM_ERR); msg_syslog_init(mail_task(argv[0]), LOG_PID, LOG_FACILITY); - set_config_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); + set_mail_conf_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); - read_config(); + mail_conf_read(); if (chdir(var_queue_dir)) msg_fatal("chdir %s: %m", var_queue_dir); diff --git a/postfix/qmgr/Makefile.in b/postfix/qmgr/Makefile.in index fe9350700..e6e138c52 100644 --- a/postfix/qmgr/Makefile.in +++ b/postfix/qmgr/Makefile.in @@ -64,10 +64,11 @@ qmgr.o: ../include/msg.h qmgr.o: ../include/events.h qmgr.o: ../include/vstream.h qmgr.o: ../include/vbuf.h +qmgr.o: ../include/dict.h qmgr.o: ../include/mail_queue.h qmgr.o: ../include/vstring.h qmgr.o: ../include/recipient_list.h -qmgr.o: ../include/config.h +qmgr.o: ../include/mail_conf.h qmgr.o: ../include/mail_params.h qmgr.o: ../include/mail_proto.h qmgr.o: ../include/iostuff.h @@ -76,7 +77,6 @@ qmgr.o: ../include/mail_server.h qmgr.o: qmgr.h qmgr.o: ../include/scan_dir.h qmgr.o: ../include/maps.h -qmgr.o: ../include/dict.h qmgr_active.o: qmgr_active.c qmgr_active.o: ../include/sys_defs.h qmgr_active.o: ../include/msg.h @@ -238,7 +238,7 @@ qmgr_transport.o: ../include/vbuf.h qmgr_transport.o: ../include/iostuff.h qmgr_transport.o: ../include/mail_proto.h qmgr_transport.o: ../include/recipient_list.h -qmgr_transport.o: ../include/config.h +qmgr_transport.o: ../include/mail_conf.h qmgr_transport.o: ../include/mail_params.h qmgr_transport.o: qmgr.h qmgr_transport.o: ../include/scan_dir.h diff --git a/postfix/qmgr/qmgr.c b/postfix/qmgr/qmgr.c index 22a690f96..7ed726e43 100644 --- a/postfix/qmgr/qmgr.c +++ b/postfix/qmgr/qmgr.c @@ -237,7 +237,7 @@ #include #include -#include +#include #include #include /* QMGR_SCAN constants */ diff --git a/postfix/qmgr/qmgr_transport.c b/postfix/qmgr/qmgr_transport.c index fcaa95c39..b58fcd5eb 100644 --- a/postfix/qmgr/qmgr_transport.c +++ b/postfix/qmgr/qmgr_transport.c @@ -84,7 +84,7 @@ #include #include -#include +#include #include /* Application-specific. */ @@ -319,10 +319,10 @@ QMGR_TRANSPORT *qmgr_transport_create(const char *name) * Use global configuration settings or transport-specific settings. */ transport->dest_concurrency_limit = - get_config_int2(name, "_destination_concurrency_limit", + get_mail_conf_int2(name, "_destination_concurrency_limit", var_dest_con_limit, 0, 0); transport->recipient_limit = - get_config_int2(name, "_destination_recipient_limit", + get_mail_conf_int2(name, "_destination_recipient_limit", var_dest_rcpt_limit, 0, 0); if (transport->dest_concurrency_limit == 0 diff --git a/postfix/sendmail/Makefile.in b/postfix/sendmail/Makefile.in index 9f401a365..b50388300 100644 --- a/postfix/sendmail/Makefile.in +++ b/postfix/sendmail/Makefile.in @@ -75,7 +75,7 @@ sendmail.o: ../include/mail_params.h sendmail.o: ../include/record.h sendmail.o: ../include/rec_type.h sendmail.o: ../include/rec_streamlf.h -sendmail.o: ../include/config.h +sendmail.o: ../include/mail_conf.h sendmail.o: ../include/cleanup_user.h sendmail.o: ../include/mail_task.h sendmail.o: ../include/mail_run.h diff --git a/postfix/sendmail/sendmail.c b/postfix/sendmail/sendmail.c index d15701c76..a6b41020e 100644 --- a/postfix/sendmail/sendmail.c +++ b/postfix/sendmail/sendmail.c @@ -254,7 +254,7 @@ #include #include #include -#include +#include #include #include #include @@ -593,9 +593,9 @@ int main(int argc, char **argv) argv[0] = slash + 1; msg_vstream_init(argv[0], VSTREAM_ERR); msg_syslog_init(mail_task("sendmail"), LOG_PID, LOG_FACILITY); - set_config_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); + set_mail_conf_str(VAR_PROCNAME, var_procname = mystrdup(argv[0])); - read_config(); + mail_conf_read(); if (chdir(var_queue_dir)) msg_fatal("chdir %s: %m", var_queue_dir); @@ -704,7 +704,7 @@ int main(int argc, char **argv) msg_fatal("-oA requires pathname"); myfree(var_alias_db_map); var_alias_db_map = mystrdup(optarg + 1); - set_config_str(VAR_ALIAS_DB_MAP, var_alias_db_map); + set_mail_conf_str(VAR_ALIAS_DB_MAP, var_alias_db_map); break; case '7': case '8': diff --git a/postfix/showq/Makefile.in b/postfix/showq/Makefile.in index c020235ba..1d5bf10c3 100644 --- a/postfix/showq/Makefile.in +++ b/postfix/showq/Makefile.in @@ -70,7 +70,7 @@ showq.o: ../include/iostuff.h showq.o: ../include/mail_date.h showq.o: ../include/mail_params.h showq.o: ../include/mail_scan_dir.h -showq.o: ../include/config.h +showq.o: ../include/mail_conf.h showq.o: ../include/record.h showq.o: ../include/rec_type.h showq.o: ../include/htable.h diff --git a/postfix/showq/showq.c b/postfix/showq/showq.c index 8b23e77f2..1e6d1e93a 100644 --- a/postfix/showq/showq.c +++ b/postfix/showq/showq.c @@ -76,7 +76,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/postfix/smtp/Makefile.in b/postfix/smtp/Makefile.in index 6d528e880..ae9e7f14e 100644 --- a/postfix/smtp/Makefile.in +++ b/postfix/smtp/Makefile.in @@ -69,19 +69,21 @@ quote_821_local.o: ../include/vbuf.h quote_821_local.o: quote_821_local.h smtp.o: smtp.c smtp.o: ../include/sys_defs.h +smtp.o: ../include/dict.h +smtp.o: ../include/vstream.h +smtp.o: ../include/vbuf.h smtp.o: ../include/msg.h smtp.o: ../include/mymalloc.h smtp.o: ../include/name_mask.h smtp.o: ../include/deliver_request.h smtp.o: ../include/vstring.h -smtp.o: ../include/vbuf.h -smtp.o: ../include/vstream.h smtp.o: ../include/recipient_list.h smtp.o: ../include/mail_queue.h smtp.o: ../include/mail_params.h -smtp.o: ../include/config.h +smtp.o: ../include/mail_conf.h smtp.o: ../include/debug_peer.h smtp.o: ../include/mail_error.h +smtp.o: ../include/deliver_pass.h smtp.o: ../include/mail_proto.h smtp.o: ../include/iostuff.h smtp.o: ../include/mail_server.h @@ -182,7 +184,7 @@ smtp_state.o: ../include/mymalloc.h smtp_state.o: ../include/vstring.h smtp_state.o: ../include/vbuf.h smtp_state.o: ../include/vstream.h -smtp_state.o: ../include/config.h +smtp_state.o: ../include/mail_conf.h smtp_state.o: smtp.h smtp_state.o: ../include/argv.h smtp_state.o: ../include/deliver_request.h diff --git a/postfix/smtp/smtp.c b/postfix/smtp/smtp.c index 8287e6731..10a6aa988 100644 --- a/postfix/smtp/smtp.c +++ b/postfix/smtp/smtp.c @@ -167,7 +167,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/postfix/smtp/smtp_state.c b/postfix/smtp/smtp_state.c index 97c395a84..1ab6a6f1d 100644 --- a/postfix/smtp/smtp_state.c +++ b/postfix/smtp/smtp_state.c @@ -42,7 +42,7 @@ /* Global library. */ -#include +#include /* Application-specific. */ diff --git a/postfix/smtpd/Makefile.in b/postfix/smtpd/Makefile.in index 436dbd059..b9cca844d 100644 --- a/postfix/smtpd/Makefile.in +++ b/postfix/smtpd/Makefile.in @@ -94,6 +94,7 @@ smtpd.o: ../include/stringops.h smtpd.o: ../include/events.h smtpd.o: ../include/smtp_stream.h smtpd.o: ../include/valid_hostname.h +smtpd.o: ../include/dict.h smtpd.o: ../include/peer_name.h smtpd.o: ../include/mail_params.h smtpd.o: ../include/record.h @@ -102,7 +103,7 @@ smtpd.o: ../include/mail_proto.h smtpd.o: ../include/iostuff.h smtpd.o: ../include/cleanup_user.h smtpd.o: ../include/mail_date.h -smtpd.o: ../include/config.h +smtpd.o: ../include/mail_conf.h smtpd.o: ../include/off_cvt.h smtpd.o: ../include/debug_peer.h smtpd.o: ../include/mail_error.h diff --git a/postfix/smtpd/smtpd.c b/postfix/smtpd/smtpd.c index 6b88e9e85..b7328969d 100644 --- a/postfix/smtpd/smtpd.c +++ b/postfix/smtpd/smtpd.c @@ -221,7 +221,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/postfix/smtpd/smtpd_check.c b/postfix/smtpd/smtpd_check.c index 976a8dfcd..11cbf7b8f 100644 --- a/postfix/smtpd/smtpd_check.c +++ b/postfix/smtpd/smtpd_check.c @@ -1465,7 +1465,7 @@ char *smtpd_check_size(SMTPD_STATE *state, off_t size) #include #include -#include +#include #include diff --git a/postfix/trivial-rewrite/Makefile.in b/postfix/trivial-rewrite/Makefile.in index fa09c38bb..e4036be06 100644 --- a/postfix/trivial-rewrite/Makefile.in +++ b/postfix/trivial-rewrite/Makefile.in @@ -73,7 +73,7 @@ resolve.o: ../include/iostuff.h resolve.o: ../include/mail_addr.h resolve.o: ../include/rewrite_clnt.h resolve.o: ../include/resolve_local.h -resolve.o: ../include/config.h +resolve.o: ../include/mail_conf.h resolve.o: ../include/quote_822_local.h resolve.o: ../include/tok822.h resolve.o: ../include/resolve_clnt.h @@ -93,7 +93,7 @@ rewrite.o: ../include/iostuff.h rewrite.o: ../include/resolve_local.h rewrite.o: ../include/tok822.h rewrite.o: ../include/resolve_clnt.h -rewrite.o: ../include/config.h +rewrite.o: ../include/mail_conf.h rewrite.o: trivial-rewrite.h transport.o: transport.c transport.o: ../include/sys_defs.h @@ -117,11 +117,12 @@ trivial-rewrite.o: ../include/vstream.h trivial-rewrite.o: ../include/vstring_vstream.h trivial-rewrite.o: ../include/split_at.h trivial-rewrite.o: ../include/stringops.h +trivial-rewrite.o: ../include/dict.h trivial-rewrite.o: ../include/mail_params.h trivial-rewrite.o: ../include/mail_proto.h trivial-rewrite.o: ../include/iostuff.h trivial-rewrite.o: ../include/resolve_local.h -trivial-rewrite.o: ../include/config.h +trivial-rewrite.o: ../include/mail_conf.h trivial-rewrite.o: ../include/resolve_clnt.h trivial-rewrite.o: ../include/rewrite_clnt.h trivial-rewrite.o: ../include/tok822.h diff --git a/postfix/trivial-rewrite/resolve.c b/postfix/trivial-rewrite/resolve.c index 160c4dd24..5f185882c 100644 --- a/postfix/trivial-rewrite/resolve.c +++ b/postfix/trivial-rewrite/resolve.c @@ -69,7 +69,7 @@ #include #include #include -#include +#include #include #include diff --git a/postfix/trivial-rewrite/rewrite.c b/postfix/trivial-rewrite/rewrite.c index 93ec33f3e..b798a5c3c 100644 --- a/postfix/trivial-rewrite/rewrite.c +++ b/postfix/trivial-rewrite/rewrite.c @@ -71,7 +71,7 @@ #include #include #include -#include +#include /* Application-specific. */ diff --git a/postfix/trivial-rewrite/trivial-rewrite.c b/postfix/trivial-rewrite/trivial-rewrite.c index 161231733..991cde5f4 100644 --- a/postfix/trivial-rewrite/trivial-rewrite.c +++ b/postfix/trivial-rewrite/trivial-rewrite.c @@ -127,7 +127,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/postfix/util/dict_ldap.c b/postfix/util/dict_ldap.c index 32f1fa997..d241a4992 100644 --- a/postfix/util/dict_ldap.c +++ b/postfix/util/dict_ldap.c @@ -328,7 +328,7 @@ DICT *dict_ldap_open(const char *ldapsource, int dummy, int dict_flags) vstring_sprintf(config_param, "%s_server_host", ldapsource); dict_ldap->server_host = - mystrdup((char *) get_config_str(vstring_str(config_param), + mystrdup((char *) get_mail_conf_str(vstring_str(config_param), "localhost", 0, 0)); if (msg_verbose) msg_info("%s: %s is %s", myname, vstring_str(config_param), @@ -340,28 +340,28 @@ DICT *dict_ldap_open(const char *ldapsource, int dummy, int dict_flags) */ vstring_sprintf(config_param, "%s_server_port", ldapsource); dict_ldap->server_port = - get_config_int(vstring_str(config_param), LDAP_PORT, 0, 0); + get_mail_conf_int(vstring_str(config_param), LDAP_PORT, 0, 0); if (msg_verbose) msg_info("%s: %s is %d", myname, vstring_str(config_param), dict_ldap->server_port); vstring_sprintf(config_param, "%s_search_base", ldapsource); dict_ldap->search_base = - mystrdup((char *) get_config_str(vstring_str(config_param), "", 0, 0)); + mystrdup((char *) get_mail_conf_str(vstring_str(config_param), "", 0, 0)); if (msg_verbose) msg_info("%s: %s is %s", myname, vstring_str(config_param), dict_ldap->search_base); /* get configured value of "ldapsource_timeout"; default to 10 */ vstring_sprintf(config_param, "%s_timeout", ldapsource); - dict_ldap->timeout = get_config_int(config_param, 10, 0, 0); + 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); vstring_sprintf(config_param, "%s_query_filter", ldapsource); dict_ldap->query_filter = - mystrdup((char *) get_config_str(vstring_str(config_param), + mystrdup((char *) get_mail_conf_str(vstring_str(config_param), "(mailacceptinggeneralid=%s)", 0, 0)); if (msg_verbose) msg_info("%s: %s is %s", myname, vstring_str(config_param), @@ -369,7 +369,7 @@ DICT *dict_ldap_open(const char *ldapsource, int dummy, int dict_flags) vstring_sprintf(config_param, "%s_result_attribute", ldapsource); dict_ldap->result_attribute = - mystrdup((char *) get_config_str(vstring_str(config_param), + mystrdup((char *) get_mail_conf_str(vstring_str(config_param), "maildrop", 0, 0)); if (msg_verbose) msg_info("%s: %s is %s", myname, vstring_str(config_param), @@ -377,7 +377,7 @@ DICT *dict_ldap_open(const char *ldapsource, int dummy, int dict_flags) /* get configured value of "ldapsource_bind"; default to true */ vstring_sprintf(config_param, "%s_bind", ldapsource); - dict_ldap->bind = get_config_bool(vstring_str(config_param), 1); + dict_ldap->bind = get_mail_conf_bool(vstring_str(config_param), 1); if (msg_verbose) msg_info("%s: %s is %d", myname, vstring_str(config_param), dict_ldap->bind); @@ -385,7 +385,7 @@ DICT *dict_ldap_open(const char *ldapsource, int dummy, int dict_flags) /* get configured value of "ldapsource_bind_dn"; default to "" */ vstring_sprintf(config_param, "%s_bind_dn", ldapsource); dict_ldap->bind_dn = - mystrdup((char *) get_config_str(vstring_str(config_param), "", 0, 0)); + mystrdup((char *) get_mail_conf_str(vstring_str(config_param), "", 0, 0)); if (msg_verbose) msg_info("%s: %s is %s", myname, vstring_str(config_param), dict_ldap->bind_dn); @@ -393,7 +393,7 @@ DICT *dict_ldap_open(const char *ldapsource, int dummy, int dict_flags) /* get configured value of "ldapsource_bind_pw"; default to "" */ vstring_sprintf(config_param, "%s_bind_pw", ldapsource); dict_ldap->bind_pw = - mystrdup((char *) get_config_str(vstring_str(config_param), "", 0, 0)); + mystrdup((char *) get_mail_conf_str(vstring_str(config_param), "", 0, 0)); if (msg_verbose) msg_info("%s: %s is %s", myname, vstring_str(config_param), dict_ldap->bind_pw);