# maintained by Allblue SA, Kubic Labs (IT Department) - Switzerland
# for copyright infos see /usr/share/doc/kusa/COPYRIGHT
#
SHELL	= /bin/bash
DBFILES	= virtual.db aliases.db transport.db sasl_passwd.db \
	  access_client.db access_helo.db access_sender.db \
	  access_recipient.db access_relay.db

_lastmake: $(DBFILES) *.cf *.sh Makefile *_checks
	/etc/init.d/postfix reload
	touch _lastmake

virtual.db:	virtual
		postmap /etc/postfix/virtual

aliases.db:	aliases
		postalias /etc/postfix/aliases

transport.db:	transport
		postmap /etc/postfix/transport

sasl_passwd.db:	sasl_passwd
		postmap /etc/postfix/sasl_passwd

access_client.db: access_client
		postmap /etc/postfix/access_client

access_helo.db:	access_helo
		postmap /etc/postfix/access_helo

access_sender.db: access_sender
		postmap /etc/postfix/access_sender

access_recipient.db: access_recipient
		postmap /etc/postfix/access_recipient

access_relay.db: access_relay
		postmap /etc/postfix/access_relay


# virtual, created by a shell script
#
virtual:	virtual.d/* virtual-rebuild.sh
		rm -f virtual.bad virtual.new
		./virtual-rebuild.sh > virtual.new
		[ -f virtual ] && mv virtual virtual.old || :
		mv virtual.new virtual

