Created
January 19, 2012 14:36
-
-
Save nysean79/1640347 to your computer and use it in GitHub Desktop.
SMTP relay test script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.