MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / delete_email

Method delete_email

src/services/temp_mail.py:902–932  ·  view source on GitHub ↗

删除邮箱 Note: 当前 TempMail admin API 文档未见删除地址接口,这里先从本地缓存移除, 以满足统一接口并避免服务实例化失败。

(self, email_id: str)

Source from the content-addressed store, hash-verified

900 return list(self._email_cache.values())
901
902 def delete_email(self, email_id: str) -> bool:
903 """
904 删除邮箱
905
906 Note:
907 当前 TempMail admin API 文档未见删除地址接口,这里先从本地缓存移除,
908 以满足统一接口并避免服务实例化失败。
909 """
910 removed = False
911 emails_to_delete = []
912
913 for address, info in self._email_cache.items():
914 candidate_ids = {
915 address,
916 info.get("id"),
917 info.get("service_id"),
918 }
919 if email_id in candidate_ids:
920 emails_to_delete.append(address)
921
922 for address in emails_to_delete:
923 self._email_cache.pop(address, None)
924 removed = True
925
926 if removed:
927 logger.info(f"已从 TempMail 缓存移除邮箱: {email_id}")
928 self.update_status(True)
929 else:
930 logger.info(f"TempMail 缓存中未找到邮箱: {email_id}")
931
932 return removed
933
934 def check_health(self) -> bool:
935 """检查服务健康状态"""

Callers

nothing calls this directly

Calls 3

infoMethod · 0.80
getMethod · 0.45
update_statusMethod · 0.45

Tested by

no test coverage detected