Skip to content

Instantly share code, notes, and snippets.

@ptaylor
Last active March 1, 2022 10:17
Show Gist options
  • Save ptaylor/5ce8144a8ff2600c968609ecd30aa6ff to your computer and use it in GitHub Desktop.
Save ptaylor/5ce8144a8ff2600c968609ecd30aa6ff to your computer and use it in GitHub Desktop.
SMTP server that writes emails to the console.
#!/bin/sh
cat << __EOF__ | sudo /usr/bin/env python3
PORT=25
HOST='localhost'
import smtpd, asyncore
server = smtpd.DebuggingServer((HOST, PORT), None)
print(f"[SMTP {HOST}:{PORT}]")
print("[waiting for email]")
asyncore.loop()
__EOF__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment