Linux 队列内容筛选器之后的后缀不存在';行不通
我在postfix master.cf中添加了以下行Linux 队列内容筛选器之后的后缀不存在';行不通,linux,bash,ubuntu,mail-server,postfix,Linux,Bash,Ubuntu,Mail Server,Postfix,我在postfix master.cf中添加了以下行 filter unix - n n - 10 pipe flags=Rq user=filter null_sender= argv=/tmp/filter.sh -f ${sender} -- ${recipient} 我的测试脚本filter.sh代码如下所示: #!/bin/sh SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here. export
filter unix - n n - 10 pipe flags=Rq user=filter null_sender= argv=/tmp/filter.sh -f ${sender} -- ${recipient}
我的测试脚本filter.sh代码如下所示:
#!/bin/sh
SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here.
export HOME=/home/filter
SENDER="$2" #sender
shift
shift
shift
EMPFAENGER="$@" #empfaenger
#echo "SENDER=$SENDER" >> /tmp/logging.log
#echo "EMPFAE=$EMPFAENGER" >> /tmp/logging.log
touch itworked
cat | $SENDMAIL -f $SENDER -- $EMPFAENGER
当我发送电子邮件时,它将被发送,但我认为它不是通过脚本传输的
有人知道我配置错了什么吗
附言:
- 用户“筛选器”存在,并且他拥有脚本的所有权限
- Ubuntu 16.04.1
- 已安装的最新Mailcow仅在本地使用
克里斯,你错过了一步。在配置文件
master.cf
中,第一个服务是:
smtp inet n - - - - smtpd
你必须告诉postfix
你想使用你的过滤器,所以:
smtp inet n - - - - smtpd -o content_filter=filter
编辑此文件后,不要忘记执行postfix-reload