[GH-ISSUE #268] [BUG] smtp配置问题 #83

Closed
opened 2026-02-26 20:35:32 +03:00 by kerem · 5 comments
Owner

Originally created by @jakernel on GitHub (May 24, 2024).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/268

使用 docker 部署了 smtp 服务。然后 thunderbird 添加账号后,收发邮件会报错,不知道哪里配置错了
image

查看 docker 的日志显示如下:

Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 1078, in _runCallbacks
    current.result = callback(  # type: ignore[misc]
  File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 803, in __cbDispatch
    self.__doCommand(tag, fn, args, parseargs, rest, uid)
  File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 796, in __doCommand
    handler(uid=uid, *args)
  File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 2059, in do_FETCH
    maybeDeferred(self.mbox.fetch, messages, uid=uid).addCallback(
---  ---
  File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 212, in maybeDeferred
    result = f(*args, **kwargs)
  File "/app/imap_server.py", line 109, in fetch
    return self.fetchINBOX(messages)
  File "/app/imap_server.py", line 120, in fetchINBOX
    res = httpx.get(
  File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 198, in get
    return request(
  File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 106, in request
    return client.request(
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 827, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'xxx.xxx.workers.dev'. (_ssl.c:1000)
Originally created by @jakernel on GitHub (May 24, 2024). Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/268 使用 docker 部署了 smtp 服务。然后 thunderbird 添加账号后,收发邮件会报错,不知道哪里配置错了 ![image](https://github.com/dreamhunter2333/cloudflare_temp_email/assets/1704664/06342d72-2b4c-4db2-b757-376ed3581fe2) 查看 docker 的日志显示如下: ``` Unhandled Error Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 1078, in _runCallbacks current.result = callback( # type: ignore[misc] File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 803, in __cbDispatch self.__doCommand(tag, fn, args, parseargs, rest, uid) File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 796, in __doCommand handler(uid=uid, *args) File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 2059, in do_FETCH maybeDeferred(self.mbox.fetch, messages, uid=uid).addCallback( --- --- File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 212, in maybeDeferred result = f(*args, **kwargs) File "/app/imap_server.py", line 109, in fetch return self.fetchINBOX(messages) File "/app/imap_server.py", line 120, in fetchINBOX res = httpx.get( File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 198, in get return request( File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 106, in request return client.request( File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 827, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 914, in send response = self._send_handling_auth( File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth response = self._send_handling_redirects( File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects response = self._send_single_request(request) File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request response = transport.handle_request(request) File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request with map_httpcore_exceptions(): File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ self.gen.throw(value) File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'xxx.xxx.workers.dev'. (_ssl.c:1000) ```
kerem closed this issue 2026-02-26 20:35:32 +03:00
Author
Owner

@dreamhunter2333 commented on GitHub (May 24, 2024):

使用 docker 部署了 smtp 服务。然后 thunderbird 添加账号后,收发邮件会报错,不知道哪里配置错了

image

查看 docker 的日志显示如下:


Unhandled Error

Traceback (most recent call last):

  File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 1078, in _runCallbacks

    current.result = callback(  # type: ignore[misc]

  File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 803, in __cbDispatch

    self.__doCommand(tag, fn, args, parseargs, rest, uid)

  File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 796, in __doCommand

    handler(uid=uid, *args)

  File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 2059, in do_FETCH

    maybeDeferred(self.mbox.fetch, messages, uid=uid).addCallback(

---  ---

  File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 212, in maybeDeferred

    result = f(*args, **kwargs)

  File "/app/imap_server.py", line 109, in fetch

    return self.fetchINBOX(messages)

  File "/app/imap_server.py", line 120, in fetchINBOX

    res = httpx.get(

  File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 198, in get

    return request(

  File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 106, in request

    return client.request(

  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 827, in request

    return self.send(request, auth=auth, follow_redirects=follow_redirects)

  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 914, in send

    response = self._send_handling_auth(

  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth

    response = self._send_handling_redirects(

  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects

    response = self._send_single_request(request)

  File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request

    response = transport.handle_request(request)

  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request

    with map_httpcore_exceptions():

  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__

    self.gen.throw(value)

  File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions

    raise mapped_exc(message) from exc

httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'xxx.xxx.workers.dev'. (_ssl.c:1000)

目前还不支持ssl ,需要勾选非 ssl链接

<!-- gh-comment-id:2129470202 --> @dreamhunter2333 commented on GitHub (May 24, 2024): > 使用 docker 部署了 smtp 服务。然后 thunderbird 添加账号后,收发邮件会报错,不知道哪里配置错了 > > ![image](https://github.com/dreamhunter2333/cloudflare_temp_email/assets/1704664/06342d72-2b4c-4db2-b757-376ed3581fe2) > > > > 查看 docker 的日志显示如下: > > ``` > > Unhandled Error > > Traceback (most recent call last): > > File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 1078, in _runCallbacks > > current.result = callback( # type: ignore[misc] > > File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 803, in __cbDispatch > > self.__doCommand(tag, fn, args, parseargs, rest, uid) > > File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 796, in __doCommand > > handler(uid=uid, *args) > > File "/usr/local/lib/python3.12/site-packages/twisted/mail/imap4.py", line 2059, in do_FETCH > > maybeDeferred(self.mbox.fetch, messages, uid=uid).addCallback( > > --- --- > > File "/usr/local/lib/python3.12/site-packages/twisted/internet/defer.py", line 212, in maybeDeferred > > result = f(*args, **kwargs) > > File "/app/imap_server.py", line 109, in fetch > > return self.fetchINBOX(messages) > > File "/app/imap_server.py", line 120, in fetchINBOX > > res = httpx.get( > > File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 198, in get > > return request( > > File "/usr/local/lib/python3.12/site-packages/httpx/_api.py", line 106, in request > > return client.request( > > File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 827, in request > > return self.send(request, auth=auth, follow_redirects=follow_redirects) > > File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 914, in send > > response = self._send_handling_auth( > > File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 942, in _send_handling_auth > > response = self._send_handling_redirects( > > File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 979, in _send_handling_redirects > > response = self._send_single_request(request) > > File "/usr/local/lib/python3.12/site-packages/httpx/_client.py", line 1015, in _send_single_request > > response = transport.handle_request(request) > > File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 232, in handle_request > > with map_httpcore_exceptions(): > > File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__ > > self.gen.throw(value) > > File "/usr/local/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions > > raise mapped_exc(message) from exc > > httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'xxx.xxx.workers.dev'. (_ssl.c:1000) > > ``` 目前还不支持ssl ,需要勾选非 ssl链接
Author
Owner

@dreamhunter2333 commented on GitHub (May 24, 2024):

你能使用 api 访问后台服务么,看起来像无法访问 worker api

<!-- gh-comment-id:2129628551 --> @dreamhunter2333 commented on GitHub (May 24, 2024): 你能使用 api 访问后台服务么,看起来像无法访问 worker api
Author
Owner

@jakernel commented on GitHub (May 27, 2024):

你能使用 api 访问后台服务么,看起来像无法访问 worker api

可以的,api可以正常访问 https://xxx.xxx.workers.dev 收取邮件,但是smtp下调用到 fetchINBOX 这个接口时,
却会抛出 ssl 证书异常

<!-- gh-comment-id:2132516135 --> @jakernel commented on GitHub (May 27, 2024): > 你能使用 api 访问后台服务么,看起来像无法访问 worker api 可以的,api可以正常访问 `https://xxx.xxx.workers.dev` 收取邮件,但是smtp下调用到 fetchINBOX 这个接口时, 却会抛出 ssl 证书异常
Author
Owner

@dreamhunter2333 commented on GitHub (May 27, 2024):

你能使用 api 访问后台服务么,看起来像无法访问 worker api

可以的,api可以正常访问 https://xxx.xxx.workers.dev 收取邮件,但是smtp下调用到 fetchINBOX 这个接口时,

却会抛出 ssl 证书异常

很奇怪,尝试过自定义域名么,我有空更新下代码,禁用ssl检查

<!-- gh-comment-id:2132592525 --> @dreamhunter2333 commented on GitHub (May 27, 2024): > > 你能使用 api 访问后台服务么,看起来像无法访问 worker api > > > > 可以的,api可以正常访问 `https://xxx.xxx.workers.dev` 收取邮件,但是smtp下调用到 fetchINBOX 这个接口时, > > 却会抛出 ssl 证书异常 很奇怪,尝试过自定义域名么,我有空更新下代码,禁用ssl检查
Author
Owner

@jakernel commented on GitHub (May 28, 2024):

你能使用 api 访问后台服务么,看起来像无法访问 worker api

可以的,api可以正常访问 https://xxx.xxx.workers.dev 收取邮件,但是smtp下调用到 fetchINBOX 这个接口时,
却会抛出 ssl 证书异常

很奇怪,尝试过自定义域名么,我有空更新下代码,禁用ssl检查

测试了自定义域名可以正常收发

<!-- gh-comment-id:2134416915 --> @jakernel commented on GitHub (May 28, 2024): > > > 你能使用 api 访问后台服务么,看起来像无法访问 worker api > > > > > > 可以的,api可以正常访问 `https://xxx.xxx.workers.dev` 收取邮件,但是smtp下调用到 fetchINBOX 这个接口时, > > 却会抛出 ssl 证书异常 > > 很奇怪,尝试过自定义域名么,我有空更新下代码,禁用ssl检查 测试了自定义域名可以正常收发
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudflare_temp_email#83
No description provided.