1. 首页 > 云服务器

树莓派 msmtp和mutt 的安装和配置教程

1,安装mutt

sudo apt-get install mutt

2,安装msmtp

sudo apt-get install msmtp

3,设置mutt

?

1

2

3

4

5

6

7

8

9

10

11

12

13
/etc/Muttrc   # 系统全局设置

~/.muttrc    # 使用某个系统用户

raspberrypi# vim ~/.muttrc

set sendmail="/usr/bin/msmtp"

set use_from=yes

set realname="name_post" # 发件人昵称

set editor="vi"

set from=xxx@xxxx.com    # 发件人邮箱

set envelope_from=yes

set crypt_use_gpgme=no

#tls off

4,设置msmtp

创建 ~/.msmtprc 和 ~/.msmtp.log 分别为配置和日志文件

?

1

2

3

4

5

6

7

8
raspberrypi# vim ~/.msmtprc

account default

host smtp.xxxx.com  # 可在邮箱设置中查看

user xxxx # 一定要是邮箱@前的部分

from xxxx@xxxx.com

password 123456 # 邮箱密码(有可能为授权码)

auth plain

logfile ~/.msmtp.log

5,查看SMTP服务器是否支持认证的TLS加密

?

1

2

3

4

5

6

7

8

9

10
raspberrypi# msmtp --host=smtp.sina.com --serverinfo

SMTP server at smtp.sina.com (xk-6-242-a8.bta.net.cn [202.108.6.242]), port 25:

smtp-5-121.smtpsmail.fmail.xd.sinanode.com ESMTP

Capabilities:

STARTTLS:

Support for TLS encryption via the STARTTLS command

AUTH:

Supported authentication methods:

PLAIN LOGIN

This server might advertise more or other capabilities when TLS is active.

可见支持认证(若不支持取消注释.muttrc中的最后一项,未亲测,一般都支持)。

6,测试发邮件

echo 正文 | mutt -s 主题 xxxx@xx.com -a 附件

总结

以上所述是小编给大家介绍的树莓派 msmtp和mutt 的安装和配置教程,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对快网idc网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

原文链接:https://www.cnblogs.com/Amadues-blogs/archive/2019/07/03/11127073.html

本文由服务器主机测评网发布,不代表服务器主机测评网立场,转载联系作者并注明出处:https://www.kuaiidc.com/fuwuqi/2451.html

联系我们

在线咨询:点击这里给我发消息

Q Q:1524578900