Stan Hoeppner a écrit :
> [snip]
>
> Thanks for the hints Noel. I may need them down the road, although not
> at the moment. Though I am curious and may play around with Makefile
> just to learn something.
>
you can use a script if you prefer. the advantage of 'make' is that it
only re-generates files when needed (source change).
for your country maps and assuming gnu make, your Makefile would contain
something like this:
#---------------
#directpry where we store our cidr maps
CIDR_DIR=/etc/postfix/cidr_files
#file to generate
COUNTRIES_DEST=${CIDR_DIR}/countries
#"source" files, withput directory nor suffix.
COUNTRIES += china
COUNTRIES += korea
COUNTRIES += russia
...
#non portable commands. gnu make assumed.
CIDR_COUNTRIES=$(addsuffix .cidr, ${COUNTRIES})
COUNTRY_MAPS=$(addprefix ${CIDR_DIR}/, ${CIDR_COUNTRIES})
${COUNTRIES_DEST}: ${COUNTRY_MAPS}
cat $^ > $@
...
#-------------
this will catenate all your china.cidr, korea.cidr, ... into "countries"
which you can then use with
check_client_access cidr:/etc/postfix/cidr_files/countries
PS. since you use a cidr specific directory, you can get rid of the
".cidr" suffix. you could then use (in main.cf):
cidr=cidr:/etc/postfix/cidr_files
smtpd_foo_restrictions =
...
check_client_access ${cidr}/access_foo
...
check_client_access ${cidr}/access_bar