mutt + msmtp 发送邮件
1。安装mutt
#emerge -v mutt
安装后在/etc/mutt/下有下面几个文件 :
localTest ~ # ls /etc/mutt/ -l
-rw-r--r-- 1 root root 771 Dec 29 12:00 Muttrc mutt配置文件
-rw-r--r-- 1 root root 114298 Dec 29 11:57 Muttrc.dist mutt参考文件
lrwxrwxrwx 1 root root 15 Dec 24 01:58 mime.types -> /etc/mime.types
-rw-r--r-- 1 root root 3162 Dec 24 01:57 mime.types.dist
Mutt安装后 配置文件Muttrc 只有最小的配置,如果需要增加配置,可以参考Muttrc.dist文件
一般配置如下:
2) 安装 msmtp
localTest # emerge -pv msmtp
编辑配置文件:
localTest mutt # nano -w /etc/msmtprc
3)测试一下mutt是否有效:
echo "测试测试" | mutt -s "测试标题" 测试邮件地址
更多参数参考:mutt --help
查看msmtp配置文件在那儿
[root@server bin]# ./msmtp --version
1。安装mutt
#emerge -v mutt
安装后在/etc/mutt/下有下面几个文件 :
localTest ~ # ls /etc/mutt/ -l
-rw-r--r-- 1 root root 771 Dec 29 12:00 Muttrc mutt配置文件
-rw-r--r-- 1 root root 114298 Dec 29 11:57 Muttrc.dist mutt参考文件
lrwxrwxrwx 1 root root 15 Dec 24 01:58 mime.types -> /etc/mime.types
-rw-r--r-- 1 root root 3162 Dec 24 01:57 mime.types.dist
Mutt安装后 配置文件Muttrc 只有最小的配置,如果需要增加配置,可以参考Muttrc.dist文件
一般配置如下:
- # Some minimal Mutt settings, Gentoo-style. These reflect the Gentoo
- # predilection for maildir folders.
- #
- # Please don't add settings to this file to change other user
- # preferences (such as colors), since those can be hard for a user to
- # undo if their preference doesn't match yours! For example, it is
- # *impossible* currently in mutt to remove color settings from objects
- # other than the index.
- set content_type="text/html"
- set charset="GBK"
- set sendmail_wait=-1
- set realname="test"
- set use_from=yes
- set mbox_type=Maildir
- set folder=~/.maildir
- set spoolfile=~/.maildir/
- set record=~/.maildir-sent/
- set move=no
- # Maybe we shouldn't set index_format here, but this is a recommended
- # one for maildir-style folders.
2) 安装 msmtp
localTest # emerge -pv msmtp
编辑配置文件:
localTest mutt # nano -w /etc/msmtprc
- # Set default values for all following accounts.
- defaults
- logfile /data/syslog/msmtp.log #-------该文件要存在,不然没有日志
- # The SMTP server of the provider.
- account test@myddz.com
- host myddz.com #发送邮件服务器名称
- from test@myddz.com #发送的邮件Email
- auth off #(关闭认证,login 需要认证)
- #user test@myddz.com #邮件服务器登录账号
- #password 119143 #邮件服务器登陆密码
- # Set a default account
- account default : test@myddz.com
3)测试一下mutt是否有效:
echo "测试测试" | mutt -s "测试标题" 测试邮件地址
更多参数参考:mutt --help
查看msmtp配置文件在那儿
[root@server bin]# ./msmtp --version