conf/117984: [patch] map improvement for etc/mail/Makefile

Helge Oldach src-etc-mail-makefile-nov07 at
Sun Nov 11 11:40:02 PST 2007

>Number:         117984
>Category:       conf
>Synopsis:       [patch] map improvement for etc/mail/Makefile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 11 19:40:01 UTC 2007
>Originator:     Helge Oldach
>Release:        FreeBSD 6.3-1032 i386

System: FreeBSD localhost 6.3-1032 FreeBSD 6.3-1032 #0: Sat Nov 10 11:14:15 CET 2007 toor at localhost:/usr/obj/usr/src/sys/HMO i386


Below is a suggested improvement for /etc/mail/Makefile. It implements
multiple input files for various maps, e.g. virtusertable, permitting
easier maintenance of map input files. The idea is that the map input
file (e.g. /etc/mail/virtusertable) may not only be a flat file (as it
is currently the case) but may also be a directory which contains a set
of files that comprise the map sources.

For example consider that the three files


contain virtusertables specific to the domains,,
and They now can be independently maintained, alleviating the
need to maintain a single, potentially large map source file.

The rather trivial patch below implements this, and also maintains
backward behaviour. (Note that /dev/null for the cat(1) command is
necessary; it catches the case of an empty directory.)



--- etc/mail/Makefile.ctm	2005-07-14 20:42:19.000000000 +0200
+++ etc/mail/Makefile	2007-11-11 19:16:20.000000000 +0100
@@ -144,8 +144,9 @@
 	sed -e 's/^/#/' < ${.OODATE} > ${.TARGET}
-${_f}.db: ${_f}
+_src!=		test -d ${_f} && find ${_f} -type f -print || echo ${_f}
+${_f}.db: ${_src}
+	cat ${.ALLSRC} /dev/null | ${MAKEMAP} ${SENDMAIL_MAP_TYPE} ${.TARGET}

More information about the freebsd-bugs mailing list