Archlinux配置邮件(以qq邮箱为例)

Archlinux配置邮件(以qq邮箱为例)

安装s-nail

sudo pacman -S s-nail

配置SMTP发送邮件

  1. 开启IMAP/SMTP服务

打开qq邮箱网页版>>设置>>帐户>>开启IMAP/SMTP服务

  1. 生成授权码

后文的密码都是指这个授权码

  1. 修改/etc/mail.rc
sudo vim /etc/mail.rc

在后面添加如下内容

set from="username@qq.com"
set smtp-auth=login
set mta=smtps://username:password@smtp.qq.com:465	#smtp服务器端口是465
set v15-compat	#必须要

password 是生成的授权码

  1. 测试
echo "this is test" | mail -s "test email" username@qq.com

配置IMAP接收查看邮件

SMTP是一个“推”的协议,它不允许根据需要从远程服务器上“拉”来消息。要做到这点,邮件客户端必须使用POP3IMAP。另一个SMTP服务器可以使用ETRN在SMTP上触发一个发送。

SMTP只能发,不能接收邮件,所以我们要借助IMAP来接收邮件.

  1. 修改/etc/mail.rc

在文件后添加如下内容

set imap-keepalive=240
set imap-cache=~/.imap_cache 
set inbox="imaps://username:password@imap.qq.com:993"
#993是imap服务器端口

这里的password也是授权码

直接运行mail命令的效果

[zcy@archlinux ~]$ mail                                                        
mail version v14.9.19.  Type `?' for help
imaps://287****712@imap.qq.com:993/INBOX: 18 messages 11 unread
 O  1 GitHub             2020-08-08 09:26  936/80293 GitHub Explore today Aug 8 
 O  2 GitHub             2020-08-09 09:26  935/81544 GitHub Explore today Aug 9 
 O  3 Microsoft ???????? 2020-08-10 09:04  151/10590 Microsoft ????????????     
 O  4 GitHub             2020-08-10 09:26  932/80918 GitHub Explore today Aug 10
 O  5 GitHub             2020-08-11 09:36  932/81524 GitHub Explore today Aug 11
>U  6 GitHub             2020-08-12 09:26     /81724 GitHub Explore today Aug 12
 U  7 GitHub             2020-08-13 09:26     /76443 GitHub Explore today Aug 13mail
 U  8 GitHub             2020-08-14 09:26     /81201 GitHub Explore today Aug 14
 O  9 GitHub             2020-08-15 09:26     /81723 GitHub Explore today Aug 15
 U 10 GitHub             2020-08-16 09:26     /81993 GitHub Explore today Aug 16
 U 11 newsletter@newslet 2020-08-17 09:12     /9768  ???????????????????????????
 U 12 GitHub             2020-08-17 09:26     /82270 GitHub Explore today Aug 17
 U 13 GitHub             2020-08-18 09:36     /82078 GitHub Explore today Aug 18
 O 14 GitHub             2020-08-19 09:26     /83414 GitHub Explore today Aug 19
 U 15 GitHub             2020-08-20 09:26     /77469 GitHub Explore today Aug 20
 U 16 GitHub             2020-08-21 09:26     /84174 GitHub Explore today Aug 21

参考:

Archlinux s-nail

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值