Skip to content

Instantly share code, notes, and snippets.

@nysean79
Created January 19, 2012 14:36
Show Gist options
  • Save nysean79/1640347 to your computer and use it in GitHub Desktop.
Save nysean79/1640347 to your computer and use it in GitHub Desktop.
SMTP relay test script
#!/usr/bin/env bash
## Version 1.0.2
my_email_body="Test from telnet"
mail_server_ip="127.0.0.1"
mail_server_port="25"
recipient="[email protected]"
sender="\"Ubuntu Server\"<[email protected]>"
nc ${mail_server_ip} ${mail_server_port} << EOF
ehlo example.com
mail from:${sender}
rcpt to:${recipient}
data
From:${sender}
To:${recipient}
subject: Telnet test
${my_email_body}
.
quit
EOF
@omexlu
Copy link

omexlu commented Jan 13, 2021

This don't work anymore i get:
550 5.5.1 Protocol error
554 5.5.1 Error: no valid recipients

For few days it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment