|
Postfix+SMTP 密碼認證
发表日期:2006-12-3
|
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.tw mydomain = nat.ntut.idv.tw alias_maps = hash:/usr/local/etc/postfix/aliases
smtpd_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/etc/postfix/client.cidr #/usr/local/sbin/postfix stop #/usr/local/sbin/postfix start
PC 寄信端設定:
設定 Windows Outlook:在 Outlook 建立完信箱後,選 設定→帳號 →郵件,進入剛建立的信箱選伺服器,勾選我的伺服器需要驗證即可。
設定 Mozila Thunderbird:在 Thunderbird 建立完信箱後,選 工具→帳號設定 →SMTP外寄郵件伺服器 →使用安全連線:勾選 TLS 即可。
|
|
上一篇:Postfix + Amavisd-new + SpamAssassin + ClamAV
人气:3100
下一篇:Postfix+ClamAV+Amavisd-new
人气:3063 |
浏览全部Qmail/Sendmail/Postf的内容
Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐
|
|