fix: improve SMTP configuration and error handling
- Change default use_tls from True to False to match typical STARTTLS setup - Add MailDeliveryError exception for mail delivery failures - Wrap send_mail calls in try-catch blocks to handle errors gracefully - Return 502 status code with error details when mail delivery fails - Add SMTP security mode selector in frontend (STARTTLS/TLS/None) - Add test mail form to admin panel - Handle empty SMTP credentials properly in update_mail_settings - Catch
This commit is contained in:
@@ -139,7 +139,7 @@ class MailSettingsIn(BaseModel):
|
||||
smtp_port: int = Field(default=587, ge=1, le=65535)
|
||||
smtp_user: str | None = Field(default=None, max_length=220)
|
||||
smtp_password: str | None = Field(default=None, max_length=1000)
|
||||
use_tls: bool = True
|
||||
use_tls: bool = False
|
||||
use_starttls: bool = True
|
||||
sender_address: EmailStr | None = None
|
||||
sender_name: str = Field(default="NexaPantry", max_length=160)
|
||||
|
||||
Reference in New Issue
Block a user