linux 邮件日志,linux下如何建立邮件日志
先關閉sendmail
service sendmail stop
chkconfig sendmail off
安裝DNS
mount /dev/cdrom /mnt
yum install bind-*
配置主DNS服務器
vim /var/named/chroot/etc/named.conf
options {
directory "/var/named";
};
zone ? ?"daijingjie.com" {
type ?master;
file ?"daijingjie.com.zone";
};
:wq!
cp /usr/share/doc/bind-9.3.6/sample/var/named/localhost.zone /var/named/chroot/var/named/daijingjie.com.zone
vim /var/named/chroot/var/named/daijingjie.com.zone
$TTL ? ?86400
@ ? ? ? ? ? ? ? IN SOA ?@ ? ? ? root (
42 ? ? ? ? ? ? ?; serial (d. adams)
3H ? ? ? ? ? ? ?; refresh
15M ? ? ? ? ? ? ; retry
1W ? ? ? ? ? ? ?; expiry
1D ) ? ? ? ? ? ?; minimum
daijingjie.com. ? ? ? ? ? IN NS ? ? ? ? ?mail.daijingjie.com.
mail.daijingjie.com. ? IN A ? ? ? ? ? ?192.168.18.35
daijingjie.com. ? ? ? ? ? IN MX 10 ? ?mail.daijingjie.com.
:wq!
重啟named
service named restart
echo "" > /etc/resolv.conf
host mail.daijingjie.com
顯示:mail.daijingjie.com has address 192.168.18.35 ?//表示成功
安裝postfix
yum install postfix -y
vim /etc/postfix/main.cf
69 myhostname = mail.daijingjie.com
77 mydomain = daijingjie.com
92 myorigin = $mydomain
107 inet_interfaces = all
110 #inet_interfaces = localhost
155 mydestination = $myhostname,$mydomain
255 mynetworks = 192.168.18.0/24, 127.0.0.0/8
287 relay_domains = daijingjie.com
:wq!
查看是否安裝cyrus-sasl
rpm -qa | grep cyrus-sasl
顯示:cyrus-sasl-lib-2.1.22-5.el5_4.3
cyrus-sasl-2.1.22-5.el5_4.3
cyrus-sasl-plain-2.1.22-5.el5_4.3 ? ?//已經安裝
vim /etc/sysconfig/saslauthd
修改 ?MECH=shadow
創建一個用戶
useradd daijingjie
passwd daijingjie
重啟saslauthd
/etc/init.d/saslauthd restart
chkconfig saslauthd on
測試用戶
testsaslauthd -u daijingjie -p'123456.'
顯示: 0: OK "Success." ?//成功
修改postfix配置文件
vim /etc/postfix/main.cf
在最后加上:
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = ''
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous
:wq!
重啟postfix
service postfix restart
安裝dovecot
yum install dovecot -y
修改dovecot配置文件
vim /etc/dovecot.conf
20 protocols = pop3 pop3s
35 protocol pop3 {
36 ? ? ?listen = *:10100
37 # ? ? ..
38 }
:wq!
/etc/init.d/dovecot restart
chkconfig dovecot on
安裝imap
yum install cyrus-imapd cyrus-imapd-devel -y
vim /etc/postfix/main.cf
456 mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
:wq!
passwd cyrus
/etc/init.d/cyrus-imapd restart
chkconfig cyrus-imapd on
測試:
cyradm -u cyrus localhost
IMAP Password:
localhost.localdomain> cm user.daijingjie
localhost.localdomain> quit
安裝squirrelmail
yum install squirrelmail -y
/usr/share/squirrelmail/config/conf.pl
Command >>d -- cyrus -- 2 -- 1-- daijingjie.com -- 3 -- 2 -- r -- 4 -- 5 -- y -- r -- 10 -- 1 -- zh_CN -- 2 -- gb2312 -- r -- s -- q
重啟postfix
service postfix restart
總結
以上是生活随笔為你收集整理的linux 邮件日志,linux下如何建立邮件日志的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: css怎么使元素绝对定位有过度效果_CS
- 下一篇: linux 其他常用命令