Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过go调用stmp发送邮件经常会提示write: broken pipe #182

Open
4 tasks done
zhuangpeng opened this issue Jul 31, 2024 · 2 comments
Open
4 tasks done

通过go调用stmp发送邮件经常会提示write: broken pipe #182

zhuangpeng opened this issue Jul 31, 2024 · 2 comments

Comments

@zhuangpeng
Copy link

完整性要求 / Integrity requirements

  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
  • 我搜索了issues,没有发现已提出的类似问题。
  • 我已经阅读了项目Readme常见问题

版本

Server Version: v2.6.2

描述

使用了go内置的smtp调用邮箱发送邮件,经常会提示tcp断开链接。
mtp/server 2024/07/31 14:44:52 error handling 123.254.109.176:45204: read tcp 172.30.0.2:465->123.254.109.176:45204: read: connection reset by peer
smtp/server 2024/07/31 14:44:53 error handling 123.254.109.176:45228: read tcp 172.30.0.2:465->123.254.109.176:45228: read: connection reset by peer
smtp/server 2024/07/31 14:44:55 error handling 123.254.109.176:45736: read tcp 172.30.0.2:465->123.254.109.176:45736: read: connection reset by peer
smtp/server 2024/07/31 14:44:57 error handling 123.254.109.176:47240: read tcp 172.30.0.2:465->123.254.109.176:47240: read: connection reset by peer
smtp/server 2024/07/31 14:44:58 error handling 123.254.109.176:50616: read tcp 172.30.0.2:465->123.254.109.176:50616: read: connection reset by peer
smtp/server 2024/07/31 14:44:58 error handling 123.254.109.176:51476: tls: client offered only unsupported versions: [302 301]
smtp/server 2024/07/31 14:45:01 error handling 123.254.109.176:54404: read tcp 172.30.0.2:465->123.254.109.176:54404: read: connection reset by peer
smtp/server 2024/07/31 14:45:04 error handling 123.254.109.176:55366: read tcp 172.30.0.2:465->123.254.109.176:55366: read: connection reset by peer
smtp/server 2024/07/31 14:45:05 error handling 123.254.109.176:58338: EOF
smtp/server 2024/07/31 14:45:05 error handling 123.254.109.176:59594: read tcp 172.30.0.2:465->123.254.109.176:59594: read: connection reset by peer

重现方式

使用go内置的smtp调用pmail进行邮件发送。

服务端配置


腾讯云 4核 8G

服务端日志


smtp/server 2024/07/31 02:31:57 error handling 87.236.176.119:53019: read tcp 172.30.0.2:465->87.236.176.119:53019: i/o timeout
smtp/server 2024/07/31 02:32:08 error handling 142.93.191.98:48161: read tcp 172.30.0.2:465->142.93.191.98:48161: i/o timeout
smtp/server 2024/07/31 02:59:22 error handling 167.94.145.98:42008: tls: client offered only unsupported versions: [302 301]
smtp/server 2024/07/31 02:59:24 error handling 167.94.145.98:42040: tls: client offered only unsupported versions: [301]
smtp/server 2024/07/31 02:59:25 error handling 167.94.145.98:42072: tls: client offered only unsupported versions: []
smtp/server 2024/07/31 05:16:33 error handling 199.45.154.153:42480: read tcp 172.30.0.2:465->199.45.154.153:42480: read: connection reset by peer
smtp/server 2024/07/31 05:16:34 error handling 199.45.154.153:42496: read tcp 172.30.0.2:465->199.45.154.153:42496: read: connection reset by peer
smtp/server 2024/07/31 05:16:35 error handling 199.45.154.153:42498: read tcp 172.30.0.2:465->199.45.154.153:42498: read: connection reset by peer
smtp/server 2024/07/31 05:16:37 error handling 199.45.154.153:53546: read tcp 172.30.0.2:465->199.45.154.153:53546: read: connection reset by peer
smtp/server 2024/07/31 05:16:38 error handling 199.45.154.153:53558: read tcp 172.30.0.2:465->199.45.154.153:53558: read: connection reset by peer
smtp/server 2024/07/31 05:16:39 error handling 199.45.154.153:53566: tls: client offered only unsupported versions: [302 301]
smtp/server 2024/07/31 05:16:41 error handling 199.45.154.153:53568: read tcp 172.30.0.2:465->199.45.154.153:53568: read: connection reset by peer
smtp/server 2024/07/31 05:16:41 error handling 199.45.154.153:53578: read tcp 172.30.0.2:465->199.45.154.153:53578: read: connection reset by peer
smtp/server 2024/07/31 05:16:42 error handling 199.45.154.153:53594: read tcp 172.30.0.2:465->199.45.154.153:53594: read: connection reset by peer
smtp/server 2024/07/31 05:16:43 error handling 199.45.154.153:53600: read tcp 172.30.0.2:465->199.45.154.153:53600: read: connection reset by peer
smtp/server 2024/07/31 11:22:19 error handling 172.169.109.46:44490: tls: first record does not look like a TLS handshake
smtp/server 2024/07/31 12:26:16 error handling 167.94.146.56:60048: tls: client offered only unsupported versions: [302 301]
smtp/server 2024/07/31 12:26:18 error handling 167.94.146.56:60086: tls: client offered only unsupported versions: [301]
smtp/server 2024/07/31 12:26:20 error handling 167.94.146.56:35042: tls: client offered only unsupported versions: []
smtp/server 2024/07/31 12:31:34 error handling 172.202.178.64:50306: tls: first record does not look like a TLS handshake
smtp/server 2024/07/31 12:59:37 error handling 185.91.127.9:43086: tls: first record does not look like a TLS handshake
[error][2024-07-31 13:29:01][ac1e000266a9cb9d1c89000112a757b0][/work/services/list/list.go:28]SQL ERROR: select e.*,ue.is_read from email e left join user_email ue on e.id=ue.email_id where ue.user_id = ?  and ue.status != 3 and type =?  order by e.id desc LIMIT 10 OFFSET 0  ,Error:pq: column "e.id" must appear in the GROUP BY clause or be used in an aggregate function
smtp/server 2024/07/31 13:42:22 error handling 198.235.24.118:59982: tls: first record does not look like a TLS handshake
smtp/server 2024/07/31 14:44:19 error handling 123.254.109.176:57030: EOF
smtp/server 2024/07/31 14:44:51 error handling 123.254.109.176:45056: tls: first record does not look like a TLS handshake
smtp/server 2024/07/31 14:44:52 error handling 123.254.109.176:45204: read tcp 172.30.0.2:465->123.254.109.176:45204: read: connection reset by peer
smtp/server 2024/07/31 14:44:53 error handling 123.254.109.176:45228: read tcp 172.30.0.2:465->123.254.109.176:45228: read: connection reset by peer
smtp/server 2024/07/31 14:44:55 error handling 123.254.109.176:45736: read tcp 172.30.0.2:465->123.254.109.176:45736: read: connection reset by peer
smtp/server 2024/07/31 14:44:57 error handling 123.254.109.176:47240: read tcp 172.30.0.2:465->123.254.109.176:47240: read: connection reset by peer
smtp/server 2024/07/31 14:44:58 error handling 123.254.109.176:50616: read tcp 172.30.0.2:465->123.254.109.176:50616: read: connection reset by peer
smtp/server 2024/07/31 14:44:58 error handling 123.254.109.176:51476: tls: client offered only unsupported versions: [302 301]
smtp/server 2024/07/31 14:45:01 error handling 123.254.109.176:54404: read tcp 172.30.0.2:465->123.254.109.176:54404: read: connection reset by peer
smtp/server 2024/07/31 14:45:04 error handling 123.254.109.176:55366: read tcp 172.30.0.2:465->123.254.109.176:55366: read: connection reset by peer
smtp/server 2024/07/31 14:45:05 error handling 123.254.109.176:58338: EOF
smtp/server 2024/07/31 14:45:05 error handling 123.254.109.176:59594: read tcp 172.30.0.2:465->123.254.109.176:59594: read: connection reset by peer
/code>
@Jinnrry
Copy link
Owner

Jinnrry commented Aug 2, 2024

用的什么数据库?

@Jinnrry
Copy link
Owner

Jinnrry commented Aug 2, 2024

看日志,有一个sql报错,但这应该是查询邮件的sql,与发件无关。

剩下的有很多连接断开的报错,也看不出具体原因。有具体一些的日志吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants