将邮件服务器换成 Postfix + pop-before-smtp *

故名思意,pop-before-smtp 就是在 smtp 前,先用 pop3 的帐号登入,以确保服务器上有你的帐号。以下的步骤,先将 Sendmail 换成 Postfix,再将 smtp 的认証则改用 pop-before-smtp 的方式。

安装 Postfix

  • 先移除 sendmail:
  • apt-get remove sendmail
  • 使用 apt 安装 postfix:
  • apt-get install postfix
  • 编辑 /etc/postfix/main.cf,搜寻之参数及修改方式如下:
  • myhostname  ->  host.example.com
    mydomain  ->  example.com
    myorigin  ->  $myhostname
    inet_interfaces  ->  all
    mydestination  ->  /etc/postfix/local-host-names
    mynetworks  ->  127.0.0.0/8, hash:/etc/postfix/access
    relay_domains  ->  $mydestination
    alias_maps  ->  hash:/etc/postfix/aliases
  • 设定本机收件时的领域名称,将领域名称新增到 /etc/postfix/local-host-names,每个名称占一行:
  • example.com
    mail.example.com
    host.example.com
  • 初始化相关数据库:
  • postmap hash:/etc/postfix/access
    postalias hash:/etc/postfix/aliases
  • 至此已完成 Postfix 的安装,直接启动 Postfix 即可:
  • service postfix start

    安装 pop-before-smtp

    顾名思义,pop-before-smtp 就是在寄信前,必须先用 pop3 检查邮件,只要 pop3 登入正确,你就可以用同一台服务器寄信 (30分钟内)。安装步骤如下:

  • 安装 Perl 的 File::Tail、Time::HiRes、Net::Netmask、Date::Parse 模组,建议使用 WebMin 安装,或执行下列指令:
  • perl -MCPAN -e 'install File::Tail'
    perl -MCPAN -e 'install Time::HiRes'
    perl -MCPAN -e 'install Net::Netmask'
    perl -MCPAN -e 'install Date::Parse'
  • 从本站下载 pop-before-smtp 的安装档至 /tmp,并执行安装:
  • cd /tmp
    wget http://www.vixual.net/download/source/postfix/pop-before-smtp-1.33-1.noarch.rpm
    rpm -ivh pop-before-smtp-1.33-1.noarch.rpm
  • 编辑 /etc/pop-before-smtp-conf.pl,将下列三行前的注解 # 拿掉:
  • #$file_tail{'name'} = '/var/log/maillog';
    #$grace = 30*60;
    #$dbfile = '/etc/postfix/pop-before-smtp';
  • 编辑 /etc/postfix/main.cf,在最后面加上:
  • smtpd_recipient_restrictions = permit_mynetworks,reject_non_fqdn_recipient,check_client_access hash:/etc/postfix/pop-before-smtp,check_relay_domains
  • 启动 pop-before-smtp,并重新加载 postfix:
  • service pop-before-smtp start
    service postfix reload
    1. No comments yet.

    1. No trackbacks yet.

    return top

    %d 位部落客按了赞: