且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

sendmail源码包配置

更新时间:2021-12-23 22:04:28

sendmail源码包在[url]www.sendmail.org[/url]下载
1 rpm -e nodeps sendmail
2 rpm -e nodeps postfix
3 tar -zxvf sendmail.8.14.0.Beta4.tar.gz 
4 cd sendmail.8.14.0.Beta4
5 vi devtools/site/site.config.m4
6 添加APPENDDEF(`configENVDEF',`-DSASL=2')
      APPENDDEF(`config_sendmail_LIBS',-lsasl2') 
7 sh Build -c
8 rpm -q m4
9 mkdir /usr/share/sendmail
10 cp -a cf /usr/share/sendmail
11 cd cf/cf
12 cp generic-linux.mc sendmail.mc
13 mkdir /etc/mail
14 make install-cf
15 cp sendmail.mc /etc/mail
16 cd /etc/mail
17 touch aliases access
18 echo "sina.com" > local-host-names
19 cd sendmail.8.14.0.Beta4
20 sh Build install
21which makemap
22 makemap hash access < access  
23 mkdir /var/spool/mqueue
24 makemap hash aliases < aliases
25 sendmail -bd q1h
26 useradd yirehe
27 passwd yirehe
28 echo "root: yirehe" >> /etc/mail/aliases
29 newaliases
30 telnet localhost
31 tail /var/log/maillog
32 su - yirehe
33 mail
34 rpm -ivh /mnr/cdrom/RedHat/RPMS/imap-*.rpm
35 chkconfig ipop3 on
36 chkconfig imap on
              RELAY
37 cd /etc/mail 
38 vi sendmail.mc
   在OSTYPE(linux)dnl下面加上FEATURE(`access_db')dnl 
   在 divert(0)dnl 下面加上
   include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
39 m4 sendmail.mc > sendmail.cf
40 echo "192.168.0    RELAY" >> access
41 killall -9 sendmail
42 makemap hash access < access
43 sendmail -bd -q1h
44用outlook 发信做实验
45 ssh mail.sina.com 用两个域名来做实验
      增加用户认证
46 rm access
47 > access
48 makemap hash access < access
49 killall -9 sendmail
50 sendmail -bd -q1h
51 /etc/mail 
52 vi sendmail.mc
   在FEATURE(`access_db)dnl下加上
   define (`confAUTH_OPTIONS',`A y')dnl
   TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
   define(`confAUTH_MECHANISMS',`LOGIN PLAIN')dnl
53 m4 sendmail.mc > sendmail.cf
54 chkconfig saslauthd on
55 service saslauthd restart
56 echo "pwcheck_method:saslauthd" > /usr/lib/sasl2/sendmail.conf
57 killall sendmail
58 sendmail -bd -q1h
59 telnet localhost 25
60 ehlo locahost 出现AUTH LOGIN PLAIN
61 别名写在 /etc/mail/aliases
      为了加密我们启动imaps来接受邮件
62 chkconfig imaps on
63 chkconfig imap off
64 service xinetd restart
65 可以在OUTLOOK的高级里把接受服务器里的些服务器要求安全连接(SSL)勾上









本文转自 yirehe 51CTO博客,原文链接:http://blog.51cto.com/yirehe/16891,如需转载请自行联系原作者