diff options
Diffstat (limited to 'meta-networking/recipes-daemons/postfix/files/aliasesdb')
-rwxr-xr-x | meta-networking/recipes-daemons/postfix/files/aliasesdb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/postfix/files/aliasesdb b/meta-networking/recipes-daemons/postfix/files/aliasesdb new file mode 100755 index 0000000000..855a64f705 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/aliasesdb @@ -0,0 +1,20 @@ +#!/bin/sh + +ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp + +make_aliasesdb() { + if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ] + then + # /etc/aliases.db may be used by other MTA, make sure nothing + # has touched it since our last newaliases call + [ /etc/aliases -nt /etc/aliases.db ] || + [ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] || + [ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0 + /usr/bin/newaliases + touch -r /etc/aliases.db "$ALIASESDB_STAMP" + else + /usr/bin/newaliases + fi +} + +make_aliasesdb |