免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1261 | 回复: 0
打印 上一主题 下一主题

Postfix+SMTP 密碼認證 [复制链接]

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-09 08:57 |只看该作者 |倒序浏览
Description :
好久沒上來 post 文章了,這幾天又學到了新東西 postfix+cyrus-sasl,也就是在 Mail Server 上將 SMTP 外送伺服器做密碼認證, 因為 ISP 通常會把自己的郵件伺服器 Mail Relay 關掉,以防止非自己 IP 群做轉寄郵件的動做,這樣 ISP 方能管制垃圾信問題,若是我們公司的人在外面,想使用 Outlook 寄一封信時,還得找到這家 ISP 的外送伺服器 SMTP,才可寄信 ,這對一個業務員來說太複雜了,光是台灣就有將近上百家 ISP,因此,將 Mail Server 的 SMTP 做密碼認證是有其必要的 ,業務員只要在 Outlook 裡,某個選項打個勾, 便可外寄郵件,你說這樣是不是很方便呢 ? Mail Server 的管理者,也可以確保 Mail Server 不被有心人做 Mail Relay 。
Environment :

  • 硬體:i386 PC Intel Pentium Pro 150
  • 記憶體:32M RAM
  • 作業系統:FreeBSD 4.2 Release
Setp 1.
首先安裝 pop3,目的是為讓 PC Client 端的使用者,可以將 Mail Server 上自己的 Mail 收到自己的電腦裡。
#cd /usr/ports/mail/qpopper
#make install
編輯 #vi /etc/inetd.conf 加入下面這行,重跑 inetd 的 pop3 110 port 便可以 Runing。
pop3 stream tcp nowait root /usr/local/libexec/qpopper popper -s
測試 :
#telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to nat.ntut.idv.tw.
Escape character is '^]'.
+OK Qpopper (version 4.0.4) at nat.ntut.idv.tw starting.
即可........
Setp 2.
使用 posts tree 安裝 postfix-current, 中間的 -DFORCE_PKG_REGISTER 這個參數目的是在於,如果已經有 postfix 存在的話, 我還是要 override 過去,就是可以強制安裝,用 ports tree 安裝任何軟體都適用。 開始安裝後會跳出視窗標題 ( Postfix configuration options ) 時,只要選擇 SASL 即可。
#cd /usr/ports/mail/postfix-current
#make -DFORCE_PKG_REGISTER all install clean
安裝 postfix-current 結束後,來設定 pwcheck 和 cryus-sasl ,為了讓 postfix 的 smtpd 可以 access 到 /var/pwcheck/pwcheck ,我們必須修改/etc/group,讓 postfix 這個 user 成為 cyrus 這個帳號的同一個 group #vi /etc/group
cyrus:*:60:daemon,postfix
接下來新增 smtpd.conf 這個檔 #vi /usr/local/lib/sasl/smtpd.conf 內容如下:
pwcheck_method: pwcheck
Setp 3.
#vi /usr/local/etc/postfix/main.cf     修改 mail.conf  修改的內容如下:
myhostname = nat.ntut.idv.twmydomain = nat.ntut.idv.twalias_maps = hash:/usr/local/etc/postfix/aliasessmtpd_recipient_restrictions =
        permit_sasl_authenticated,
        permit_mynetworks,
        check_relay_domains,        reject_non_fqdn_sender,
        reject_unknown_sender_domain,
        reject_unknown_recipient_domain,
        reject_unlisted_sender,
smtpd_client_restrictions =         cidr:/usr/local/etc/postfix/client.cidr
        reject_rbl_client bl.spamcop.net
        reject_rbl_client relays.ordb.org
        reject_rbl_client sbl.spamhaus.org
smtpd_sasl_auth_enable= yes smtpd_sasl_security_options= noanonymous smtpd_sasl_local_domain = nat.ntut.idv.tw
Setp 4.
#/usr/local/etc/rc.d/cyrus_pwcheck.sh start         #  將 pwcheck 跑起來
#vi /usr/local/etc/postfix/client.cidr        #  拒絕無法過濾爛發垃圾信的 IP 網段
# Sapm IP Groups
220.163.0.0/16  DISCARD  spam
218.62.0.0/16    DISCARD  spam
218.63.0.0/16    DISCARD  spam
61.159.0.0/16    DISCARD  spam
#postmap -q - cidr:/usr/local/etc/postfix/client.cidr
#/usr/local/sbin/postfix stop
#/usr/local/sbin/postfix start
PC 寄信端設定:
設定 Windows Outlook:在 Outlook 建立完信箱後,選 設定→帳號 →郵件,進入剛建立的信箱選伺服器,勾選我的伺服器需要驗證即可。
設定 Mozila Thunderbird:在 Thunderbird 建立完信箱後,選 工具→帳號設定 →SMTP外寄郵件伺服器 →使用安全連線:勾選 TLS 即可。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4206/showart_522917.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP