X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fpostfix.sh;h=5a2a0b8495b3d2db95dd1770a3b9f0d428c0e0fb;hb=3e2fe4efa8e02d92b12a7c0f8a3c62c4f35d832e;hp=7aa396136d6e75544bd6d7d98bbb328e28463144;hpb=1a6944c221294202ee0b5e89c2d9f4dc6fdbcc5e;p=amavisd-cn.git diff --git a/src/postfix.sh b/src/postfix.sh old mode 100755 new mode 100644 index 7aa3961..5a2a0b8 --- a/src/postfix.sh +++ b/src/postfix.sh @@ -1,18 +1,26 @@ update_postfix() { # set up master.cf - if [ -f /etc/postfix/master.cf ] && \ - ( ! grep -q smtp-amavis /etc/postfix/master.cf || \ - dpkg --compare-versions "$2" lt $MASTTMPLVERSION ); then - noisy_backup /etc/postfix/master.cf - cp-update $PKG /etc/postfix/master.cf < $MASTTMPL - restart_mta=1 + if [ -f /etc/postfix/master.cf ]; then + if ( ! grep -q smtp-amavis /etc/postfix/master.cf || \ + dpkg --compare-versions "$2" lt $MASTTMPLVERSION ); then + noisy_backup /etc/postfix/master.cf + cp-update $PKG /etc/postfix/master.cf < $MASTTMPL + restart_mta=1 + fi + else + echo "CN: Missing Postfix master.cf, please configure Postfix and restart installation." + exit 1 fi - # main.cf - if [ ! -f /etc/postfix/main.cf ] || \ - ! grep -q "smtp-amavis:[127.0.0.1]:10024" \ + # set up main.cf + if [ -f /etc/postfix/main.cf ]; then + if ! grep -q "^content_filter[\t ]*=[\t ]*smtp-amavis:\[127.0.0.1\]:10024[\t ]*" \ /etc/postfix/main.cf; then - postconf -e content_filter="smtp-amavis:[127.0.0.1]:10024" - restart_mta=1 + postconf -e content_filter="smtp-amavis:[127.0.0.1]:10024" + restart_mta=1 + fi + else + echo "CN: Missing Postfix main.cf, please configure Postfix and restart installation." + exit 1 fi }