郵件服務器 Postfix+ Cyrus-SASL+cyrus-IMAPD+日常維護

一,安裝Postfix
postfix-2.6.5.tar.gz
postfix-2.6.5-vda-ng.patch.gz
二,rpm包安裝Cyrus-SASL+cyrus-IMAPD
三,Postfix基本配置
[root@Postfix ~]# cat /etc/postfix/main.cf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = localhost, localhost.$mydomain, $myhostname, $mydomain
mydomain = example.com
myhostname = example.com
mynetworks = 111.111.111.111/28 , 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
relay_domains = example.com,163.com,gmail.com,qq.com,yahoo.com.cn,126.com,hotmail.com,sina.com,sohu.com,tom.com,yahoo.com,189.com,baidu.com,qq163.com
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
smtpd_client_connection_count_limit = 1024
smtpd_client_connection_rate_limit = 5
#Cyrus-SASL
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination,  reject_invalid_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
#Cyrus-imapd
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
readme_directory = no
sample_directory = /etc/postfix
#data_directory = /var/lib/postfix
四,用戶郵箱管理
[root@Postfix ~]# cyradm -u cyrus localhost
IMAP Password:
localhost.localdomain> cm user.test
localhost.localdomain> cm user.test.Send
localhost.localdomain> cm user.test.Trash
localhost.localdomain> cm user.test.Drafts
localhost.localdomain> sq  user.test 51200 //(kb,50M)
設置配額:
quota:51200
五,開機自動啓動

六,郵箱日常維護
新建郵箱設置
1,建賬戶
[root@images ~]# useradd -g postfix -M -s /sbin/nologin test
[root@images ~]# passwd test
2,建郵箱
[root@images ~]# cyradm -u cyrus localhost
IMAP Password:
localhost.localdomain> cm user.test
localhost.localdomain> cm user.test.Send
localhost.localdomain> cm user.test.Trash
localhost.localdomain> cm user.test.Drafts
localhost.localdomain> sq user.test 51200
quota:51200
3,刪郵箱
[root@images ~]# cyradm -u cyrus localhost
IMAP Password:  
localhost.localdomain> dm user.test
deletemailbox: Permission denied
localhost.localdomain> setacl user.test cyrus all
localhost.localdomain> dm user.test
4,刪賬戶
[root@images ~]userdel test
5,管理
看郵箱列表
[root@images user]# postqueue -p            
(host mail.example.com[/var/lib/imap/socket/lmtp] said: 452 4.2.2 Over quota (in reply to RCPT TO command))
                                         [email protected]
解決郵箱超出
[root@images user]# cyradm -u cyrus localhost
IMAP Password:
localhost.localdomain> lq user.test
 STORAGE 53508/51200 (104.5078125%)
localhost.localdomain> sq user.test 102400
quot: command not found
localhost.localdomain> lq user.test
 STORAGE 53508/102400 (52.25390625%)
localhost.localdomain> quit
手動重新發送
[root@images user]# postqueue -f
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章