佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 5207|回复: 4

Perdition + Postfix...简单的 POP3 Proxy 邮件服务器

[复制链接]
发表于 12-6-2012 02:31 PM | 显示全部楼层 |阅读模式
本帖最后由 hata_ph 于 12-6-2012 02:54 PM 编辑

今天在 centos 6 里安装 perdition + postfix 来做一个简单的 POP3 Proxy 邮件服务器

把下面的腳本保存為 home_horms_perdition.repo 到 /etc/yum.repos.d

  1. [home_horms_perdition]
  2. name=Perdition: Mail Retrieval Proxy (CentOS_CentOS-6)
  3. type=rpm-md
  4. baseurl=http://download.opensuse.org/repositories/home:/horms:/perdition/CentOS_CentOS-6/
  5. gpgcheck=1
  6. gpgkey=http://download.opensuse.org/repositories/home:/horms:/perdition/CentOS_CentOS-6/repodata/repomd.xml.key
  7. enabled=1
复制代码


通過 yum 安裝的 perdition
  1. yum install perdition
复制代码


編輯/ etc / sysconfig/perdition(只使用POP3服務)
  1. RUN_PERDITION=yes
  2. POP3=yes #ou yes
  3. POP3S=no #ou yes
  4. IMAP4=no #ou yes
  5. IMAP4S=no #ou no
复制代码


把 /etc/perdition/ perdition.conf

做一個副本
,並命名它為perdition.pop3.conf
  1. cp /etc/perdition/perdition.conf /etc/perdition/perdition.pop3.conf
复制代码


編輯
/etc/perdition/perdition.pop3.conf

  1. outgoing_server $ SERVER $ #use hostname or IP
  2. protocol pop3
  3. listen_port 110
  4. outgoing_port 110
  5. debug # optional for debuging
  6. connection_logging # optional for debugging
复制代码

评分

参与人数 1积分 +100 收起 理由
新力爱力新 + 100 原创内容

查看全部评分

回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 12-6-2012 02:34 PM | 显示全部楼层
安装 postfix
  1. yum install postfix
复制代码


编辑 /etc/postfix /main.cf 文件
  1. # Set this to your server's fully qualified domain name.
  2. # If you don't have a internet domain name,
  3. # use the default or your email addy's domain - it'll keep
  4. # postfix from generating warnings all the time in the logs
  5. mydomain = local.domain
  6. myhostname = host.local.domain
  7. inet_interfaces = all

  8. # Set this to your email provider's smtp server.
  9. # A lot of ISP's (ie. Cox) block the default port 25
  10. # for home users to prevent spamming.  So we'll use port 80
  11. relayhost = $smtp_relay_server$

  12. smtpd_sasl_path = smtpd
  13. smtp_sasl_type = cyrus
复制代码


禁用防火墙
  1. chkconfig iptables off
  2. chkconfig ip6tables off
复制代码
回复

使用道具 举报

 楼主| 发表于 12-6-2012 02:42 PM | 显示全部楼层
按照以下设置,如果您的SMTP中继服务器需要身份验证。

安装 cyrus-sasl-plain
  1. yum install cyrus-sasl-plain
复制代码


编辑的 /etc/postfix / main.cf 文件
  1. # Set this to your server's fully qualified domain name.
  2. # If you don't have a internet domain name,
  3. # use the default or your email addy's domain - it'll keep
  4. # postfix from generating warnings all the time in the logs
  5. mydomain = local.domain
  6. myhostname = host.local.domain
  7. inet_interfaces = all

  8. # Set this to your email provider's smtp server.
  9. # A lot of ISP's (ie. Cox) block the default port 25
  10. # for home users to prevent spamming.  So we'll use port 80
  11. relayhost = yourisp.smtp.servername:80

  12. smtpd_sasl_auth_enable = yes
  13. smtpd_sasl_path = smtpd
  14. smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
  15. smtp_sasl_type = cyrus
  16. smtp_sasl_auth_enable = yes

  17. # optional: necessary if email provider uses load balancing and
  18. # forwards emails to another smtp server
  19. # for delivery (ie: smtp.yahoo.com --> smtp.phx.1.yahoo.com)
  20. smtp_cname_overrides_servername = no

  21. # optional: necessary if email provider
  22. # requires passwords sent in clear text
  23. smtp_sasl_security_options = noanonymous
复制代码


添加以下行到  /etc/postfix/sasl_passwd
  1. yourisp.smtp.servername:80 username:password
复制代码


把 sasl_passwd
生成一个后缀查找表
  1. postmap hash:/etc/postfix/sasl_passwd
复制代码


测试查找表,如果一切都很好,那么下面将返回指定的用 username:password
  1. postmap -q yourisp.smtp.servername:80 /etc/postfix/sasl_passwd
复制代码


确保的 sasl_passwd 和 sasl_passwd.db 文件只有 root 可读/写
  1. chmod 600 /etc/postfix/sasl_passwd
  2. chmod 600 /etc/postfix/sasl_passwd.db
复制代码


用 sendmail 测试它

  1. sendmail email@example.com
  2. Postfix is good to go.
  3. .
复制代码
回复

使用道具 举报

 楼主| 发表于 12-6-2012 02:45 PM | 显示全部楼层
可选:启用防火墙
  1. chkconfig iptables on
复制代码


编辑 /etc/sysconfig/iptables, 允许 pop3/pop3s 和 SMTP/SMTPS 端口
  1. # smtp/smtp3
  2. -A INPUT –p tcp –m multiport –-dport 25,465 –j ACCEPT
  3. # pop3/pop3s
  4. -A INPUT –p tcp –m multiport –-dport 110,995 –j ACCEPT
复制代码
回复

使用道具 举报

发表于 12-6-2012 04:54 PM | 显示全部楼层
谢谢分享。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 19-4-2024 07:04 AM , Processed in 0.065066 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表