diff --git a/test_smtp_fix.py b/test_smtp_fix.py index 071b6d1..7710527 100644 --- a/test_smtp_fix.py +++ b/test_smtp_fix.py @@ -133,9 +133,9 @@ def check_mailbox_exists(api_base_url, email_address): logger.info(f"检查/创建邮箱: {create_url}") response = requests.get(create_url) - if response.status_code == 200: - result = response.json() - if result.get('success'): + if response.status_code in [200, 201]: # 同时接受200和201状态码 + result = response.json() if response.content else {'success': True} + if result.get('success', True): # 默认为True,因为201状态可能没有返回JSON logger.info(f"邮箱检查/创建成功: {email_address}") return True, None else: