calendar: use himalaya wrapper for email sending (defense-in-depth)
cal_tool.py now calls himalaya.sh wrapper instead of himalaya directly, so recipients are validated at both the calendar layer (contacts.py resolve) and the himalaya layer (wrapper header parsing).
This commit is contained in:
@@ -65,9 +65,12 @@ def _sync_calendar():
|
|||||||
print("Warning: CalDAV sync failed (will retry on next heartbeat)")
|
print("Warning: CalDAV sync failed (will retry on next heartbeat)")
|
||||||
|
|
||||||
|
|
||||||
|
HIMALAYA_WRAPPER = Path(__file__).resolve().parent.parent.parent / "himalaya" / "scripts" / "himalaya.sh"
|
||||||
|
|
||||||
|
|
||||||
def _send_email(email_str, account=None):
|
def _send_email(email_str, account=None):
|
||||||
"""Send a raw MIME email via himalaya message send (stdin)."""
|
"""Send a raw MIME email via himalaya wrapper (validates recipients)."""
|
||||||
cmd = ["himalaya"]
|
cmd = [str(HIMALAYA_WRAPPER)]
|
||||||
if account:
|
if account:
|
||||||
cmd += ["--account", account]
|
cmd += ["--account", account]
|
||||||
cmd += ["message", "send"]
|
cmd += ["message", "send"]
|
||||||
|
|||||||
Reference in New Issue
Block a user