已解决
Ubuntu服务器配置qq邮箱发送信息
来自网友在路上 182882提问 提问时间:2023-10-22 07:08:18阅读次数: 82
最佳答案 问答题库828位专家为你答疑解惑
效果:
此处设置的是自己给自己发送,配合linux的cron实现定时触发发送事件的效果
实现过程:
- 安装邮箱客户端Postfix
sudo apt-get install postfix
- 配置Postfix:编辑Postfix的主要配置文件 /etc/postfix/main.cf,并在最后添加以下参数:
relayhost = [smtp.qq.com]: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
- 创建和配置 /etc/postfix/sasl_passwd 文件
将您的 QQ 邮箱用户名和授权码替换为实际信息
[smtp.qq.com]:587 your_qq_email@qq.com:your_authorization_code
- 确保文件可被读取
sudo chmod 600 /etc/postfix/sasl_passwd
- 生成 sasl_passwd 文件的哈希映射:
sudo postmap /etc/postfix/sasl_passwd
- 重新加载 Postfix 配置:
sudo systemctl reload postfix
- 测试结果
echo “This is a test email” | mail -s “Test Email” -r custom_email@example.com example@qq.com
我这里讲以上两个邮箱地址都设置成了自己的
如遇到问题可执行
sudo cat /var/log/mail.log
查看日志获取进一步信息
查看全文
99%的人还看了
相似问题
猜你感兴趣
版权申明
本文"Ubuntu服务器配置qq邮箱发送信息":http://eshow365.cn/6-21422-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!