|
以下内容是经过通过网上的一些资料汇集起来,绝对可以成功,本人测试过多次(其实也就只三四次而已)
本文假设你安装时已经安装相关套件并设好DNS.在此例中我设的DNS是mail.alian.com,ip为 172.16.10.1,帐号为test,alian.相关方法在论坛中搜索一下,好像有位syd168的仁兄的图形化DNS方法较为简单,补充一点:客户机的hosts文件最好稍为改一下.(注:我并不说其他大哥的方法不好,请凉解.)
1.安装与启动sendmail(全选安装者可略过)
先看一下有没安装sendmail:
[root@mis010 /]# rpm -qa | grep sendmail
sendmail-8.12.8-4
若出现上述那行即表示已经安装,若未安装请
#rpm -ivh sendmail-8.12.8-4.i386.rpm
启动sendmail
# /etc/rc.d/init.d/sendmail start
或
# sendmail -bd -q1h ---在背景执行sendmail并监听25port并当sendmail无法将信件送达目的地时,会先将信件保留在信件?辛衜ail queue.并每隔一小时处理一次信件?辛.
测试sendmail
[root@mis010 /]# telnet 172.16.10.1 25
Trying 172.16.10.1...
Connected to www (172.16.10.1).
Escape character is '^]'.
220 localhost.localdomain ESMTP Sendmail 8.12.8/8.12.8; Mon, 4 Aug 2003 08:42:11 -0400
接着可"ctrl+]"中断再"Enter"继续
再按Q退出
^]
telnet> q
Connection closed.
2.设定收发限制
修改/etc/mail/access加上如下内容:
172.10 RELAY
然后
# makemap -v hash /etc/mail/access < /etc/mail/access
3.设定smtp认证(安装过程略)
# vi /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"删除.再找到如下那行并作修改
DAEMON_OPTIONS(`Port=smtp,Addr=你的IP, Name=MTA')dnl
然后我们必须产生新的sendmail.cf,
# cp /etc/mail/sendmail.mc /usr/share/sendmail-cf/cf
# cd /usr/share/sendmail-cf/cf
# sh Build senmail.cf
# cp sendmail.cf /etc/mail/
# /etc/rc.d/init.d/sendmail restart
检测SMTP认证
[root@mis010 /]# telnet 172.16.10.1 25
Trying 172.16.10.1...
Connected to www (172.16.10.1).
Escape character is '^]'.
220 localhost.localdomain ESMTP Sendmail 8.12.8/8.12.8; Mon, 4 Aug 2003 08:50:20 -0400
ehlo localhost ---输入此命令
250-localhost.localdomain Hello www [172.16.10.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH GSSAPI LOGIN PLAIN ---出现此行代表设定正确
250-DELIVERBY
250 HELP
^] ---ctrl+]中断
telnet> q ---q退出
Connection closed.
4.添加别名到/etc/aliases中,格式:
别名名称 实际名称
test1 test
luo_alian alian
这样一来,寄给luo_alian就会被alian收走了,呵呵
重新读取aliases档.
# newaliases
5.设定可让帐号名称为大写字母的使用者收信,
# vi /etc/mail/sendmail.cf
Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9u,.... ---此处加个"u"
(限定邮件空间什么的可以安装Quota套件来达成,还有什么伪装寄出信...在此就不多说,节约时间):p :p
6.设定POP与IMAP服务器.(安装过程略)
1) 首先确定/etc/servicese有以下内容
pop2 109/tcp pop-2 postoffice # POP version 2
pop2 109/udp pop-2
pop3 110/tcp pop-3 # POP version 3
pop3 110/udp pop-3
.......
imap 143/tcp imap2 # Interim Mail Access Proto v2
imap 143/udp imap2
利用xinetd启动POP,IMAP,
[root@mis010 /]# vi /etc/xinetd.d/imap
service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += HOST DURATION
log_on_failure += HOST
}
[root@mis010 /]# vi /etc/xinetd.d/ipop3
service pop3
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += HOST DURATION
log_on_failure += HOST
}
[root@mis010 /]# vi /etc/xinetd.d/ipop2
service pop2
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop2d
log_on_success += HOST DURATION
log_on_failure += HOST
}
让xinetd重新读取设定值.
[root@mis010 /]# /etc/rc.d/init.d/xinetd reload
用telnet 来测试POP3,IMAP 的服务和上面的测试方法大同小异,我的是一试就通的至于客户端就不再哆嗦了哈.大家觉得这种邮件方法还好吧
祝大家早日成功! |
|