]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-19990426
authorWietse Venema <wietse@porcupine.org>
Mon, 26 Apr 1999 05:00:00 +0000 (00:00 -0500)
committerWietse Venema <wietse@porcupine.org>
Thu, 17 Jan 2013 03:34:15 +0000 (22:34 -0500)
102 files changed:
postfix/HISTORY
postfix/Makefile.in
postfix/RELEASE_NOTES
postfix/bounce/Makefile.in
postfix/bounce/bounce.c
postfix/bounce/bounce_notify_service.c
postfix/chroot-setup/AIX42 [new file with mode: 0644]
postfix/chroot-setup/BSDI2 [new file with mode: 0644]
postfix/chroot-setup/BSDI3 [new file with mode: 0644]
postfix/chroot-setup/FREEBSD3 [new file with mode: 0644]
postfix/chroot-setup/FreeBSD2 [new file with mode: 0644]
postfix/chroot-setup/HPUX10 [new file with mode: 0644]
postfix/chroot-setup/HPUX9 [new file with mode: 0644]
postfix/chroot-setup/IRIX5 [new file with mode: 0644]
postfix/chroot-setup/IRIX6 [new file with mode: 0644]
postfix/chroot-setup/LINUX2 [new file with mode: 0644]
postfix/chroot-setup/NETBSD1 [new file with mode: 0644]
postfix/chroot-setup/NEXTSTEP3 [new file with mode: 0644]
postfix/chroot-setup/OPENSTEP4 [new file with mode: 0644]
postfix/chroot-setup/OSF1 [new file with mode: 0644]
postfix/chroot-setup/Solaris2 [new file with mode: 0644]
postfix/cleanup/Makefile.in
postfix/cleanup/cleanup.c
postfix/conf/main.cf.default
postfix/conf/master.cf
postfix/conf/sample-smtpd.cf
postfix/error/.indent.pro [new file with mode: 0644]
postfix/error/Makefile.in [new file with mode: 0644]
postfix/error/error.c [new file with mode: 0644]
postfix/global/Makefile.in
postfix/global/config.h
postfix/global/debug_process.c
postfix/global/dot_lockfile.c
postfix/global/mail_addr_crunch.c
postfix/global/mail_addr_find.c
postfix/global/mail_addr_map.c
postfix/global/mail_conf.c [moved from postfix/global/config.c with 69% similarity]
postfix/global/mail_conf.h [new file with mode: 0644]
postfix/global/mail_conf_bool.c [moved from postfix/global/config_bool.c with 51% similarity]
postfix/global/mail_conf_int.c [moved from postfix/global/config_int.c with 50% similarity]
postfix/global/mail_conf_raw.c [moved from postfix/global/config_raw.c with 60% similarity]
postfix/global/mail_conf_str.c [moved from postfix/global/config_str.c with 55% similarity]
postfix/global/mail_params.c
postfix/global/mail_proto.h
postfix/global/mail_version.h
postfix/global/maps.c
postfix/global/resolve_clnt.c
postfix/global/resolve_local.c
postfix/global/rewrite_clnt.c
postfix/local/Makefile.in
postfix/local/dotforward.c
postfix/local/local.c
postfix/mantools/README [new file with mode: 0644]
postfix/mantools/ccformat [new file with mode: 0755]
postfix/mantools/enter [new file with mode: 0755]
postfix/mantools/mansect [new file with mode: 0755]
postfix/mantools/srctoman [new file with mode: 0755]
postfix/master/Makefile.in
postfix/master/mail_server.h
postfix/master/master.c
postfix/master/master_vars.c
postfix/master/multi_server.c
postfix/master/single_server.c
postfix/master/trigger_server.c
postfix/pickup/Makefile.in
postfix/pickup/pickup.c
postfix/pipe/Makefile.in
postfix/pipe/pipe.c
postfix/postalias/Makefile.in
postfix/postalias/postalias.c
postfix/postconf/Makefile.in
postfix/postconf/postconf.c
postfix/postdrop/Makefile.in
postfix/postdrop/postdrop.c
postfix/postfix/Makefile.in
postfix/postfix/postfix.c
postfix/postkick/Makefile.in
postfix/postkick/postkick.c
postfix/postlock/Makefile.in
postfix/postlock/postlock.c
postfix/postmap/Makefile.in
postfix/postmap/postmap.c
postfix/postsuper/Makefile.in
postfix/postsuper/postsuper.c
postfix/qmgr/Makefile.in
postfix/qmgr/qmgr.c
postfix/qmgr/qmgr_transport.c
postfix/sendmail/Makefile.in
postfix/sendmail/sendmail.c
postfix/showq/Makefile.in
postfix/showq/showq.c
postfix/smtp/Makefile.in
postfix/smtp/smtp.c
postfix/smtp/smtp_state.c
postfix/smtpd/Makefile.in
postfix/smtpd/smtpd.c
postfix/smtpd/smtpd_check.c
postfix/trivial-rewrite/Makefile.in
postfix/trivial-rewrite/resolve.c
postfix/trivial-rewrite/rewrite.c
postfix/trivial-rewrite/trivial-rewrite.c
postfix/util/dict_ldap.c

index 54133a830d8575302880754b8992a8e9bc8c6bb3..937953528aad1e7fa46951738ee033fbb64fec23 100644 (file)
@@ -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.
index cccfb2469f1899e1aebe90f7973040b13346c100..f4a8a419e3f72bd28f7c280c25e7303e6a032114 100644 (file)
@@ -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
index 784b74480bc981455dba1b43a8cdd82ca6590bb4..4baa9ed89299800d53805ce08103c159764fbd88 100644 (file)
@@ -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,
index d9d93153a506238bb45358fe2a4e6428a9d49d48..cb252a20f88edfb970fac60b500125f1cad3726e 100644 (file)
@@ -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
index 8f1300a5362b46ba7d12edef02df3f564f2d18ef..1faca975b41b0d0ee8d25c8d4d3b095f445725f8 100644 (file)
@@ -92,7 +92,7 @@
 #include <mail_proto.h>
 #include <mail_queue.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <bounce.h>
 
 /* Single-threaded server skeleton. */
index 5144bd8a6ae914247958ac3acbdaedb1a6772155..47c9d4f3f2a6a8fe147ea70f4b56f4734a505690 100644 (file)
@@ -77,7 +77,7 @@
 #include <is_header.h>
 #include <record.h>
 #include <rec_type.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <post_mail.h>
 #include <mail_addr.h>
 #include <mark_corrupt.h>
diff --git a/postfix/chroot-setup/AIX42 b/postfix/chroot-setup/AIX42
new file mode 100644 (file)
index 0000000..4562d48
--- /dev/null
@@ -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 (file)
index 0000000..c3be021
--- /dev/null
@@ -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 (file)
index 0000000..c3be021
--- /dev/null
@@ -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 (file)
index 0000000..5c81341
--- /dev/null
@@ -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 (file)
index 0000000..5c81341
--- /dev/null
@@ -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 (file)
index 0000000..ca54c65
--- /dev/null
@@ -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 (file)
index 0000000..ca54c65
--- /dev/null
@@ -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 (file)
index 0000000..a8e3a40
--- /dev/null
@@ -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 <ayamura@ayamura.org>
+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 <ayamura@ayamura.org>
+
+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 (file)
index 0000000..a8e3a40
--- /dev/null
@@ -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 <ayamura@ayamura.org>
+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 <ayamura@ayamura.org>
+
+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 (file)
index 0000000..e6b1802
--- /dev/null
@@ -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 (file)
index 0000000..5340767
--- /dev/null
@@ -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 (file)
index 0000000..a2f163e
--- /dev/null
@@ -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 (file)
index 0000000..a2f163e
--- /dev/null
@@ -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 (file)
index 0000000..dd6ae64
--- /dev/null
@@ -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 (file)
index 0000000..26bf297
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# Create chroot'd area under Solaris 2.5.1 for postfix.
+#
+# Dug Song <dugsong@UMICH.EDU>
+
+if [ $# -ne 1 ]; then
+  echo "Usage: `basename $0` <directory>, 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
index 391f409ffb37b2cb558142506f119b4c162f74a6..d7b7baff74ea17b75384fbd72b2a90b5eebc4c6d 100644 (file)
@@ -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
index 367693634513daf100ab760ac8da934da81ba2a3..6123cfcb3ee79d41c3f7bd38406a3c6692d95f65 100644 (file)
 
 /* Global library. */
 
-#include <config.h>
+#include <mail_conf.h>
 #include <cleanup_user.h>
 #include <mail_queue.h>
 #include <mail_proto.h>
index e12daa65607272e2e69a0b854d444e562c80d7b4..51378131788b924116386f3b1b3ed4370dd16599 100644 (file)
@@ -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
index 95a929603c59d641526292e4958595c70396cbde..d300bb89a0ac32d55e262e6f952471bbce6a7c83 100644 (file)
@@ -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}
index c77a4a58e699288a1fdebf5fbe39ec78a875d9db..23707f3b44324d8cd596d50d6f10692a674cb5f6 100644 (file)
@@ -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 (file)
index 0000000..88212c9
--- /dev/null
@@ -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 (file)
index 0000000..75477d7
--- /dev/null
@@ -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 (file)
index 0000000..4e3c09d
--- /dev/null
@@ -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 <sys_defs.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+/* Utility library. */
+
+#include <msg.h>
+#include <vstream.h>
+
+/* Global library. */
+
+#include <deliver_request.h>
+#include <mail_queue.h>
+#include <bounce.h>
+#include <deliver_completed.h>
+
+/* Single server skeleton. */
+
+#include <mail_server.h>
+
+/* 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);
+}
index bb618ef14b2087f9a1ed88175ec7d1fe5604adf9..9f78c7c3e48fcdd54076cbe7b5ea2225f5b31678 100644 (file)
@@ -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
index c9868a7763c6a4c3e8ab7060b3ae8a11251b6a08..d03a6527ef0ba4baad1a4f9e9d7a8a868e75a14a 100644 (file)
 /* NAME
 /*     config 3h
 /* SUMMARY
-/*     global configuration parameter management
+/*     compatibility
 /* SYNOPSIS
 /*     #include <config.h>
 /* 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 <mail_conf.h>
+
+ /*
+  * 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
index 0911afc1d3433a3fe3d9a68352007ef1055fff5b..d045678636640204d3fdbf9cf9e6d6191d28ab08 100644 (file)
@@ -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);
index ccedc2f90a2dafc009c426be074de08f7dc7b3f2..599343679de0346b1f25f3b17b7e149af7daacfa 100644 (file)
@@ -138,7 +138,7 @@ void    dot_unlockfile(const char *path)
 #include <msg.h>
 #include <vstream.h>
 #include <msg_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
 
 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]);
index 560602d502d13febb403b41eb10f3f90b5d02c49..5f1c3a707b82fd5516c43b1063a0d634d97687aa 100644 (file)
@@ -112,7 +112,7 @@ ARGV   *mail_addr_crunch(const char *string, const char *extension)
 #include <msg.h>
 #include <vstream.h>
 #include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 
 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);
 
index de8b7fe7e73d4343a3e8453ea938b584bd58cc65..e5ee6bd2bfb717c41385b3fa80ea5d2ba34f8f38 100644 (file)
@@ -194,7 +194,7 @@ const char *mail_addr_find(MAPS *path, const char *address, char **extp)
   */
 #include <vstream.h>
 #include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
 
 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;
index 6949f5fd94a99c9e2bd202e6356b6a0d0afad3ca..8d9436804b8fea9dc0e2afb4a56e57e901d8e9a7 100644 (file)
@@ -135,7 +135,7 @@ ARGV   *mail_addr_map(MAPS *path, const char *address)
   * the lookup result.
   */
 #include <unistd.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <vstream.h>
 #include <vstring_vstream.h>
 #include <mail_params.h>
@@ -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);
similarity index 69%
rename from postfix/global/config.c
rename to postfix/global/mail_conf.c
index 10b8aadc95482e1da28b9a888fc88715125dc3f7..bb491892cc4576aacefb1ce08e729d9ea8cbb4c1 100644 (file)
@@ -1,46 +1,46 @@
 /*++
 /* NAME
-/*     config 3
+/*     mail_conf 3
 /* SUMMARY
 /*     global configuration parameter management
 /* SYNOPSIS
-/*     #include <config.h>
+/*     #include <mail_conf.h>
 /*
-/*     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
 /* 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 (file)
index 0000000..6443ff7
--- /dev/null
@@ -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 <mail_conf.h>
+/* 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
similarity index 51%
rename from postfix/global/config_bool.c
rename to postfix/global/mail_conf_bool.c
index 0569760c26e19bc6c5b99278665b6968300e1ef4..f366e23252ea9eb99be8427b229b6253cf8bee7a 100644 (file)
@@ -1,29 +1,29 @@
 /*++
 /* NAME
-/*     config_bool 3
+/*     mail_conf_bool 3
 /* SUMMARY
 /*     boolean-valued configuration parameter support
 /* SYNOPSIS
-/*     #include <config.h>
+/*     #include <mail_conf.h>
 /*
-/*     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
 /*     (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
 
 /* 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++;
     }
 }
similarity index 50%
rename from postfix/global/config_int.c
rename to postfix/global/mail_conf_int.c
index fba915d709cdaccf687da180ce32191eeadfcab7..da4f0ddab0384b138d7d609f8953adec2a03e0d4 100644 (file)
@@ -1,34 +1,34 @@
 /*++
 /* NAME
-/*     config_int 3
+/*     mail_conf_int 3
 /* SUMMARY
 /*     integer-valued configuration parameter support
 /* SYNOPSIS
-/*     #include <config.h>
+/*     #include <mail_conf.h>
 /*
-/*     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;
 /*     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
 
 /* 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++;
     }
similarity index 60%
rename from postfix/global/config_raw.c
rename to postfix/global/mail_conf_raw.c
index 2a5558f71572b7448cb35cfe97e15beefc5cc410..21eda4aea6a9b7a44f3db0a4de4c49f559632e62 100644 (file)
@@ -1,44 +1,44 @@
 /*++
 /* NAME
-/*     config_raw 3
+/*     mail_conf_raw 3
 /* SUMMARY
 /*     raw string-valued global configuration parameter support
 /* SYNOPSIS
-/*     #include <config.h>
+/*     #include <mail_conf.h>
 /*
-/*     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
 
 /* 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++;
     }
similarity index 55%
rename from postfix/global/config_str.c
rename to postfix/global/mail_conf_str.c
index 6d2c6c37b05f15c63c1ab92af8643c1cf59920ed..fba5ead46351189d6a81f27d5a99ce074200b276 100644 (file)
@@ -1,52 +1,52 @@
 /*++
 /* NAME
-/*     config_str 3
+/*     mail_conf_str 3
 /* SUMMARY
 /*     string-valued global configuration parameter support
 /* SYNOPSIS
-/*     #include <config.h>
+/*     #include <mail_conf.h>
 /*
-/*     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
 
 /* 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++;
     }
index f7388814c2562d8ad03b5956db66a5c40fa8c491..a98e2b01879895800efdab64250af32f260f07fc 100644 (file)
 /* 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.
index d3934dc53189f0e05f19769a18a47f41fdb130d3..977df5604fdf21ef5b5a938c5be43258fa3af021 100644 (file)
@@ -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
index d2702bd0d283fe83dcdd3763355ac21ddf2cee09..faa66cf08fee7d0a17021191604db8151a2f51d4 100644 (file)
@@ -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
index 02af45d4c6439eddd277cf8db497b83b40b36d50..26e41b755783a5ace56b08a95efe86ef24b09faf 100644 (file)
@@ -97,7 +97,7 @@
 
 /* Global library. */
 
-#include "config.h"
+#include "mail_conf.h"
 #include "maps.h"
 
 /* maps_create - initialize */
index 3c6ef7ce0b7501ade3f7dc92c8cf4b247e14c583..ae47df04bcd5538e0396fa7cb404f4addf0ed6c2 100644 (file)
@@ -155,7 +155,7 @@ void    resolve_clnt_free(RESOLVE_REPLY *reply)
 #include <stdlib.h>
 #include <msg_vstream.h>
 #include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
 
 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);
index 6588fddc0dc276f4ad47246471e17c4c3379672e..42fbae7b3fe79e74ac3693ae141e828f25a2a497 100644 (file)
@@ -122,13 +122,13 @@ int     resolve_local(const char *addr)
 #ifdef TEST
 
 #include <vstream.h>
-#include <config.h>
+#include <mail_conf.h>
 
 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);
 }
index a2545a78e7f7d465dc191eee4c79150c7e86d880..cfbec3c502144f83c0c6770d24afd6eae407d716 100644 (file)
@@ -148,7 +148,7 @@ VSTRING *rewrite_clnt_internal(const char *ruleset, const char *addr, VSTRING *r
 #include <string.h>
 #include <msg_vstream.h>
 #include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 
 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);
index 96972411b72e5daad892e6db7822dbff3e8da863..7f4a5f6aeb34caeca23689ecd6770b046ea25b9a 100644 (file)
@@ -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
index 1f49e76710955b55d787a34457704bb42c9989f4..6c18f56477bfbd63104f73d67e7282acfcf3307c 100644 (file)
@@ -75,7 +75,7 @@
 #include <bounce.h>
 #include <been_here.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 
 /* 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);
index 09d21b1d36b02066015aff913afe57574179fade..e865bb26711aa87d96f3b1f5957e639acaa7ba83 100644 (file)
 #include <deliver_completed.h>
 #include <mail_params.h>
 #include <mail_addr.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <been_here.h>
 #include <mail_params.h>
 
diff --git a/postfix/mantools/README b/postfix/mantools/README
new file mode 100644 (file)
index 0000000..230cdc9
--- /dev/null
@@ -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 (executable)
index 0000000..bdc74d6
--- /dev/null
@@ -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 (executable)
index 0000000..4287c1a
--- /dev/null
@@ -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 (executable)
index 0000000..60262be
--- /dev/null
@@ -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 (executable)
index 0000000..59809b8
--- /dev/null
@@ -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)
+#--
index d2dcf052c9d1bdaf0974b20a9e24f305a37debef..c0840d633bfade475757c9b312327bb0dd0f8a33 100644 (file)
@@ -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
index 9bf37117cfa73444e7e3ab3d486c1d7d20d1d04c..303f9ca7fad0e39a1228da47229dcf9cc93aac36 100644 (file)
@@ -14,7 +14,7 @@
 #include <vstream.h>
 
  /*
-  * 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
index 023f2c8c7e833eb6ad22bd22793ffd277b2ac514..463d324aea9357b5a0b676d58a5f45e54a827f2a 100644 (file)
 #include <mail_params.h>
 #include <debug_process.h>
 #include <mail_task.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <open_lock.h>
 
 /* 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
index 669147a95c0850f7ca4ed351e4afe10a9b7e3a96..3332e8c58f8f4a302a755cc44f8c0d80e5689c7d 100644 (file)
@@ -35,7 +35,7 @@
 
 /* Global library. */
 
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 
 /* 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);
index 01d981129ec997edad813dda84d0cedfaee4f617..1163f89c28437d30c0ea6e030a1d46edec22a586 100644 (file)
 #include <mail_task.h>
 #include <debug_process.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <timed_ipc.h>
 #include <resolve_local.h>
 
@@ -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);
index 0922ce8c6a855927b4274dfb49f71e4d87c8ffe6..708b041424d804995d4f42dd44209732e348e2de 100644 (file)
 #include <mail_params.h>
 #include <mail_task.h>
 #include <debug_process.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <timed_ipc.h>
 #include <resolve_local.h>
 
@@ -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);
index 1434617e7f2f707f9d273cbbc38397e751fd08ba..d145682a350723b88ac28b3c835850ad66f627c1 100644 (file)
 #include <mail_params.h>
 #include <mail_task.h>
 #include <debug_process.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <resolve_local.h>
 
 /* 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);
index 1edbf8c3b4f74a16994d9d8dd1a5f5ccca48e3d6..11949185295a075ee39d01076ff573a3e967b8da 100644 (file)
@@ -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
index 7ef02cb0b2242836a53ad518d66b5fa5f96c03b0..5eeb9a10b07e858a480b4fe9008c4d84b75b77e5 100644 (file)
@@ -95,7 +95,7 @@
 #include <cleanup_user.h>
 #include <mail_date.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <record.h>
 #include <rec_type.h>
 
index 59eb45dfbcd28ab21f91144e2aa71e0cb6fa4f8e..7693befbf32fa15f1e5abb2d8a0c1aaed0bb4a4d 100644 (file)
@@ -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
index cc2750112b87a4396ad8cd70af6043dcf2d30bcf..35b765c0e676a3ff48d2c06a9a7e9aa4a8767b39 100644 (file)
 #include <deliver_request.h>
 #include <mail_queue.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <bounce.h>
 #include <defer.h>
 #include <deliver_completed.h>
@@ -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.
index 795db706fe6030c3d1127893dca09c6e27544204..3869efbb2a0f1dee8bc5cfe7d7a6f4388458a55d 100644 (file)
@@ -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
index a3d7ffe898fdcceb81330ded48b1d604c543dd52..9e6408165f50dd967929667cb773e8a58f8b0a8d 100644 (file)
 /* Global library. */
 
 #include <tok822.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 #include <mkmap.h>
 
@@ -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
index 4d18315f64394cb5cb419e9de7b301d9db221562..b608720a2e1b197f61b6f9d1232cc252d70dfb77 100644 (file)
@@ -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
index 70df435fb2c776c396607a97ca61720d18400990..e681dcea36112e24cdafb0185343e142a46408e3 100644 (file)
@@ -69,7 +69,7 @@
 /* Global library. */
 
 #include <mynetworks.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_proto.h>
 #include <mail_version.h>
 #include <mail_params.h>
@@ -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);
index de5ada7b51a556833a93a54b9ee0fc742fb25f72..0ebc839e87440e2f31c66af86021140d8d51968f 100644 (file)
@@ -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
index 3dffaf04d3a556501df75093a82920e034c78a7d..297f4f0407adfc48afeefc215057707f576f1216 100644 (file)
@@ -87,7 +87,7 @@
 #include <mail_proto.h>
 #include <mail_queue.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_task.h>
 #include <clean_env.h>
 #include <mail_stream.h>
@@ -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)
index c195be500b21ab85abfce5b62c5666bb52e8669c..76135b5eaeb5471c4c6c3448fa90e503601189b8 100644 (file)
@@ -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
index d88f6e4d86e62defb8a60e001f4939fced33b94e..d9850c2e3a51c43dd7ff0946c5255ee8faff74b1 100644 (file)
 
 /* Global library. */
 
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 
 /* 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 */
index 5066343e751c9828dc25f2335289b13d52289ae8..97bfe052d57913c4435dfc45a06d0269fe227184 100644 (file)
@@ -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
index 044a0839005c0469bf861ce528b774e1be966dfb..ee67a4cf319136640d66b724d818089593d34697 100644 (file)
@@ -85,7 +85,7 @@
 
 #include <mail_proto.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 
 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);
 
index 6003b44e83f8c94e55e396e50380ad8980c00729..dca43797f38c4047edc44524187dd72f4b3a3fc0 100644 (file)
@@ -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
index 558f8f78005c4fd5ee8a486d71b79c1d296472ed..9d728d4d4c03f9b6c0b66acf2e91e90beed91dc4 100644 (file)
@@ -98,7 +98,7 @@
 #include <mail_params.h>
 #include <dot_lockfile.h>
 #include <deliver_flock.h>
-#include <config.h>
+#include <mail_conf.h>
 
 /* 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
index 89f364f2ed6031717b766c457ad81ca6039d5a94..d094449001ac8277f238db424f7afd314ca8d20a 100644 (file)
@@ -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
index 2aadc4d8232258300391f22dab99c3518aa50644..b50bd6c846b8245f21812c2c224d7d7a080cde08 100644 (file)
 
 /* Global library. */
 
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 #include <mkmap.h>
 
@@ -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
index c91df1d937dd3bd4c77bbfcaa91d1375bc33c7a2..fa73f4a055986deae542f3cb9ffd71d6b975ff80 100644 (file)
@@ -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
index b225f84f2e6d264016de75131eea1dbda09b7dcf..6453b30239bd697c3d3c3cfb602ecd640275180e 100644 (file)
@@ -80,7 +80,7 @@
 /* Global library. */
 
 #include <mail_task.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 #include <mail_queue.h>
 
@@ -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);
 
index fe93507008ff935999e70e6f4e07fb7da1d3cc67..e6e138c52b66879b0a796a9343cd5465d064ef03 100644 (file)
@@ -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
index 22a690f9656585bb71b1f53f50fe85100d2bc14a..7ed726e43607c758e8fea2a5a0a8ceb290480cd7 100644 (file)
 
 #include <mail_queue.h>
 #include <recipient_list.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 #include <mail_proto.h>                        /* QMGR_SCAN constants */
 
index fcaa95c398eb50471b79e9bd9e890f7b0447eb4e..b58fcd5ebdf37818b233123590a231d829b0cd8c 100644 (file)
@@ -84,7 +84,7 @@
 
 #include <mail_proto.h>
 #include <recipient_list.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <mail_params.h>
 
 /* 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
index 9f401a365b0f9e870ba0f96ae64d6bbabd2a5e05..b50388300d5d568e3bdc5141fe70a6a9c864d960 100644 (file)
@@ -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
index d15701c769df45a59bd25a625e3177ca9b9b8458..a6b41020eae24d026e55093780271c5f95b8d1e3 100644 (file)
 #include <record.h>
 #include <rec_type.h>
 #include <rec_streamlf.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <cleanup_user.h>
 #include <mail_task.h>
 #include <mail_run.h>
@@ -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':
index c020235bac4ac4238a824328fd638244a4f5699e..1d5bf10c3f6b8b67407e55012ad0d3fcab6ed0d0 100644 (file)
@@ -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
index 8b23e77f2fcd8e8c722b2fbbb0c4b5971a50de3b..1e6d1e93a896aa9488f702c95b3434c69638a605 100644 (file)
@@ -76,7 +76,7 @@
 #include <mail_date.h>
 #include <mail_params.h>
 #include <mail_scan_dir.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <record.h>
 #include <rec_type.h>
 #include <htable.h>
index 6d528e8802d6200a2b695a6b21d9fdd5bbdab307..ae9e7f14e289bbf3c9f2aa2f349099eb52d3615c 100644 (file)
@@ -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
index 8287e67319bbaadd95249795702d2a83a550af50..10a6aa988178088e0cedf69c65942b8656ef3280 100644 (file)
 #include <deliver_request.h>
 #include <mail_queue.h>
 #include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <debug_peer.h>
 #include <mail_error.h>
 #include <deliver_pass.h>
index 97c395a84b0721e0ab880c9f3c33ad9bab04a275..1ab6a6f1dbbbae8c3b5c089ed3a1ff959517b57e 100644 (file)
@@ -42,7 +42,7 @@
 
 /* Global library. */
 
-#include <config.h>
+#include <mail_conf.h>
 
 /* Application-specific. */
 
index 436dbd059cefe50bcbe17ffe23380235f63a6160..b9cca844d2490eb86474d57597b1a32274a8aa2c 100644 (file)
@@ -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
index 6b88e9e85395eb8ae90ddacbacc869314293e395..b7328969debcb5ed4b4d28e0cd3fbabdbdb8817a 100644 (file)
 #include <mail_proto.h>
 #include <cleanup_user.h>
 #include <mail_date.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <off_cvt.h>
 #include <debug_peer.h>
 #include <mail_error.h>
index 976a8dfcdd805ac9f9b221a024439537cdb98dc6..11cbf7b8ffaaa37952e0c02d46bb77515226eb86 100644 (file)
@@ -1465,7 +1465,7 @@ char   *smtpd_check_size(SMTPD_STATE *state, off_t size)
 #include <msg_vstream.h>
 #include <vstring_vstream.h>
 
-#include <config.h>
+#include <mail_conf.h>
 
 #include <smtpd_chat.h>
 
index fa09c38bbd45b2b4750d73bc57bdcd424dbba2ed..e4036be06f24309a9848eab5b8d7969e16451f1b 100644 (file)
@@ -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
index 160c4dd24bb51ff2d0a2bb7af135b3ad454c1ba8..5f185882cb0f67c798152fba7781bcf6557e83b3 100644 (file)
@@ -69,7 +69,7 @@
 #include <mail_addr.h>
 #include <rewrite_clnt.h>
 #include <resolve_local.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <quote_822_local.h>
 #include <tok822.h>
 
index 93ec33f3e419f124387948f52e36e49a732e9428..b798a5c3cebc9b935a943b75f111b173874c5aca 100644 (file)
@@ -71,7 +71,7 @@
 #include <mail_proto.h>
 #include <resolve_local.h>
 #include <tok822.h>
-#include <config.h>
+#include <mail_conf.h>
 
 /* Application-specific. */
 
index 1612317333f8f055caf7b5f34d17da56f70aa5c8..991cde5f49090b2bdfe8a0424fe0f803a267ce28 100644 (file)
 #include <mail_params.h>
 #include <mail_proto.h>
 #include <resolve_local.h>
-#include <config.h>
+#include <mail_conf.h>
 #include <resolve_clnt.h>
 #include <rewrite_clnt.h>
 #include <tok822.h>
index 32f1fa99736b12a3bdd6ccd952af2796521a3b27..d241a499289be16192f9912ff2d7cb00fba40ea4 100644 (file)
@@ -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);