4.4 如何restart sendmail;inetd以及注意事项
有一点要提醒大家的,要用"kill -9 [pid-of-sendmail]" ,从新启动sendmail 如果用 kill -HUP 是不会发生作用的! (这是颇多人常遇到的问题,切记!)
在redhat6中用/etc/rc.d/init.d/sendmail restart即可!
inetd是 /etc/rc.d/init.d/inetd restart
5.1 sendmail的别名和forward
(1) 关于直接用IP地址发信
mail user@[166.111.IP.Address] 只要用[]将IP地址括起来就行了
(2) 关于alias
sendmail在/etc下有两个文件 aliases和aliases.db, 后者是前者用newaliases 生成的别名数据库. 你可以手工编辑/etc/aliases, 然后运行newaliases更新数据 库(其实newaliases是个到sendmail的 symlink)
eg: nickname : user@hotmail.com alias-name: real-user-account
则以后mail nickname就可以将信寄到user@hotmail.com处 而别人寄给alias-name@your.domain.name的信就会转给真正的用户real-user-account
(3) 关于forward
在你的$HOME目录下面编辑一个.forward文件, 里面写上你要forward的目的e-mail 地址或本机的用户名, 就可以自动将信 forward到相应地址
eg: .forward: user@hotmail.com 或 other-user-account 则给此人的e-mail会forward到hotmail或other-user-account处
(4) 关于vacation
去找一个vacation包(如RedHat的contrib中有vacation的rpm), 装上后就一个 /usr/bin/vacation程序和一个man.
先运行vacation, 它会让你编辑$HOME/.vacation.msg文件, 就是要发回给对方 告诉他你现在不看信的东西啦. 然后编辑$HOME/.forward文件, 写这样一句 \username, " /usr/bin/vacation username", username 要换回你自己的了 然后运行vacation -I建立$HOME/.vacation.db就好了 (看看man更详细)
(5) 关于sendmail的一些文件
/var/log/maillog sendmail的log, 分析错误有用 /var/spool/mail/$USER 进来的信, 每个用户一个文件 /var/spool/mqueue mail queue, 可以用mailq看队列中待发的信 (mailq也是 sendmail的symlink了) dfxxxxxx 这是信的内容 qfxxxxxx 这是信的subject和别的信息 (反正每信一个号了, 配对的)
/etc/sendmail.cf sendmail的配置文件, 改动它可要小心 /etc/sendmail.cw 假如你的机器有好多alias的话就把名字写在 这个文件中, 这样写哪个都能收到信
5.2 限制邮件的大小
Modify /etc/sendmail.cf:
Mlocal, P=/bin/mail, F=lsDFMrmn, S=10, R=20/40, Maxsize=1000000, A=mail -d $u Mprog, P=/usr/local/sendmail/smrsh, F=lsDFMeu, S=10, R=20/40, D=$z:/, Maxsize=1000000, A=sh -c $u
This limits incoming mail processed by by smrsh and /bin/mail to 1 million bytes.
You can do the same with the Mstmp, Mesmtp, and Mrelay statements to limit the size of outgoing mail as well.
|
|