查看: 5207|回复: 4
|
Perdition + Postfix...简单的 POP3 Proxy 邮件服务器
[复制链接]
|
|
本帖最后由 hata_ph 于 12-6-2012 02:54 PM 编辑
今天在 centos 6 里安装 perdition + postfix 来做一个简单的 POP3 Proxy 邮件服务器
把下面的腳本保存為 home_horms_perdition.repo 到 /etc/yum.repos.d
- [home_horms_perdition]
- name=Perdition: Mail Retrieval Proxy (CentOS_CentOS-6)
- type=rpm-md
- baseurl=http://download.opensuse.org/repositories/home:/horms:/perdition/CentOS_CentOS-6/
- gpgcheck=1
- gpgkey=http://download.opensuse.org/repositories/home:/horms:/perdition/CentOS_CentOS-6/repodata/repomd.xml.key
- enabled=1
复制代码
通過 yum 安裝的 perdition
編輯/ etc / sysconfig/perdition(只使用POP3服務)
- RUN_PERDITION=yes
- POP3=yes #ou yes
- POP3S=no #ou yes
- IMAP4=no #ou yes
- IMAP4S=no #ou no
复制代码
把 /etc/perdition/ perdition.conf
做一個副本
,並命名它為perdition.pop3.conf
- cp /etc/perdition/perdition.conf /etc/perdition/perdition.pop3.conf
复制代码
編輯
/etc/perdition/perdition.pop3.conf
- outgoing_server $ SERVER $ #use hostname or IP
- protocol pop3
- listen_port 110
- outgoing_port 110
- debug # optional for debuging
- connection_logging # optional for debugging
复制代码 |
评分
-
查看全部评分
|
|
|
|
|
|
|
楼主 |
发表于 12-6-2012 02:34 PM
|
显示全部楼层
安装 postfix
编辑 /etc/postfix /main.cf 文件
- # Set this to your server's fully qualified domain name.
- # If you don't have a internet domain name,
- # use the default or your email addy's domain - it'll keep
- # postfix from generating warnings all the time in the logs
- mydomain = local.domain
- myhostname = host.local.domain
- inet_interfaces = all
-
- # Set this to your email provider's smtp server.
- # A lot of ISP's (ie. Cox) block the default port 25
- # for home users to prevent spamming. So we'll use port 80
- relayhost = $smtp_relay_server$
-
- smtpd_sasl_path = smtpd
- smtp_sasl_type = cyrus
复制代码
禁用防火墙
- chkconfig iptables off
- chkconfig ip6tables off
复制代码 |
|
|
|
|
|
|
|
楼主 |
发表于 12-6-2012 02:42 PM
|
显示全部楼层
按照以下设置,如果您的SMTP中继服务器需要身份验证。
安装 cyrus-sasl-plain
- yum install cyrus-sasl-plain
复制代码
编辑的 /etc/postfix / main.cf 文件
- # Set this to your server's fully qualified domain name.
- # If you don't have a internet domain name,
- # use the default or your email addy's domain - it'll keep
- # postfix from generating warnings all the time in the logs
- mydomain = local.domain
- myhostname = host.local.domain
- inet_interfaces = all
-
- # Set this to your email provider's smtp server.
- # A lot of ISP's (ie. Cox) block the default port 25
- # for home users to prevent spamming. So we'll use port 80
- relayhost = yourisp.smtp.servername:80
-
- smtpd_sasl_auth_enable = yes
- smtpd_sasl_path = smtpd
- smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
- smtp_sasl_type = cyrus
- smtp_sasl_auth_enable = yes
-
- # optional: necessary if email provider uses load balancing and
- # forwards emails to another smtp server
- # for delivery (ie: smtp.yahoo.com --> smtp.phx.1.yahoo.com)
- smtp_cname_overrides_servername = no
-
- # optional: necessary if email provider
- # requires passwords sent in clear text
- smtp_sasl_security_options = noanonymous
复制代码
添加以下行到 /etc/postfix/sasl_passwd
- yourisp.smtp.servername:80 username:password
复制代码
把 sasl_passwd
生成一个后缀查找表
- postmap hash:/etc/postfix/sasl_passwd
复制代码
测试查找表,如果一切都很好,那么下面将返回指定的用 username:password
- postmap -q yourisp.smtp.servername:80 /etc/postfix/sasl_passwd
复制代码
确保的 sasl_passwd 和 sasl_passwd.db 文件只有 root 可读/写
- chmod 600 /etc/postfix/sasl_passwd
- chmod 600 /etc/postfix/sasl_passwd.db
复制代码
用 sendmail 测试它
- sendmail email@example.com
- Postfix is good to go.
- .
复制代码 |
|
|
|
|
|
|
|
楼主 |
发表于 12-6-2012 02:45 PM
|
显示全部楼层
可选:启用防火墙
编辑 /etc/sysconfig/iptables, 允许 pop3/pop3s 和 SMTP/SMTPS 端口
- # smtp/smtp3
- -A INPUT –p tcp –m multiport –-dport 25,465 –j ACCEPT
- # pop3/pop3s
- -A INPUT –p tcp –m multiport –-dport 110,995 –j ACCEPT
复制代码 |
|
|
|
|
|
|
|
发表于 12-6-2012 04:54 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|