|
|

楼主 |
发表于 2004-12-21 21:40:10
|
显示全部楼层
http://www.gentoo.org.tw/got-doc/postfix.xml
- # nano -w /etc/make.conf
- USE=" " 參數當中至少要有 sasl mbox 或者 maildir
- mbox 跟 maildir 是郵件儲存格式 這兩種最大的不同是
- Maildir 是單封郵件儲存成為一個獨立的檔案
- Mbox 是所有郵件儲存成為一個檔案
- 所以我們不能在 USE 參數當中同時出現這兩個參數,就是這個道理
- (依照使用者習慣選擇適當的格式)
- # emerge postfix
- # nano -w /etc/postfix/main.cf
- 然後編輯 Postfix的設定檔案
- alias_database = hash:/etc/mail/aliases
- alias_maps = hash:/etc/mail/aliases
- command_directory = /usr/sbin
- config_directory = /etc/postfix
- daemon_directory = /usr/lib/postfix
- debug_peer_level = 2
- default_destination_concurrency_limit = 2
- inet_interfaces = all
- local_destination_concurrency_limit = 2
- mail_owner = postfix
- mail_spool_directory = /var/spool/mail
- 設定信箱存取路?
- mailbox_size_limit = 52428800
- 信箱大小筆者這邊設定50MB
- mailq_path = /usr/bin/mailq
- manpage_directory = /usr/share/man
- message_size_limit = 10485760
- 單封郵件限制筆者這邊設定10MB
- mydestination = $myhostname, localhost.$mydomain $mydomain
- 接收者的網域或者主機名稱
- mydomain = focuses.org
- 設定網域名稱
- myhostname = mail.focuses.org
- 設定 MAIL 主機名稱,這邊必須與 BIND 所設定的 MX 名稱互相對應
- mynetworks_style = subnet
- myorigin = $myhostname
- newaliases_path = /usr/bin/newaliases
- queue_directory = /var/spool/postfix
- readme_directory = /usr/share/doc/postfix-2.0.16-r1/readme
- relay_domains = focuses.org
- 接受 Relay 的網域主機
- sample_directory = /usr/share/doc/postfix-2.0.16-r1/sample
- sendmail_path = /usr/sbin/sendmail
- setgid_group = postdrop
- unknown_local_recipient_reject_code = 450
- smtpd_client_restrictions = permit_sasl_authenticated
- Client 端的限制規則 限制未經信任的 Client 登入就要啟動 sasl
- 機制
- smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
- SMTPD 收件的限制規則
- permit_mynetworks:在 mynetworks 這個項目設定的網域 IP 都可以被允許收信
- permit_authenticated:允許使用者經過 SASL 的認證方式寄信
- reject_unauth_destination:測試過後的主機可以進行 relay ,跟上面設定的
- relay_domains 有關連
- 告訴 SMTP 客戶,該 SMTP 服務器需要進行用戶認證
- smtpd_sasl_local_domain =
- 確認已經經過認證的網域,目前預設是上述設定之 $myhostname
- 不需要經過認證
- smtpd_sasl_security_options = noanonymous
- 控制本地SMTP認證所採用的機制,這裡是取消匿名認證方法。
- 存檔離開
- # /etc/init.d/postfix restart
复制代码 |
|