• postfix部署多个Content Filter的方法


    Postfix邮件服务器可以在接收邮件时使用content_filter来扫描邮件(病毒,广告等).通过整合一个集中化的电子邮件内容过滤器,比如amavis或mailscanner,Postfix可以利用单次调用来进行多个扫描.这非常好,但是有些过滤器很难或者几乎不可能整合到一个集中化的过滤器中.这是一个问题,尤其是你的Postfix系统已经安装了某些集中化的content_filter.我们能解决这个问题吗,当然可以.这个文档将给出许多可能的解决方案中的一种.你的步骤可能不一样,根据你的配置而定.

          在案例中,我们假设我们需要一个运行Postfix,Amavis(包含各种插件)和Avira MailGate的邮件系统.Postfix已经配置为使用Amavis系统作为content_filter.MailGate 不能通过Amavis进行整合,因此它要使用一个单独的content_filter.

    Amavis配置:Amavis监听10026端口,然后通过10027端口进行转发.

     代码如下 复制代码
    $inet_socket_port = 10026;
    forward_method => 'smtp:[127.0.0.1]:10027';
     

    MailGate配置:MailGate监听20024端口,然后通过20025端口进行转发.

     代码如下 复制代码
    ListenAddress localhost port 20024
    ForwardTo SMTP: localhost port 20025
     

    Postfix需要配置两个过滤器.
    这可以通过串接过滤器:进入的邮件首先提交到Postfix Content_filter,(www.111cn.net然后Content_filter将扫描后的邮件传给Postfix.扫描后的邮件再传给第二个Content_filter.最后再送到用户手中.我们的链是这样的:Postfix > MailGate > Postfix > Amavisd-new >

    更多详细内容请查看:http://www.111cn.net/sys/linux/56556.htm

    Postfix > User
    main.cf:

    content_filter = smtp:127.0.0.1:20024
    master.cf

    localhost:20025 inet n - n - - smtpd
    -o content_filter=smtp:127.0.0.1:10026
    127.0.0.1:10027 inet n - n - - smtpd
    -o content_filter= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject
    -o smtpd_helo_restrictions= -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o smtpd_data_restrictions=reject_unauth_pipelining
    -o smtpd_end_of_data_restrictions=
    -o smtpd_restriction_classes=
    -o mynetworks=127.0.0.0/8
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
    -o smtpd_client_connection_count_limit=0
    -o smtpd_client_connection_rate_limit=0
    -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters
    -o local_header_rewrite_clients=
     

    就这样,Postfix提交所有进来的邮件到20024端口的MailGate,MailGate再将扫描的结果传回到20025的Postfix.Postfix在20025端口运行着一个额外的SMTP服务,这个服务也包含了一个content_filter,因此所有到达20025端口的邮件会再传给10026端口.Amavis监听着10026端口,因此邮件将被Aamavis扫描.扫描完成后Amavis将邮件传送到10027端口.而在10027端口上运行着另外一个Postfix提供的SMTP服务,至此邮件到达链的终点,邮件将被邮递给用户.如果你需要关于这个话题的更多信息,请发邮件至robin.diederen@gmail.com.111cn.net

    另外一个配置样例可能如下:


     代码如下 复制代码
    In main.cf:

    # send email to amavisd
    content_filter = amavisd:[127.0.0.1]:10024
    In master.cf:

    # amavisd
    amavisd unix - - n - 2 lmtp
    -o lmtp_data_done_timeout=1200s
    -o disable_dns_lookups=yes

    # receive email from amavisd
    # and then send email to altermine
    127.0.0.1:10025 inet n - n - - smtpd
    -o content_filter=altermine

    # receive email from 127.0.0.1:10025
    altermine unix - - n - 2 pipe
    ...

    # receive email from altermine
    127.0.0.1:20025 inet n - n - - smtpd
    -o content_filter=
    -o ...
     

    整个流程为: postfix -> amavisd:[127.0.0.1]:10024 -> postfix -> altermine -> postfix -> user

  • 相关阅读:
    泛型
    HTTP和HTTPS
    计算机网络(三)应用层
    练习38-操作列表
    第27讲:集合—在我的世界里,你就是唯一
    第25~26讲:字典:当索引不好用时
    第1~2讲:数据结构和算法绪论
    第23~24讲:这帮小兔崽子(斐波那契数列)和汉诺塔游戏
    练习36--设计和调试
    001-定义电子日历类
  • 原文地址:https://www.cnblogs.com/alibai/p/3513110.html
Copyright © 2020-2023  润新知