mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: verify SMTP TLS in send_message_tool
Add regression coverage for the standalone email send path and pass an explicit default SSL context to STARTTLS for certificate verification, matching the gateway email adapter hardening salvaged from PR #994.
This commit is contained in:
parent
344adc72a1
commit
71cffbfa4f
2 changed files with 6 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import json
|
|||
import logging
|
||||
import os
|
||||
import re
|
||||
import ssl
|
||||
import time
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
@ -432,7 +433,7 @@ async def _send_email(extra, chat_id, message):
|
|||
msg["Subject"] = "Hermes Agent"
|
||||
|
||||
server = smtplib.SMTP(smtp_host, smtp_port)
|
||||
server.starttls()
|
||||
server.starttls(context=ssl.create_default_context())
|
||||
server.login(address, password)
|
||||
server.send_message(msg)
|
||||
server.quit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue