快速安装配置sendmail服务器的脚本
出处:sendmail 作者:sendmail 时间:2013-5-30 11:36:40
前段时间写的一个一键安装配置sendmail服务器的小脚本,使用非常方便。#!/bin/bashecho "====================rhel61 64-bit sendmail auto_install scripts===================="ip=$(ifconfig eth0 | grep -w 'inet addr' | awk '{print $2}' | awk -F: '{print $2}')domain=$(echo $HOSTNAME | awk -F'.' '{print $(NF-1)"."$NF}')echo "++++++++++++++++++++==========NOW is install sendmail,please waitting==========++++++++++"yum erase -y sendmail-*yum install -y sendmail-* m4-* telnetsed -i "/Addr=127.0.0.1/a DAEMON_OPTIONS(\`Port=smtp,Addr=$ip, Name=MTA')dnl" /etc/mail/sendmail.mcsed -i "/submission/a DEMON_OPTIONS(\`Port=submission, Name=MSA, M=Ea')dnl" /etc/mail/sendmail.mcsed -i "/TRUST_AUTH_MECH/a TRUST_AUTH_MECH(\`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl\ndefine(\`confAUTH_MECHANISMS', \`EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl" /etc/mail/sendmail.mcecho "$HOSTNAME" >> /etc/mail/local-host-namesecho "$domain" >> /etc/mail/local-host-namesservice sendmail startecho "===================sendmail in install successful,you can use 'telnet localhost 25' to test===================="echo "++++++++++++++++++++==========NOW is install dovecot,please waitting==========++++++++++"yum erase -y dovecot-*yum install -y dovecot cyrus-sasl-plain cyrus-saslsed -i "/pop3/a protocols = pop3" /etc/dovecot/dovecot.confsed -i "/*,/a listen = *" /etc/dovecot/dovecot.confsed -i "/login_trusted_networks/a disable_plaintext_auth = no" /etc/dovecot/dovecot.confsed -i "/home directory/a mail_location = mbox:~/mail:INBOX=/var/mail/%u" /etc/dovecot/conf.d/10-mail.confservice dovecot startservice saslauthd startecho "===================dovecot,cyrus-sasl is install successful,you can use 'telnet localhost 110' to test===================="echo "++++++++++++++++++++==========GOOD luck for you==========++++++++++++++++++++"echo "====================this scripts is writed by TomYan at 2011-11-09 in guangzhou===================="echo "====================run is OK====================