使用Msmtp mutt shell发邮件
2012-09-29 14:20
253 查看
1、编译一下软件
软件下载地址:http://sourceforge.net/projects/msmtp/files/msmtp/1.4.13/msmtp-1.4.13.tar.bz2/download
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 ]#mkdir -p /opt/msmtp/{etc,log}
[root@server ]#cd /opt/msmtp/etc
[root@server etc]# vi 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
user your_account
password your_password
# Set a default account
account default : sohu
保存退出,并对这个文件加上可执行权限:chmod +x msmtprc
到这儿时,最好先测试一下
/opt/msmtp/bin/msmtp test@gmail.com
hello,test
ctrl +d
tail -f /opt/msmtp/log/msmtp.log 看看有没有成功。
然后再进入到上面的邮件中,看看信收到没有
4、配置mutt http://sourceforge.jp/projects/sfnet_mutt/releases/
下载并安装mutt安装包: mutt-1.5.11.tar.gz
tar -xzvf mutt-1.5.11.tar.gz
./configure --prefix=/opt/mutt &&make &&make install
[root@server bin]# vi /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 "messages" test@gmail.com
根据此文章试过了,可以发信,不过在安装mutt的时候是用 sudo apt-get install mutt来的,并非文章中提到的安装。
安装配置msmtp和mutt,例如伪造发件人:/article/7310842.html
软件下载地址:http://sourceforge.net/projects/msmtp/files/msmtp/1.4.13/msmtp-1.4.13.tar.bz2/download
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 ]#mkdir -p /opt/msmtp/{etc,log}
[root@server ]#cd /opt/msmtp/etc
[root@server etc]# vi 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
user your_account
password your_password
# Set a default account
account default : sohu
保存退出,并对这个文件加上可执行权限:chmod +x msmtprc
到这儿时,最好先测试一下
/opt/msmtp/bin/msmtp test@gmail.com
hello,test
ctrl +d
tail -f /opt/msmtp/log/msmtp.log 看看有没有成功。
然后再进入到上面的邮件中,看看信收到没有
4、配置mutt http://sourceforge.jp/projects/sfnet_mutt/releases/
下载并安装mutt安装包: mutt-1.5.11.tar.gz
tar -xzvf mutt-1.5.11.tar.gz
./configure --prefix=/opt/mutt &&make &&make install
[root@server bin]# vi /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 "messages" test@gmail.com
根据此文章试过了,可以发信,不过在安装mutt的时候是用 sudo apt-get install mutt来的,并非文章中提到的安装。
安装配置msmtp和mutt,例如伪造发件人:/article/7310842.html
相关文章推荐
- 使用Msmtp mutt shell发邮件
- 使用Msmtp mutt shell发邮件
- Linux中使用Msmtp+mutt+shell自动发邮件程序安装说明
- php使用root权限执行shell
- shell test的使用
- 使用spark-shell操作Carbondata
- awk中如何使用shell的环境变量
- shell 使用技巧
- github版本库使用详细教程(命令行GitShell及图形界面GitHub)
- 使用shell 判断文件夹或文件是否存在
- 使用parallel-ssh批量执行远程shell命令
- 使用shell脚本实现希尔排序
- (一)HBase学习之路 - HBase Shell 使用 与 HBase WebUI理解
- shell--指“提供使用者使用界面”的软件(命令解析器)
- 使用shell统计字符串出现的次数,并从大到小进行排序显示
- shell的使用
- shell神器Cmder的安装与使用
- Jmete-JDBC Request与BeanShell PostProcessor的结合使用
- 使用ShellClass获取文件属性详细信息
- shell中 printf使用总结(不断更新)