mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-04-26 06:15:52 +03:00
[GH-ISSUE #219] [BUG]通过wordpress使用smtp发邮件时报错 #70
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cloudflare_temp_email#70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @KunBuFenZi on GitHub (May 9, 2024).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/219
复现步骤
wp mail smtp插件进行发件测试 smtp服务端收到请求 但报错2024-05-09 08:27:14,128 - main - ERROR - Failed to send mail code=[500] text=[Internal Server Error],不过实际上发送成功,且tempmail站里有记录
预期行为
应无报错
部署方式
浏览器环境
edge 124.0.2478.80 (正式版本) (64 位)
@dreamhunter2333 commented on GitHub (May 9, 2024):
可以看下 worker 后台的日志么
@KunBuFenZi commented on GitHub (May 9, 2024):
看了下 worker好像不记录历史日志 然后我部署wp的那台机子今天被我玩崩了 得等老师去那边开机 开机了我一定第一时间试一下
@KunBuFenZi commented on GitHub (May 10, 2024):
下面是worker的日志(把ip删了)
{ "outcome": "ok", "scriptVersion": { "id": "32242c1c-a8a0-4fb3-aa80-f65cc8aeb9ce" }, "scriptName": "cloudflare_temp_email", "diagnosticsChannelEvents": [], "exceptions": [], "logs": [ { "message": [ "202 Accepted: null\n" ], "level": "log", "timestamp": 1715331393106 }, { "message": [ "Error: Context is not finalized. You may forget returning Response object orawait next()" ], "level": "error", "timestamp": 1715331393639 } ], "eventTimestamp": 1715331391554, "event": { "request": { "url": "https://tempapi.kbfz.cc/external/api/send_mail", "method": "POST", "headers": { "accept": "*/*", "accept-encoding": "gzip, br", "cf-connecting-ip": "", "cf-ipcountry": "JP", "cf-ray": "8818b76d1ecc7362", "cf-visitor": "{\"scheme\":\"https\"}", "connection": "Keep-Alive", "content-length": "3010", "content-type": "application/json", "host": "tempapi.kbfz.cc", "user-agent": "python-requests/2.31.0", "x-forwarded-proto": "https", "x-real-ip": "" }, "cf": { "clientTcpRtt": 1, "longitude": "139.68990", "httpProtocol": "HTTP/1.1", "tlsCipher": "AEAD-AES256-GCM-SHA384", "continent": "AS", "asn": 61112, "clientAcceptEncoding": "gzip, deflate", "country": "JP", "tlsClientExtensionsSha1": "tlH5gnoC5Z1HF45J5OgHEi338V0=", "verifiedBotCategory": "", "tlsClientAuth": { "certIssuerDNLegacy": "", "certIssuerSKI": "", "certSubjectDNRFC2253": "", "certSubjectDNLegacy": "", "certFingerprintSHA256": "", "certNotBefore": "", "certSKI": "", "certSerial": "", "certIssuerDN": "", "certVerified": "NONE", "certNotAfter": "", "certSubjectDN": "", "certPresented": "0", "certRevoked": "0", "certIssuerSerial": "", "certIssuerDNRFC2253": "", "certFingerprintSHA1": "" }, "tlsExportedAuthenticator": { "clientFinished": "398d60001435a5a295c31346e912e3be6707453eb002aa6cad0a9781946afe5baecc5eb9bbb8e153e50f9f3132f3f3a7", "clientHandshake": "fdfdda96a1c5adb0cbbbd3025d2876a8fa47cc890eff8a6ac769bb4961419fd822e40a5d1f32558e1bd5078f47d9314f", "serverHandshake": "e7663a377281e89be9493d3f46ef1c2f63d6116b963c3161ceebcbe094eeede78d1c3d7749f94caa0e536dc33e5388eb", "serverFinished": "6db536130d81f01d2a456fe7e5bb344711715b057975fdd6aa75fb6be928e6c02ffaa721e573d9ae930e49f8ed5e241f" }, "tlsVersion": "TLSv1.3", "city": "Tokyo", "timezone": "Asia/Tokyo", "colo": "NRT", "tlsClientHelloLength": "508", "edgeRequestKeepAliveStatus": 1, "postalCode": "151-0053", "region": "Tokyo", "latitude": "35.68930", "requestPriority": "", "regionCode": "13", "asOrganization": "Akile", "tlsClientRandom": "+5lLQtJL91ltM7lxrLeNJJfcvq464DzY5x1CftIzow4=" } }, "response": { "status": 500 } }, "id": 0 }此外 还有一个问题 就是wordpress走这里的smtp好像会乱码 而走正常的邮箱smtp不会 下面是同一封邮件走本项目smtp和QQ邮箱smtp发出的内容对比
QQ:

本项目:

@dreamhunter2333 commented on GitHub (May 10, 2024):
我修复下,代码有些问题,邮件乱码看起来是变成 Unicode 了,我测试下
@dreamhunter2333 commented on GitHub (May 10, 2024):
临时加了下 decode 不同 charset 的代码,可以再测试下
@KunBuFenZi commented on GitHub (May 11, 2024):
换了新的server.py但是 依旧发出的还是乱码
2024-05-11 04:16:49,411 - main - INFO - Starting server settings[proxy_url='xxx' port=8025]
2024-05-11 04:17:19,488 - mail.log - WARNING - Session.login_data is deprecated and will be removed in version 2.0
2024-05-11 04:17:19,761 - main - INFO - handle_DATA from admin@gpus.top to ['xxx']
2024-05-11 04:17:19,763 - main - INFO - Parsed mail from 智慧教师 to {'xxx': ''}
2024-05-11 04:17:19,763 - main - INFO - Send mail {'token': '***', 'from_name': '智慧教师', 'to_name': '', 'to_mail': 'xxx', 'subject': '[智慧教师] 测试邮件', 'is_html': True, 'content': '\r\n\t
\r\n\t\t\t\t\t
\u8fd9\u662f\u4e00\u5c01\u6765\u81ea\u667a\u6167\u6559\u5e08[https://test.gpus.top]\u7684\u6d4b\u8bd5\u90ae\u4ef6
\u8be5\u90ae\u4ef6\u7531\u7f51\u7ad9\u540e\u53f0\u53d1\u51fa\uff0c\u5982\u679c\u975e\u60a8\u672c\u4eba\u64cd\u4f5c\uff0c\u8bf7\u5ffd\u7565\u6b64\u90ae\u4ef6
2024-05-11 16:17:19\r\n\t\t\t\t\t
2024-05-11 04:17:22,037 - main - ERROR - Failed to send mail code=[500] text=[Internal Server Error]
@dreamhunter2333 commented on GitHub (May 11, 2024):
看起来是编码问题,我复现下看看怎么修复
@dreamhunter2333 commented on GitHub (May 16, 2024):
更新了main分支的代码,我测试没问题了,麻烦测试下
@KunBuFenZi commented on GitHub (May 17, 2024):
好的 谢谢 我今晚试试
@KunBuFenZi commented on GitHub (May 17, 2024):
可以了! 谢谢大佬!!!!!!!!!