linux社区爱心援助Linux认证系列教程业界动态站务新闻公司招聘建议留言网址大全LPI专题CISCO专题
设为首页
加入收藏
管理团队
JSP  
JAVA  
PERL  
 您的位置:首页 > article > Linux入门与提高 > 使用与技巧 >
栏目导栏
资料搜索
热门文章
·VMware Tools的安装步骤
·应用Linux下两种中文输入法
·GRUB FOR DOS 引导安装LINUX和
·linux下BT软件介绍
·Linux中用ALSA驱动声卡流程详解
·Linux 170个常见问题的详细解答
·什么是ISO文件?
·虚拟机软件vmware使用教程--使
·BabyLinux制作过程详解
·Linux挂接(mount)命令的使用方
·Linux必学的网络操作命令
·ffmpeg命令使用详解
·Linux操作系统Ifconfig命令详细
·在Linux下制作工资表
·vmware下的fedora 6的vmware t
最新文章
·CentOS5安装apache和svk使用域
·Ubuntu Linux系统Sudo命令无效
·Uboot对非Linux kernel的引导
·Fedora和XP双系统中网卡Realte
·解决Linux操作系统下部分文件乱
·双系统安装Linux之后找不到Win
·Linux操作系统上安装Flash Med
·设置Tomcat在Linux操作系统中自
·Linux操作系统下创建DBCA报错的
·Redhat Enterprise Linux磁带机
·Linux系统下用一条命令批量修改
·实用技巧:Linux下命令排列、调
·关于Linux操作系统中VI编辑器字
·Linux VI编辑器中的复制与粘贴
·Linux系统下触摸屏的简单使用和
Google
 
使用Msmtp+mutt+shell发邮件
[ 作者:  加入时间:2007-12-20 10:54:55  来自:Linux联盟收集整理 ]
 

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联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
无相关信息