incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject svn commit: r1740698 - /incubator/public/trunk/report_reminders.py
Date Sun, 24 Apr 2016 14:06:57 GMT
Author: johndament
Date: Sun Apr 24 14:06:57 2016
New Revision: 1740698

URL: http://svn.apache.org/viewvc?rev=1740698&view=rev
Log:
Still working on script, but now it actually works with mail-relay.

Modified:
    incubator/public/trunk/report_reminders.py

Modified: incubator/public/trunk/report_reminders.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/report_reminders.py?rev=1740698&r1=1740697&r2=1740698&view=diff
==============================================================================
--- incubator/public/trunk/report_reminders.py (original)
+++ incubator/public/trunk/report_reminders.py Sun Apr 24 14:06:57 2016
@@ -1,6 +1,8 @@
 import json
+import email.utils
 from pprint import pprint
-import smtplib
+import getpass
+from smtplib import SMTP_SSL as SMTP
 
 # Import the email modules we'll need
 from email.mime.text import MIMEText
@@ -12,21 +14,25 @@ fp.close()
 with open('content/shepherd_assignments.json') as data_file:    
     data = json.load(data_file)
 
-podlingsToReport = data['2016-04'].keys()
-
-me = 'johndament@apache.org'
+podlingsToReport = data['2016-05'].keys()
 
+meFormat = '{}@apache.org'
 emailFormat = "dev@{}.incubator.apache.org"
 
+username = raw_input('Enter your ASF Username: ')
+password = getpass.getpass('Enter your ASF pw: ')
+
+me = meFormat.format(username)
+
+s = SMTP('mail-relay.apache.org')
+s.login(username, password)
+print "connected"
 for podling in podlingsToReport:
     email = emailFormat.format(podling)
     msg = MIMEText(messageBody)
-    msg['Subject'] = 'Podling Report Reminder - April 2016'
+    msg['Subject'] = 'Podling Report Reminder - May 2016'
     msg['From'] = me
     msg['To'] = email
+    msgId = s.sendmail(me, [email], msg.as_string())
 
-    # Send the message via our own SMTP server, but don't include the
-    # envelope header.
-    s = smtplib.SMTP('localhost')
-    s.sendmail(me, [email], msg.as_string())
-    s.quit()
+s.quit()
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message