下载地址 (HTTP): http://www.sendmail.org/ftp/sendmail.8.12.9.tar.gz 下载地址 (FTP): ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.12.9.tar.gz 版本: 8.12.9 软件包大小: 1.9 MB 估计所需硬盘空间: 13 MB |
sendmail软件包包含了一个邮件传送代理程序(MTA)。
sendmail依赖于: db-4.1.25, procmail-3.22 |
在编译sendmail前,我们需要用下面的命令创建用户,用户组和目录供sendmail使用:
groupadd smmsp && groupadd mail && useradd -g smmsp -G mail smmsp && chmod 1777 /tmp && chmod 1777 /var/mail && mkdir /var/spool/mqueue |
用下面的命令安装sendmail:
cat > devtools/Site/site.config.m4 << "EOF" define(`confMANGRP',`root') define(`confMANOWN',`root') define(`confSBINGRP',`root') define(`confUBINGRP',`root') define(`confUBINOWN',`root') EOF cd sendmail && sh Build && cd ../cf/cf && cp generic-linux.mc sendmail.mc && mkdir /etc/mail && sh Build sendmail.mc && sh Build install-cf && cd ../../ && sh Build install |
echo `hostname` > /etc/mail/local-host-names cat > /etc/mail/aliases << "EOF" postmaster: root MAILER-DAEMON: root EOF cd /etc/mail && cp -R /usr/src/sendmail-8.12.9/cf/* . && cp -R /usr/src/sendmail-8.12.9/cf/cf/submit.mc . && cp -R /usr/src/sendmail-8.12.9/cf/cf/sendmail.mc . && newaliases -v && |
用下面的命令创建sendmail启动脚本,以便在系统启动/关闭是运行/停止sendmail:
注: -qNm 参数中,N表示分钟数,控制着多长时间 Sendmail 处理一次邮件队列。这里用缺省的五分钟。单机用户可能想把它设置成一分种那么少,而处理邮件多的服务器可能要设得大点才行。
cat > /etc/rc.d/init.d/sendmail << "EOF" #!/bin/sh # Begin $rc_base/init.d/sendmail # Based on sysklogd script from LFS-3.1 and earlier. # Rewritten by Gerard Beekmans - [email protected] source /etc/sysconfig/rc source $rc_functions case "$1" in start) echo "Starting sendmail..." loadproc /usr/sbin/sendmail -bs -bd -q5m start ;; stop) echo "Stopping Sendmail..." killproc sendmail ;; status) statusproc sendmail ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac # End $rc_base/init.d/sendmail EOF chmod 755 /etc/rc.d/init.d/sendmail |
用下面的命令创建不同运行级下的符号链接:
cd /etc/rc.d/init.d && ln -sf ../init.d/sendmail ../rc0.d/K25sendmail && ln -sf ../init.d/sendmail ../rc1.d/K25sendmail && ln -sf ../init.d/sendmail ../rc2.d/K25sendmail && ln -sf ../init.d/sendmail ../rc3.d/S35sendmail && ln -sf ../init.d/sendmail ../rc4.d/S35sendmail && ln -sf ../init.d/sendmail ../rc5.d/S35sendmail && ln -sf ../init.d/sendmail ../rc6.d/K25sendmail |
sendmail软件包中包含 mail.local, rmail, smrsh, editmap, makemap, mailq, newaliases, sendmail, vacation, praliases以及 mailstats。