Leave a comment (0) 作者:小项-怪物猪
说明: 凡是碰到 i18n.3322.org 的一律替换成 你自己的域名
一、增加MX记录到本机
检查方法:
host -t mx i18n.3322.org
二、启用sendmail
/etc/rc.conf 增加
sendmail_enable=YES
三、修改hostname (不知道是不是非必须的)
sed -i -e '/hostname/ s/原名称/i18n.3322.org/' /etc/rc.conf
四、修改/etc/hosts
sed -i -e '/192.169.0.226{你的本机ip}/ s/源名称/i18n.3322.org/' /etc/hosts
五、正式进行配置sendmail 配置文件在 /etc/mail 下
『sendmail.cf文件』
(1)、Cwlocalhost 行后增加 i18n.3322.org 中间记得有空格
(2)、#Dj$w.Foo.COM 行下面增加一行 Dj$w.3322.org 主要是邮箱后缀
(3)、DS 行后面增加 i18n.3322.org
『freebsd.mc文件』
(4)、找到SMART_HOST 行 吧值改成 i18n.3322.org
『新建local-host-names文件』
cat > /etc/mail/local-host-names << EOF
> i18n.3322.org
> localhost
> EOF
上面三行的>是系统的提示符不需要输入的
在/etc/mail 下执行make进行相关文件生成
/etc/rc.d/sendmail restart #重启sendmail
六、测试一下
sendmail -d0 < /dev/null
============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = i18n
(canonical domain name) $j = i18n.3322.org
(subdomain name) $m = 3322.org
(node name) $k = i18n.3322.org
========================================================
echo "email is files" | mail -v -s "mail test title" ***@qq.com #发送邮件测试
如果要接收邮件还的开启pop3
sed -i -e '/pop3/ s/^#//' /etc/inetd.conf
echo "inetd_enable=YES" >> /etc/rc.conf
如果有问题就检查下 :
netstat -an | grep 25 检查是否有25端口的侦听
netstat -an | grep 110 同上只是端口换成110了