sendmail access file and cidrexpand

Warren Block wblock at wonkity.com
Sat Jun 5 15:58:49 PDT 2004


Adding cidrexpand support to the /etc/mail/Makefile would be handy; then 
we could use CIDR notation in /etc/mail/access.  I've edited the 
/etc/mail/Makefile (patch attached), and it seems to work.

The question would be: have I done this in an appropriate way?

Feedback would be appreciated before I submit a send-pr.

-Warren Block * Rapid City, South Dakota USA
-------------- next part --------------
--- Makefile.bak	Sat Jun  5 15:32:45 2004
+++ Makefile	Sat Jun  5 16:17:58 2004
@@ -109,6 +109,7 @@
 SENDMAIL?=		/usr/sbin/sendmail
 MAKEMAP?=		/usr/sbin/makemap
 M4?=			/usr/bin/m4
+CIDREXPAND?=		/usr/src/contrib/sendmail/contrib/cidrexpand
 
 # Permissions for generated maps
 SENDMAIL_MAP_PERMS?=	0640
@@ -125,11 +126,11 @@
 # type to use when calling makemap.
 #
 SENDMAIL_MAP_SRC+=	mailertable domaintable bitdomain uucpdomain \
-			genericstable virtusertable access
+			genericstable virtusertable
 SENDMAIL_MAP_OBJ=
 SENDMAIL_MAP_TYPE?=	hash
 
-.for _f in ${SENDMAIL_MAP_SRC} userdb
+.for _f in ${SENDMAIL_MAP_SRC} access userdb
 .if exists(${_f})
 SENDMAIL_MAP_OBJ+=	${_f}.db
 .endif
@@ -148,6 +149,10 @@
 	${MAKEMAP} ${SENDMAIL_MAP_TYPE} ${.TARGET} < ${.OODATE}
 	chmod ${SENDMAIL_MAP_PERMS} ${.TARGET}
 .endfor
+
+access.db: access
+	${CIDREXPAND} < ${.OODATE} | ${MAKEMAP} -r ${SENDMAIL_MAP_TYPE} ${.TARGET}
+	chmod ${SENDMAIL_MAP_PERMS} ${.TARGET}
 
 userdb.db: userdb
 	${MAKEMAP} btree ${.TARGET} < ${.OODATE}


More information about the freebsd-questions mailing list