相关疑难解决方法(0)

如何配置 postfix 以将所有传入电子邮件通过管道传输到脚本?

使用 postfix,我希望将所有传入邮件发送到任何地址(包括那些未映射到本地用户的地址)通过管道传输到脚本。我试过配置mailbox_command/etc/postfix/main.cf

mailbox_command = /path/to/myscript.py
Run Code Online (Sandbox Code Playgroud)

如果用户是本地用户,这很有效,但对于没有别名的“未知”用户则失败。我尝试设置luser_relay为本地用户,但这会抢占mailbox_command,因此该命令不会运行。我尝试设置local_recipient_maps=(空字符串),但消息仍然被退回(未知用户)。

是否有我可以使用的魔术调用来让所有已知和未知用户也转到脚本?

完整/etc/postfix/main.cf如下——它是默认的 Ubuntu 10.04,除了以下mailbox_command行:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job. …
Run Code Online (Sandbox Code Playgroud)

scripting postfix

28
推荐指数
2
解决办法
5万
查看次数

标签 统计

postfix ×1

scripting ×1