· [Java论坛][安全论坛][数据库论坛][操作系统论坛]
· [专题] IBM Rational高峰论坛 Windows 7十大功能
· [专题] 史上就危险7月 微软 BizSpark 计划介绍
· [IT技术周刊][IT资源下载专区][病毒求助专区]
· [热点] 我也能做CTO_赛迪连载 赛迪七夕特别行动
· [热点] Chrome 4.0采用V8引擎 Java开发编程规范

实用技巧:使用Msmtp+mutt+shell发邮件

发布时间:2007.12.20 06:13     来源:赛迪网    作者:korn

1、编译一下软件

tar jxvf msmtp-1.4.13.tar.bz2

./configure --prefix=/opt/msmtp

make

make install

2、查看配置文件在那儿

[root@server bin]# ./msmtp --version

msmtp version 1.4.13

TLS/SSL library: none

Authentication library: built-in

Supported authentication methods:

plain cram-md5 external login

IDN support: disabled

NLS: enabled, LOCALEDIR is /opt/msmtop/share/locale

System configuration file name: /opt/msmtp/etc/msmtprc -----呵呵,这是我自己建的

User configuration file name: /root/.msmtprc

Copyright (C) 2007 Martin Lambers and others.

This is free software. You may redistribute copies of it under the terms of

the GNU General Public License .

There is NO WARRANTY, to the extent permitted by law.

3、配置一下msmtp的配置文件

[root@server etc]# more msmtprc

# Set default values for all following accounts.

defaults

logfile /opt/msmtp/log/msmtp.log -------该文件要存在,不然没有日志

# The SMTP server of the provider.

account sohu

host smtp.sohu.com

from your_account@sohu.com

auth login -------这个要为login,好像on不行

user your_account

password your_password

# Set a default account

account default : sohu

到这儿时,最好先测试一下

/opt/msmtp/bin/msmtp yehaozi@gmail.com

hello,test

ctrl+d

tail -f /opt/msmtp/log/msmtp.log 看看有没有成功。

然后再进入到上面的邮件中,看看信收到没有

4、配置mutt

我原来在网上一直看到mutt+msmtp发送邮件,我不想装mutt。(汗啊,后面才发现系统已经装了)。一直在找怎么使用msmtp自己来发邮件,邮件可以发,不过功能实在是太少了。那就用已经安装好了的mutt.

[root@server bin]# tail -5 /etc/Muttrc

set sendmail="/opt/msmtp/bin/msmtp"

set realname="actor"

set use_from=yes

set editor="vi"

5、现在都已经搞定了,开始测试看看

[root@server bin]# echo "测试一下" | mutt -s "管理信息" yehaozi@gmail.com

(责任编辑:云子)


[ 发表评论 ] 字体[  ] [ 打印 ] [ 进入博客 ] [ 进入论坛 ]  [ 推荐给朋友 ]
  相关文章
· 新手学堂:Linux操作系统下实现网卡冗余 (12-19) · 轻松一刻:用XMAME模拟器在Linux上玩游戏 (12-19)
· 技巧:动手教你把IDE RAID卡用在linux上 (12-18) · Slackware系统下缺省网络配置的安全问题 (12-18)
· 在SUSE Linux中将Tomcat作为Service运行 (12-18) · 疯狂挂载:Linux连接常用外部设备的方法 (12-18)
· Ubuntu Linux系统环境变量配置文件介绍 (12-18) · uClinux系统上运行自已编写的Hello程序 (12-18)
· 新手学堂:关于Linux操作系统Fork的使用 (12-18) · 解决Linux Vsftpd本地用户不能登录问题 (12-18)
  客户需求反馈表
* 姓  名:
更多资料  了解方案  认识厂商
* 单位名称:
* 联系电话:
* 电子邮件:
资讯 通信 IT产品 IT技术 信息化
专题:谷歌发布PC操作系统Chrome OS
·芯能量 新动力 兴经济:..
·专题:英特尔与AMD和解 ..
·专题:惠普27亿收购3Com..
专题:
·专题:诺基亚危局已现 ..
·六股势力角逐4G标准 中..
·专题:联通iPhone并不贵..
 
·惠普123459黑白激打家族..
·云计算格局初现 三大阵..
·分析:虚拟化在高性能计..
2009 IBM动态架构新动力论坛
·直播:第八届中国系统与..
·专题:置身智慧海洋——..
·专题:让物品开口说话 ..