Jinnrry / PMail

Private EMail Server
GNU General Public License v2.0
1.41k stars 129 forks source link

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

Open zhuangpeng opened 1 month ago

zhuangpeng commented 1 month ago

完整性要求 / Integrity requirements

版本

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 commented 1 month ago

用的什么数据库?

Jinnrry commented 1 month ago

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

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