Ubuntu服务器配置qq邮箱发送信息

编程入门 行业动态 更新时间:2024-10-26 22:21:50

Ubuntu<a href=https://www.elefans.com/category/jswz/34/1743265.html style=服务器配置qq邮箱发送信息"/>

Ubuntu服务器配置qq邮箱发送信息

效果:

此处设置的是自己给自己发送,配合linux的cron实现定时触发发送事件的效果

实现过程:

  1. 安装邮箱客户端Postfix
sudo apt-get install postfix
  1. 配置Postfix:编辑Postfix的主要配置文件 /etc/postfix/main.cf,并在最后添加以下参数:
relayhost = [smtp.qq]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
maillog_file = /var/log/mail.log
debug_peer_level = 2
  1. 创建和配置 /etc/postfix/sasl_passwd 文件
    将您的 QQ 邮箱用户名和授权码替换为实际信息
[smtp.qq]:587  your_qq_email@qq:your_authorization_code
  1. 确保文件可被读取
sudo chmod 600 /etc/postfix/sasl_passwd
  1. 生成 sasl_passwd 文件的哈希映射:
sudo postmap /etc/postfix/sasl_passwd
  1. 重新加载 Postfix 配置:
sudo systemctl reload postfix
  1. 测试结果
    echo “This is a test email” | mail -s “Test Email” -r custom_email@example example@qq

我这里讲以上两个邮箱地址都设置成了自己的

如遇到问题可执行

sudo cat /var/log/mail.log

查看日志获取进一步信息

更多推荐

Ubuntu服务器配置qq邮箱发送信息

本文发布于:2023-12-06 05:34:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1666596.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器配置   邮箱   信息   Ubuntu   qq

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!