#!/bin/bash
# Copyright (c) 2011 SUSE LINUX Products AG
#
# Author: Peter Varkoly
# Please send feedback to http://www.suse.de/feedback/
#
# /etc/postfix/system/rebuild_tables
#

test -f /etc/sysconfig/postfix && . /etc/sysconfig/postfix

if [ -n "${POSTFIX_UPDATE_MAPS/[yY][Ee][Ss]/}" ]; then
    return
fi
# Update the postmaps
for i in $POSTFIX_MAP_LIST; do
    m=/etc/postfix/$i;
    d=$m.db
    test -e "$d" || continue;
    if [ -e $m -a $m -nt $d ]; then
        postmap $m;
    fi
done

