瀏覽代碼

[Postfix] Add null rcpt for watchdog

andryyy 8 年之前
父節點
當前提交
4d7bb26874
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      data/Dockerfiles/postfix/postfix.sh

+ 4 - 0
data/Dockerfiles/postfix/postfix.sh

@@ -3,6 +3,10 @@
 trap "postfix stop" EXIT
 
 [[ ! -d /opt/postfix/conf/sql/ ]] && mkdir -p /opt/postfix/conf/sql/
+if [[ -z $(grep null /etc/aliases) ]]; then
+	echo null: /dev/null >> /etc/aliases;
+	newaliases;
+fi
 
 cat <<EOF > /opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
 user = ${DBUSER}