作者:披着羊皮的狼19972010 | 来源:互联网 | 2014-05-28 08:57
Centos/dovecot/LNMP/sendmailLNMP套件可到LNMP.ORG下?一?安?Centos6.2已??安?SendMail1.添加SendMail服?沼蛎?im/etc/mail/local-host-names?ⅰ?eyondhk.com」加至local-host-names文件中一行一??域名
Centos/ dovecot/ LNMP/ sendmail
LNMP套件可到 LNMP.ORG下?一?安?
Centos 6.2 已??安?SendMail
1. 添加SendMail服?沼蛎?br />
vim /etc/mail/local-host-names
?ⅰ?eyondhk.com」 加至 local-host-names 文件中
一行一??域名
2. 更改Sendmail的??接口
cp sendmail.mc sendmail.mc.bak /?浞菖渲梦募?br />
vim /etc/mail/sendmail.mc
查 找:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
修改?椋
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
查 找:
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
修改?椋
DAEMON_OPTIONS(`Port=25, Name=MSA, M=Ea')dnl
若你的伺服不?可使用25,?更改其他.
3. ???MTP的用?粽J?
vim /etc/mail/sendmail.mc
?ふ遥
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN
PLAIN')dnl dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI
DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
更改:(去掉前面??:「dnl」)
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN
PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5
CRAM-MD5 LOGIN PLAIN')dnl
4. 安?SMTP??saslauthd套件
yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-plain
cyrus-sasl-md5
5. ?定可以RELAY的?^域
指定?楸?CRELAY ??的部分??褂?MTP??
vi /etc/mail/access
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:beyondhk.com RELAY
6. 生成sendmail.cf文件
cd /etc/mail
m4 sendmail.mc > sendmail.cf
7. ?作出 hash 格式的?料??br />
cd /etc/mail
makemap hash access.db
8. 用?艄芾碇噶?br />
groupadd mailuser /* 建立?件用?艚M*/
useradd -g mailuser -s /sbin/nologin
mike /*建立不能登?系?的?件用??/
vim /etc/aliases /*sendmail使用aliases?C制????件?e名和群?功能*/
admin: mike /*admin是mike的?e名*/
testgroup:
mike,john,tom,jack /*?件群?,向testgroup?箱?送就是向4??人?送*/
newaliases /*??liases.db???旄??/
9. 安?dovecot(POP3,IMAP)
yum install dovecot
vim /etc/dovecot/dovecot.conf
查找:#protocols = imap pop3 lmtp
更改:protocols = imap pop3 lmtp
10. ?定dovecot使用的???C制
vi /etc/sysconfig/saslauthd
?ふ遥?ECH=pam
改?椋?ECH=shadow
11. ?置在系?3和5??e?? 及重??br />
chkconfig ?level 35 sendmail on
chkconfig ?level 35 saslauthd on
chkconfig ?level 35 dovecot on
service dovecot restart
service saslauthd restart
service sendmail restart
注意事?:
若??Dovecot不能正常使用?K在maillog中出了????息:
user towns: Initialization failed: mail_location not set and
autodetection failed: Mail storage autodetection failed with
home=/home/towns
Error: Invalid user settings. Refer to server log for more
information.
vim /etc/dovecot/conf.d/10-mail.conf
找到?K修改下行,?]找到就自己加上去,注意/var/spool/mail/?段,?改成自己系?的
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u