|
18 | 18 | from .email import parse_email_recipients, send_smtp_email |
19 | 19 |
|
20 | 20 |
|
| 21 | +_GOOGLE_VOICE_SMTP_HOST = "smtp.gmail.com" |
| 22 | +_GOOGLE_VOICE_SMTP_PORT = 465 |
| 23 | +_GOOGLE_VOICE_SMTP_STARTTLS = False |
| 24 | +_GOOGLE_VOICE_SMTP_SSL = True |
| 25 | + |
| 26 | + |
21 | 27 | @dataclass(frozen=True) |
22 | 28 | class StrategyPluginGoogleVoiceSettings: |
23 | 29 | gateway_recipients: tuple[str, ...] = () |
24 | 30 | gmail_user: str | None = None |
25 | 31 | gmail_app_password: str | None = field(default=None, repr=False) |
26 | | - smtp_host: str = "smtp.gmail.com" |
27 | | - smtp_port: int = 465 |
28 | | - use_starttls: bool = False |
29 | | - use_ssl: bool = True |
30 | 32 | timeout: float = 10.0 |
31 | 33 |
|
32 | 34 | @classmethod |
@@ -276,14 +278,14 @@ def _send_message( |
276 | 278 | sent = send_notification( |
277 | 279 | subject=message.subject, |
278 | 280 | body=message.body, |
279 | | - smtp_host=settings.smtp_host, |
280 | | - smtp_port=settings.smtp_port, |
| 281 | + smtp_host=_GOOGLE_VOICE_SMTP_HOST, |
| 282 | + smtp_port=_GOOGLE_VOICE_SMTP_PORT, |
281 | 283 | sender=settings.gmail_user, |
282 | 284 | recipients=settings.gateway_recipients, |
283 | 285 | username=settings.gmail_user, |
284 | 286 | password=settings.gmail_app_password, |
285 | | - use_starttls=settings.use_starttls, |
286 | | - use_ssl=settings.use_ssl, |
| 287 | + use_starttls=_GOOGLE_VOICE_SMTP_STARTTLS, |
| 288 | + use_ssl=_GOOGLE_VOICE_SMTP_SSL, |
287 | 289 | timeout=settings.timeout, |
288 | 290 | ) |
289 | 291 | except Exception as exc: |
|
0 commit comments