#!/usr/bin/env python3 """Send home router backup README via SMTP.""" import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.application import MIMEApplication pw = open("/root/.config/himalaya/g-germainebrown.pass").read().strip() msg = MIMEMultipart() msg["From"] = "g@germainebrown.com" msg["To"] = "g@germainebrown.com" msg["Subject"] = "Home Router Backup — README + Procedure" body = MIMEText( "Attached: Home Router Backup README with full backup/restore procedure.\n" "Router: CCR2004-16G-2S+ (RouterOS 7.18.2)\n" "Auth: Ed25519 SSH key (wisp_rsa)\n" "Tunnel: L2TP/IPsec via Hetzner VPS\n" ) msg.attach(body) # Attach the README with open("/root/.hermes/backups/home-router/README.md") as f: att = MIMEApplication(f.read(), _subtype="markdown") att.add_header("Content-Disposition", "attachment", filename="Home-Router-Backup-Procedure.md") msg.attach(att) with smtplib.SMTP("mail.germainebrown.com", 2525) as s: s.starttls() s.login("g@germainebrown.com", pw) s.send_message(msg) print("README emailed successfully")