> From: John Jetmore [mailto:[email protected]]
> Sent: Wednesday, August 11, 2010 8:55 AM
>
> Check out
> http://lists.exim.org/lurker/message/20030514.203046.6b05039f.en.html.
>  I once wrote a quick script to do this for the fun of it.  You might
> have some additional issues w/ TLS, but the basics are there.

Thanks.  I rewrote it in python because I had some trouble getting SSL to
work in perl.  But as you said, the basics were there, and it was pretty
simple.  Here's my version:

#!/usr/local/bin/python2.6
import sys
from smtplib import SMTP

try:
        # "timeout" only available in python 2.6
        server = SMTP('smtp.gmail.com',587,timeout=10)

        server.ehlo(sys.argv[1])
        server.starttls()
        server.ehlo(sys.argv[1]) # say hello again
        # server.login raises an exception if authentication failure.
        server.login(sys.argv[1], sys.argv[2])
        server.quit()
        result=0
except:
        result=1
sys.exit(result)

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to