注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

good luck guys

welcome

 
 
 

日志

 
 

Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客  

2011-06-17 11:55:11|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

hongwish8es 的BLOG

博客统计信息

用户名:hongwish8es
文章数:34
评论数:28
访问量:36429
无忧币:332
博客积分:835
博客等级:3
注册日期:2008-03-24

搜索BLOG文章

一、
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图1)
(如图2)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图3)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图4)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图5)
(如图6)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图7)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图8)
9#vi /etc/resolv.conf 指定当前主机的DNS服务器,最多可指定三个:如图9
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图9)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图10)
二、DNS简单配置
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns ~]# service named restart
停止 named: [失败]
启动 named: [确定]
[root@dns ~]# chkconfig --list named
named 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@dns ~]# chkconfig --level 2345 named on
[root@dns ~]# chkconfig --list named
named 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
vim /etc/mail/local-host-names
[root@dns Server]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@dns Server]# vim /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
benet.com.
mail.benet.com.
~
~
~
"/etc/mail/local-host-names" 3L, 91C 已写入
[root@dns Server]#
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# rpm -qa | grep cyrus-sasl
cyrus-sasl-lib-2.1.22-4
cyrus-sasl-2.1.22-4
cyrus-sasl-plain-2.1.22-4
cyrus-sasl-devel-2.1.22-4
[root@dns Server]# rpm -qa cyrus-sasl
cyrus-sasl-2.1.22-4
[root@dns Server]# rpm -qa cyrus-sasl-lib
cyrus-sasl-lib-2.1.22-4
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
root@dns ~]# mount /dev/hdc /mnt/dvd/
mount: block device /dev/hdc is write-protected, mounting read-only
[root@dns ~]# cd /mnt/dvd/Server/
[root@dns Server]# rpm -qa | grep sendmail
sendmail-8.13.8-2.el5
[root@dns Server]# ls sendmail*
sendmail-8.13.8-2.el5.i386.rpm sendmail-devel-8.13.8-2.el5.i386.rpm
sendmail-cf-8.13.8-2.el5.i386.rpm sendmail-doc-8.13.8-2.el5.i386.rpm
[root@dns Server]# rpm -ivh --aid sendmail-cf-8.13.8-2.el5.i386.rpm
warning: sendmail-cf-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-cf ########################################### [100%]
[root@dns Server]# rpm -ivh --aid sendmail-devel-8.13.8-2.el5.i386.rpm
warning: sendmail-devel-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-devel ########################################### [100%]
[root@dns Server]# rpm -ivh --aid sendmail-doc-8.13.8-2.el5.i386.rpm
warning: sendmail-doc-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-doc ########################################### [100%]
[root@dns Server]#
[root@dns Server]# rpm -qa | grep sendmail
sendmail-devel-8.13.8-2.el5
sendmail-doc-8.13.8-2.el5
sendmail-cf-8.13.8-2.el5
sendmail-8.13.8-2.el5
[root@dns Server]# rpm -qa | grep m4
m4-1.4.5-3.el5.1
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
52行 TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
53行 define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
123行 DAEMON_OPTIONS(`Port=submission, M=Ea')dnl
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
116将smtp侦听范围从127.0.0.1改为0.0.0.0
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
在sendmail.mc中没有这个选项,这个要在sendmail.cf中设置
vim /etc/mail/sendmail.cf
默认不限制:
我们可以设置成邮件最大不超过20MB
# maximum message size
O MaxMessageSize=20971520
意思为每次收发邮件最大为20MB,任何超过这个值的邮件将被拒绝。
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@dns Server]# groupadd gongchengbu
[root@dns Server]# adduser -g gongchengbu -s /sbin/nologin honglin1
[root@dns Server]# adduser -g gongchengbu -s /sbin/nologin honglin2
[root@dns Server]# passwd honglin1
Changing password for user honglin1.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# passwd honglin2
Changing password for user honglin2.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd zhangsan
[root@dns Server]# passwd zhangsan
Changing password for user zhangsan.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd lisi
[root@dns Server]# passwd lisi
Changing password for user lisi.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd wangwu
[root@dns Server]# passwd wangwu
Changing password for user wangwu.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# ls /etc/aliases
/etc/aliases
[root@dns Server]# ls /etc/aliases*
/etc/aliases /etc/aliases.db
[root@dns Server]# vim /etc/aliases
ftp-admin: ftp
www: webmaster
webmaster: root
noc: root
security: root
hostmaster: root
info: postmaster
marketing: postmaster
sales: postmaster
support: postmaster
gongchengbu: honglin1,honglin2
# trap decode to catch security attacks
decode: root
# Person who should get root's mail
"/etc/aliases" 97L, 1546C 已写入
[root@dns Server]#
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# newaliases
/etc/aliases: 77 aliases, longest 17 bytes, 793 bytes total
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# makemap hash /etc/mail/access.db < /etc/mail/access
[root@dns Server]#
[root@dns Server]# service sendmail restart
关闭 sm-client: [确定]
关闭 sendmail: [确定]
启动 sendmail: [确定]
启动 sm-client: [确定]
添加/var文件系统参数
LABEL=/var         /var             ext3    defaults,usrquota,grpquota        1 2
[root@dns Server]# vim /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/var /var ext3 defaults,usrquota,grpquota 1
2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/home /home ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
~
~
"/etc/fstab" 11L, 854C 已写入
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
quotacheck -cugm /var
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
edquota -u zhangsan
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
quotaon -av
Repquota -a
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
如果企业员工较多,那么像这样一个个为每个员工单独配置磁盘配额将会增加我们管理的难度哈~这里我们可以建立一个样简单的脚本,将所有用户的磁盘空间科学硬限制为200MB。
在/etc/mail/目录下创建一个quota.sh磁盘配额脚本文件
vim /etc/mail/quota.sh
#!/bin/bash
for i in zhangsan lisi wangwu honglin1 honglin2
do
setquota -u $i 0 200000 0 0 /var
done
~
~
~
"/etc/mail/quota.sh" [新] 5L, 101C 已写入
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
7、. /etc/mail/quota.sh执行此脚本并查看
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
8、执行quotaoff -av后执行quotaon -av使设置的磁盘配额生效
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
perl(DBI) is needed by mysql-5.0.45-7.el5.i386
[root@dns Server]# rpm -ivh --aid perl-DBI-1.52-2.el5.i386.rpm
warning: perl-DBI-1.52-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:perl-DBI ########################################### [100%]
[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:mysql ########################################### [100%]
[root@dns Server]# rpm -ivh --aid dovecot-1.0.7-7.el5.i386.rpm
warning: dovecot-1.0.7-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:dovecot ########################################### [100%]
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Mail服务器会使用私钥加密邮件,客户端在收取邮件时,则使用Mail服务器证书中的公钥对邮件进行解密,这样才能正常读取邮件哈~,/etc/pki/tls/certs/Makefile文件保存着生成密钥和证书的脚本设置,这里使用make命令制作dovecot.pem文件,其保存邮件服务器的私钥和公钥信息。
make -C /etc/pki/tls/certs/ dovecot.pem
生成证书时,按要求依次填写国家、省份、城市等等信息
[root@dns Server]# make -C /etc/pki/tls/certs/ dovecot.pem
make: Entering directory `/etc/pki/tls/certs'
umask 77 ; \
PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
/usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
cat $PEM1 > dovecot.pem ; \
echo "" >> dovecot.pem ; \
cat $PEM2 >> dovecot.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
...................................++++++
.++++++
writing new private key to '/tmp/openssl.DW2402'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:BeiJing
Locality Name (eg, city) [Newbury]:Chaoyang
Organization Name (eg, company) [My Company Ltd]:zhangsan
Organizational Unit Name (eg, section) []:MIS
Common Name (eg, your name or your server's hostname) []:mail.benet.com
Email Address []:zhangsan.benet.com
make: Leaving directory `/etc/pki/tls/certs'
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# service sendmail restart
关闭 sm-client: [确定]
关闭 sendmail: [确定]
启动 sendmail: [确定]
启动 sm-client: [确定]
[root@dns Server]# service dovecot restart
停止 Dovecot Imap: [失败]
启动 Dovecot Imap: [确定]
[root@dns Server]# service saslauthd restart
停止 saslauthd: [失败]
启动 saslauthd: [确定]
[root@dns Server]# chkconfig --list sendmail
sendmail 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@dns Server]# chkconfig --list dovecot
dovecot 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@dns Server]# chkconfig --level 2345 dovecot on
[root@dns Server]# chkconfig --list dovecot
dovecot 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@dns Server]# chkconfig --list saslauthd
saslauthd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@dns Server]# chkconfig --level 2345 saslauthd on
[root@dns Server]# chkconfig --list saslauthd
saslauthd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# netstat -tupln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 1893/hpiod
tcp 0 0 0.0.0.0:998 0.0.0.0:* LISTEN 1664/rpc.statd
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 2448/sendmail: acce
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1629/portmap
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1938/cupsd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2448/sendmail: acce
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 1898/python
tcp 0 0 :::993 LISTEN 2479/dovecot
tcp 0 0 :::995 LISTEN 2479/dovecot
tcp 0 0 :::110 LISTEN 2479/dovecot
tcp 0 0 :::143 LISTEN 2479/dovecot
tcp 0 0 :::22 LISTEN 1922/sshd
udp 0 0 0.0.0.0:32768 0.0.0.0:* 2117/avahi-daemon:
udp 0 0 0.0.0.0:992 0.0.0.0:* 1664/rpc.statd
udp 0 0 0.0.0.0:995 0.0.0.0:* 1664/rpc.statd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2117/avahi-daemon:
udp 0 0 0.0.0.0:111 0.0.0.0:* 1629/portmap
udp 0 0 0.0.0.0:631 0.0.0.0:* 1938/cupsd
udp 0 0 :::32769 2117/avahi-daemon:
udp 0 0 :::5353 2117/avahi-daemon:
[root@dns Server]#
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
6)、repquota  –a 查看
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
配置文件在附件里面:
如有不懂的地方,请call我!qq:357714938 mail:hongwish8es@126.com

本文出自 “韩红林IT技术博客” 博客,请务必保留此出处http://hongwish8es.blog.51cto.com/344927/216618

一、
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图1)
(如图2)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图3)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图4)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图5)
(如图6)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图7)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图8)
9#vi /etc/resolv.conf 指定当前主机的DNS服务器,最多可指定三个:如图9
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图9)
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
(如图10)
二、DNS简单配置
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns ~]# service named restart
停止 named: [失败]
启动 named: [确定]
[root@dns ~]# chkconfig --list named
named 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@dns ~]# chkconfig --level 2345 named on
[root@dns ~]# chkconfig --list named
named 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
vim /etc/mail/local-host-names
[root@dns Server]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@dns Server]# vim /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
benet.com.
mail.benet.com.
~
~
~
"/etc/mail/local-host-names" 3L, 91C 已写入
[root@dns Server]#
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# rpm -qa | grep cyrus-sasl
cyrus-sasl-lib-2.1.22-4
cyrus-sasl-2.1.22-4
cyrus-sasl-plain-2.1.22-4
cyrus-sasl-devel-2.1.22-4
[root@dns Server]# rpm -qa cyrus-sasl
cyrus-sasl-2.1.22-4
[root@dns Server]# rpm -qa cyrus-sasl-lib
cyrus-sasl-lib-2.1.22-4
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
root@dns ~]# mount /dev/hdc /mnt/dvd/
mount: block device /dev/hdc is write-protected, mounting read-only
[root@dns ~]# cd /mnt/dvd/Server/
[root@dns Server]# rpm -qa | grep sendmail
sendmail-8.13.8-2.el5
[root@dns Server]# ls sendmail*
sendmail-8.13.8-2.el5.i386.rpm sendmail-devel-8.13.8-2.el5.i386.rpm
sendmail-cf-8.13.8-2.el5.i386.rpm sendmail-doc-8.13.8-2.el5.i386.rpm
[root@dns Server]# rpm -ivh --aid sendmail-cf-8.13.8-2.el5.i386.rpm
warning: sendmail-cf-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-cf ########################################### [100%]
[root@dns Server]# rpm -ivh --aid sendmail-devel-8.13.8-2.el5.i386.rpm
warning: sendmail-devel-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-devel ########################################### [100%]
[root@dns Server]# rpm -ivh --aid sendmail-doc-8.13.8-2.el5.i386.rpm
warning: sendmail-doc-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-doc ########################################### [100%]
[root@dns Server]#
[root@dns Server]# rpm -qa | grep sendmail
sendmail-devel-8.13.8-2.el5
sendmail-doc-8.13.8-2.el5
sendmail-cf-8.13.8-2.el5
sendmail-8.13.8-2.el5
[root@dns Server]# rpm -qa | grep m4
m4-1.4.5-3.el5.1
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
52行 TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
53行 define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
123行 DAEMON_OPTIONS(`Port=submission, M=Ea')dnl
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
116将smtp侦听范围从127.0.0.1改为0.0.0.0
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
在sendmail.mc中没有这个选项,这个要在sendmail.cf中设置
vim /etc/mail/sendmail.cf
默认不限制:
我们可以设置成邮件最大不超过20MB
# maximum message size
O MaxMessageSize=20971520
意思为每次收发邮件最大为20MB,任何超过这个值的邮件将被拒绝。
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@dns Server]# groupadd gongchengbu
[root@dns Server]# adduser -g gongchengbu -s /sbin/nologin honglin1
[root@dns Server]# adduser -g gongchengbu -s /sbin/nologin honglin2
[root@dns Server]# passwd honglin1
Changing password for user honglin1.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# passwd honglin2
Changing password for user honglin2.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd zhangsan
[root@dns Server]# passwd zhangsan
Changing password for user zhangsan.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd lisi
[root@dns Server]# passwd lisi
Changing password for user lisi.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd wangwu
[root@dns Server]# passwd wangwu
Changing password for user wangwu.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# ls /etc/aliases
/etc/aliases
[root@dns Server]# ls /etc/aliases*
/etc/aliases /etc/aliases.db
[root@dns Server]# vim /etc/aliases
ftp-admin: ftp
www: webmaster
webmaster: root
noc: root
security: root
hostmaster: root
info: postmaster
marketing: postmaster
sales: postmaster
support: postmaster
gongchengbu: honglin1,honglin2
# trap decode to catch security attacks
decode: root
# Person who should get root's mail
"/etc/aliases" 97L, 1546C 已写入
[root@dns Server]#
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# newaliases
/etc/aliases: 77 aliases, longest 17 bytes, 793 bytes total
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# makemap hash /etc/mail/access.db < /etc/mail/access
[root@dns Server]#
[root@dns Server]# service sendmail restart
关闭 sm-client: [确定]
关闭 sendmail: [确定]
启动 sendmail: [确定]
启动 sm-client: [确定]
添加/var文件系统参数
LABEL=/var         /var             ext3    defaults,usrquota,grpquota        1 2
[root@dns Server]# vim /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/var /var ext3 defaults,usrquota,grpquota 1
2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/home /home ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
~
~
"/etc/fstab" 11L, 854C 已写入
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
quotacheck -cugm /var
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
edquota -u zhangsan
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
quotaon -av
Repquota -a
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
如果企业员工较多,那么像这样一个个为每个员工单独配置磁盘配额将会增加我们管理的难度哈~这里我们可以建立一个样简单的脚本,将所有用户的磁盘空间科学硬限制为200MB。
在/etc/mail/目录下创建一个quota.sh磁盘配额脚本文件
vim /etc/mail/quota.sh
#!/bin/bash
for i in zhangsan lisi wangwu honglin1 honglin2
do
setquota -u $i 0 200000 0 0 /var
done
~
~
~
"/etc/mail/quota.sh" [新] 5L, 101C 已写入
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
7、. /etc/mail/quota.sh执行此脚本并查看
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
8、执行quotaoff -av后执行quotaon -av使设置的磁盘配额生效
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
perl(DBI) is needed by mysql-5.0.45-7.el5.i386
[root@dns Server]# rpm -ivh --aid perl-DBI-1.52-2.el5.i386.rpm
warning: perl-DBI-1.52-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:perl-DBI ########################################### [100%]
[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:mysql ########################################### [100%]
[root@dns Server]# rpm -ivh --aid dovecot-1.0.7-7.el5.i386.rpm
warning: dovecot-1.0.7-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:dovecot ########################################### [100%]
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Mail服务器会使用私钥加密邮件,客户端在收取邮件时,则使用Mail服务器证书中的公钥对邮件进行解密,这样才能正常读取邮件哈~,/etc/pki/tls/certs/Makefile文件保存着生成密钥和证书的脚本设置,这里使用make命令制作dovecot.pem文件,其保存邮件服务器的私钥和公钥信息。
make -C /etc/pki/tls/certs/ dovecot.pem
生成证书时,按要求依次填写国家、省份、城市等等信息
[root@dns Server]# make -C /etc/pki/tls/certs/ dovecot.pem
make: Entering directory `/etc/pki/tls/certs'
umask 77 ; \
PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \
/usr/bin/openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \
cat $PEM1 > dovecot.pem ; \
echo "" >> dovecot.pem ; \
cat $PEM2 >> dovecot.pem ; \
rm -f $PEM1 $PEM2
Generating a 1024 bit RSA private key
...................................++++++
.++++++
writing new private key to '/tmp/openssl.DW2402'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:BeiJing
Locality Name (eg, city) [Newbury]:Chaoyang
Organization Name (eg, company) [My Company Ltd]:zhangsan
Organizational Unit Name (eg, section) []:MIS
Common Name (eg, your name or your server's hostname) []:mail.benet.com
Email Address []:zhangsan.benet.com
make: Leaving directory `/etc/pki/tls/certs'
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# service sendmail restart
关闭 sm-client: [确定]
关闭 sendmail: [确定]
启动 sendmail: [确定]
启动 sm-client: [确定]
[root@dns Server]# service dovecot restart
停止 Dovecot Imap: [失败]
启动 Dovecot Imap: [确定]
[root@dns Server]# service saslauthd restart
停止 saslauthd: [失败]
启动 saslauthd: [确定]
[root@dns Server]# chkconfig --list sendmail
sendmail 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@dns Server]# chkconfig --list dovecot
dovecot 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@dns Server]# chkconfig --level 2345 dovecot on
[root@dns Server]# chkconfig --list dovecot
dovecot 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@dns Server]# chkconfig --list saslauthd
saslauthd 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@dns Server]# chkconfig --level 2345 saslauthd on
[root@dns Server]# chkconfig --list saslauthd
saslauthd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
[root@dns Server]# netstat -tupln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 1893/hpiod
tcp 0 0 0.0.0.0:998 0.0.0.0:* LISTEN 1664/rpc.statd
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 2448/sendmail: acce
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1629/portmap
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1938/cupsd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2448/sendmail: acce
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN 1898/python
tcp 0 0 :::993 LISTEN 2479/dovecot
tcp 0 0 :::995 LISTEN 2479/dovecot
tcp 0 0 :::110 LISTEN 2479/dovecot
tcp 0 0 :::143 LISTEN 2479/dovecot
tcp 0 0 :::22 LISTEN 1922/sshd
udp 0 0 0.0.0.0:32768 0.0.0.0:* 2117/avahi-daemon:
udp 0 0 0.0.0.0:992 0.0.0.0:* 1664/rpc.statd
udp 0 0 0.0.0.0:995 0.0.0.0:* 1664/rpc.statd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2117/avahi-daemon:
udp 0 0 0.0.0.0:111 0.0.0.0:* 1629/portmap
udp 0 0 0.0.0.0:631 0.0.0.0:* 1938/cupsd
udp 0 0 :::32769 2117/avahi-daemon:
udp 0 0 :::5353 2117/avahi-daemon:
[root@dns Server]#
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
6)、repquota  –a 查看
Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客 - bailkai - good luck guy
配置文件在附件里面:
如有不懂的地方,请call我!qq:357714938 mail:hongwish8es@126.com

本文出自 “韩红林IT技术博客” 博客,请务必保留此出处http://hongwish8es.blog.51cto.com/344927/216618




引文来源  Sendmail简单配置(3) - 韩红林IT技术博客 - 51CTO技术博客
  评论这张
 
阅读(803)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017