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.
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
-Incompatible changes with snapshot-19990423:
+Incompatible changes with snapshot-19990426:
===========================================
- If an address extension (+foo) matches a user's .forward+foo file
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,
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
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
#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. */
#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>
--- /dev/null
+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
--- /dev/null
+mkdir /var/spool/postfix/etc
+chmod 755 /var/spool/postfix/etc
+cp /etc/localtime /etc/services /etc/resolv.conf /var/spool/postfix/etc
--- /dev/null
+mkdir /var/spool/postfix/etc
+chmod 755 /var/spool/postfix/etc
+cp /etc/localtime /etc/services /etc/resolv.conf /var/spool/postfix/etc
--- /dev/null
+mkdir /var/spool/postfix/etc
+chmod 755 /var/spool/postfix/etc
+cd /etc ; cp host.conf localtime services resolv.conf /var/spool/postfix/etc
--- /dev/null
+mkdir /var/spool/postfix/etc
+chmod 755 /var/spool/postfix/etc
+cd /etc ; cp host.conf localtime services resolv.conf /var/spool/postfix/etc
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+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
+
+
--- /dev/null
+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
+
+
--- /dev/null
+# 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
--- /dev/null
+mkdir /var/spool/postfix/etc
+chmod 755 /var/spool/postfix/etc
+cd /etc ; cp localtime services resolv.conf /var/spool/postfix/etc
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+*******************************************************************
+# 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
+
+#*******************************************************************
--- /dev/null
+#!/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
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
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
/* Global library. */
-#include <config.h>
+#include <mail_conf.h>
#include <cleanup_user.h>
#include <mail_queue.h>
#include <mail_proto.h>
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
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}
# 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.
#
# 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
# 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"
# 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.
--- /dev/null
+-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
--- /dev/null
+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
--- /dev/null
+/*++
+/* 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);
+}
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 \
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
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
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
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
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
/* 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
/* 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 */
/*
* 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);
#include <msg.h>
#include <vstream.h>
#include <msg_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
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]);
#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)
ARGV *argv;
char **cpp;
- read_config();
+ mail_conf_read();
if (chdir(var_queue_dir) < 0)
msg_fatal("chdir %s: %m", var_queue_dir);
*/
#include <vstream.h>
#include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
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;
* the lookup result.
*/
#include <unistd.h>
-#include <config.h>
+#include <mail_conf.h>
#include <vstream.h>
#include <vstring_vstream.h>
#include <mail_params.h>
/*
* Initialize.
*/
- read_config();
+ mail_conf_read();
msg_verbose = 1;
if (chdir(var_queue_dir) < 0)
msg_fatal("chdir %s: %m", var_queue_dir);
/*++
/* 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
/* 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;
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;
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);
}
--- /dev/null
+#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
/*++
/* 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) {
}
}
-/* 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++;
}
}
/*++
/* 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);
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);
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++;
}
/*++
/* 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);
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++;
}
/*++
/* 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);
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++;
}
/* Global library. */
#include "mynetworks.h"
-#include "config.h"
+#include "mail_conf.h"
#include "mail_version.h"
#include "mail_params.h"
*/
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);
* 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();
* 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.
#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
* 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
/* Global library. */
-#include "config.h"
+#include "mail_conf.h"
#include "maps.h"
/* maps_create - initialize */
#include <stdlib.h>
#include <msg_vstream.h>
#include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
static NORETURN usage(char *myname)
{
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);
#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);
}
#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)
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);
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
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
#include <bounce.h>
#include <been_here.h>
#include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
/* Application-specific. */
/*
* 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);
#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>
--- /dev/null
+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
--- /dev/null
+#!/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)
+#--
--- /dev/null
+#!/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)
+#--
--- /dev/null
+#!/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
+#--
--- /dev/null
+#!/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)
+#--
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
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
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
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
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
#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
#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. */
* 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
/* Global library. */
-#include <config.h>
+#include <mail_conf.h>
#include <mail_params.h>
/* Application-specific. */
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);
#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>
* 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
* 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);
#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>
* 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
* 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);
#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. */
* 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
* 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);
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
#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>
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
#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>
* 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.
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
/* Global library. */
#include <tok822.h>
-#include <config.h>
+#include <mail_conf.h>
#include <mail_params.h>
#include <mkmap.h>
break;
}
}
- read_config();
+ mail_conf_read();
/*
* Use the map type specified by the user, or fall back to a default
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
/* Global library. */
#include <mynetworks.h>
-#include <config.h>
+#include <mail_conf.h>
#include <mail_proto.h>
#include <mail_version.h>
#include <mail_params.h>
*/
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);
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;
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);
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
#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>
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
* 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)
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
/* Global library. */
-#include <config.h>
+#include <mail_conf.h>
#include <mail_params.h>
/* check_setenv - setenv() with extreme prejudice */
* 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 */
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
#include <mail_proto.h>
#include <mail_params.h>
-#include <config.h>
+#include <mail_conf.h>
static NORETURN usage(char *myname)
{
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.
/*
* Finish initializations.
*/
- read_config();
+ mail_conf_read();
if (chdir(var_queue_dir))
msg_fatal("chdir %s: %m", var_queue_dir);
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
#include <mail_params.h>
#include <dot_lockfile.h>
#include <deliver_flock.h>
-#include <config.h>
+#include <mail_conf.h>
/* Application-specific. */
/*
* Read the config file.
*/
- read_config();
+ mail_conf_read();
/*
* Lock the folder for exclusive access. Lose the lock upon exit. The
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
/* Global library. */
-#include <config.h>
+#include <mail_conf.h>
#include <mail_params.h>
#include <mkmap.h>
break;
}
}
- read_config();
+ mail_conf_read();
/*
* Use the map type specified by the user, or fall back to a default
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
/* Global library. */
#include <mail_task.h>
-#include <config.h>
+#include <mail_conf.h>
#include <mail_params.h>
#include <mail_queue.h>
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);
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
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
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
#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 */
#include <mail_proto.h>
#include <recipient_list.h>
-#include <config.h>
+#include <mail_conf.h>
#include <mail_params.h>
/* Application-specific. */
* 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
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
#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>
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);
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':
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
#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>
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
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
#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>
/* Global library. */
-#include <config.h>
+#include <mail_conf.h>
/* Application-specific. */
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
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
#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>
#include <msg_vstream.h>
#include <vstring_vstream.h>
-#include <config.h>
+#include <mail_conf.h>
#include <smtpd_chat.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
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
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
#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>
#include <mail_proto.h>
#include <resolve_local.h>
#include <tok822.h>
-#include <config.h>
+#include <mail_conf.h>
/* Application-specific. */
#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>
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),
*/
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),
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),
/* 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);
/* 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);
/* 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);