Chinaunix首页 | 论坛 | 博客
  • 博客访问: 432659
  • 博文数量: 75
  • 博客积分: 2780
  • 博客等级: 少校
  • 技术积分: 789
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-23 20:38
文章分类

全部博文(75)

文章存档

2012年(1)

2011年(11)

2010年(12)

2009年(39)

2008年(12)

我的朋友

分类: LINUX

2009-10-08 14:54:34

安装msmtp
wget http://ncu.dl.sourceforge.net/project/msmtp/msmtp/1.4.18/msmtp-1.4.18.tar.bz2
tar xjvf msmtp-1.4.18.tar.bz2
cd msmtp-1.4.18
./configure --prefix=/usr/local/msmtp
make
make install
mkdir -p /usr/local/msmtp/mail/.certs
vi /usr/local/msmtp/certs/Thawte_Premium_Server_CA.pem
-----BEGIN CERTIFICATE-----
MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT
DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs
dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE
AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl
ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT
AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU
VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2
aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ
cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2
aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh
Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/
qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm
SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf
8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t
UCemDaYj+bvLpgcUQg==
-----END CERTIFICATE-----
touch /usr/local/msmtp/msmtp.log
vi ~/.msmtprc
~/.msmtprc 为用户配置文件
/usr/local/msmtp/etc/msmtprc 为全局配置文件
account default
host smtp.gmail.com
port 587
from
tls on
tls_starttls on
tls_trust_file /usr/local/msmtp/certs/Thawte_Premium_Server_CA.pem
auth on
user lantu.get
password 123123qwe
logfile /usr/local/msmtp/msmtp.log
测试msmtp
/usr/local/msmtp/bin/msmtp
输入邮件内容
ctrl+d结束
查看/usr/local/msmtp/msmtp.log是否发送成功 然后登陆邮箱查看是否收到邮件
安装mutt
wget ftp://ftp.mutt.org/mutt/devel/mutt-1.5.20.tar.gz
tar zxvf mutt-1.5.20.tar.gz
cd mutt-1.5.20
./configure --prefix=/usr/local/mutt
make && make install
vi ~/.muttrc
~/.muttrc 为用户配置文件
/usr/local/mutt/etc/Muttrc 为全局配置文件
set sendmail="/usr/local/msmtp/bin/msmtp"
set realname="发件人名称(非邮箱登录名)"
set use_from=yes
set editor="vi"
测试mutt+msmtp
echo "邮件内容" | /usr/local/mutt/bin/mutt -s "邮件主题" -c

命令解释:
发送内容为 "邮件内容" 标题为 "邮件主题" 的邮件到 同时抄送
阅读(4570) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~