【问题标题】:Postfix After-Queue Content Filter doesn't workPostfix 队列后内容过滤器不起作用
【发布时间】:2017-03-14 18:49:20
【问题描述】:

我在后缀 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 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

当我发送电子邮件时,它会送达,但我没有通过脚本传输。

有人知道我配置错了吗?

PS:

  • 用户“filter”存在并且他拥有脚本的所有权限。
  • Ubuntu 16.04.1
  • 安装最新的 Mailcow 只能在本地使用

问候 克里斯

【问题讨论】:

    标签: linux bash ubuntu mail-server postfix


    【解决方案1】:

    你少了一步。在你的配置文件master.cf中,第一个服务是:

    smtp      inet  n       -       -       -       -       smtpd 
    

    你必须告诉postfix你想使用你的filter,所以:

    smtp      inet  n       -       -       -       -       smtpd -o content_filter=filter
    

    编辑这个文件后不要忘记执行postfix reload

    【讨论】:

      猜你喜欢
      • 2012-10-22
      • 2017-03-09
      • 1970-01-01
      • 2021-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多