我写了自己的分类电子邮件软件,现在我想把它和postfix连接起来。
要重定向邮件,只需更改master.cf文件中的这两个参数并在我的过滤器中添加一些代码到侦听端口10025就足够了吗?
# Before-filter SMTP server. Receive mail from the network and
# pass it to the content filter on localhost port 10025.
#
smtp inet n - n - 20 smtpd
-o smtpd_proxy_filter=127.0.0.1:10025 #CHANGE NR 1
-o smtpd_client_connection_count_limit=10
# Postfix 2.7 and later performance feature.
# -o smtpd_proxy_options=speed_adjust
#
# After-filter SMTP server. Receive mail from the content filter
# on localhost port 10026. #CHANGE NR 2
#
127.0.0.1:10026 inet n - n - - smtpd
-o smtpd_authorized_xforward_hosts=127.0.0.0/8 发布于 2021-06-27 22:48:05
是的,原则上它是这样工作的。不过,official postfix documentation中的代码片段更加复杂。
但是,您的邮件筛选器软件必须以Postfix期望的方式使用SMTP (参见也包括链接的文档)。例如,您必须流式传输消息(即代理它,因此得名),以防您想要接受它。
实现队列前过滤的另一种方法是使用postfix also supports的Milter protocol/API。
https://stackoverflow.com/questions/66815717
复制相似问题