您的位置:首页 > 运维架构

邮件服务器 Postfix+ Cyrus-SASL+cyrus-IMAPD+日常维护

2011-12-06 19:52 701 查看
一,安装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))
test@example.com
解决邮箱超出
[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
本文出自 “jerrymin” 博客,请务必保留此出处http://jerrymin.blog.51cto.com/3002256/735735
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: