一,安装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@p_w_picpaths ~]# useradd -g postfix -M -s /sbin/nologin test
[root@p_w_picpaths ~]# passwd test
2,建邮箱
[root@p_w_picpaths ~]# 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@p_w_picpaths ~]# 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@p_w_picpaths ~]userdel test
5,管理
看邮箱列表
[root@p_w_picpaths 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@p_w_picpaths 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@p_w_picpaths user]# postqueue -f