2013-01-29 14:38:29 -07:00
|
|
|
#! /usr/bin/python3
|
|
|
|
|
|
|
|
import smtplib
|
2013-01-31 13:51:56 -07:00
|
|
|
import sys
|
2013-01-29 14:38:29 -07:00
|
|
|
|
2013-01-31 13:51:56 -07:00
|
|
|
courses = {
|
|
|
|
"net": "Network Archaeology",
|
|
|
|
"mal": "Malware Reverse-Engineering",
|
|
|
|
"hst": "Host Forensics",
|
|
|
|
"icc": "Incident Coordination",
|
|
|
|
"nil": "None",
|
|
|
|
}
|
2013-01-29 14:38:29 -07:00
|
|
|
|
2013-01-31 13:51:56 -07:00
|
|
|
smtpd = smtplib.SMTP("mail.lanl.gov")
|
2013-01-29 14:38:29 -07:00
|
|
|
|
2013-01-31 13:51:56 -07:00
|
|
|
template = sys.stdin.read()
|
|
|
|
if 'RCPT' not in template:
|
|
|
|
print("Pass the template on stdin.")
|
|
|
|
else:
|
|
|
|
for line in open("assignments.txt"):
|
|
|
|
course, email = line.strip().split()
|
|
|
|
coursename = courses[course]
|
|
|
|
|
|
|
|
print(email)
|
|
|
|
msg = template.replace("RCPT", email).replace("COURSE", coursename)
|
|
|
|
smtpd.sendmail("neale@lanl.gov", [email], msg)
|
|
|
|
#print(msg)
|