[or-cvs] [torflow/master 89/92] snakeinspector: Prompt for mail_password if it's None in config

mikeperry at torproject.org mikeperry at torproject.org
Sat Aug 21 05:14:01 UTC 2010


Author: John M. Schanck <john at anomos.info>
Date: Fri, 20 Aug 2010 16:48:34 -0400
Subject: snakeinspector: Prompt for mail_password if it's None in config
Commit: 5e5c2f15d1bf16845158148cdeabdd03832e98e5

---
 NetworkScanners/ExitAuthority/snakeinspector.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/NetworkScanners/ExitAuthority/snakeinspector.py b/NetworkScanners/ExitAuthority/snakeinspector.py
index 06089e4..471c49a 100755
--- a/NetworkScanners/ExitAuthority/snakeinspector.py
+++ b/NetworkScanners/ExitAuthority/snakeinspector.py
@@ -14,6 +14,7 @@ import time
 import traceback
 
 import getopt
+import getpass
 
 from libsoat import *
 from soat_config_real import *
@@ -166,7 +167,8 @@ def send_mail(fro, to, subject, text, files=[]):
     if mail_starttls:
       smtp.starttls()
     if mail_auth:
-      smtp.login(mail_user, mail_password)
+      passwd = mail_password or getpass.getpass()
+      smtp.login(mail_user, passwd)
     smtp.sendmail(fro, to, msg.as_string() )
     smtp.close()
   except smtplib.SMTPException, e:
-- 
1.7.1




More information about the tor-commits mailing list