mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@857 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
40 lines
765 B
Python
Executable File
40 lines
765 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import smtplib
|
|
|
|
fromaddr = "From: ipfire01@ipfire.org"
|
|
toaddrs = "To: entwickler@ipfire.org"
|
|
#password = "<password>"
|
|
|
|
msg = ""
|
|
subject = ""
|
|
header = ""
|
|
body = ""
|
|
|
|
while 1:
|
|
try:
|
|
line = raw_input()
|
|
except EOFError:
|
|
break
|
|
#if not line:
|
|
# break
|
|
if line.startswith("From: "):
|
|
fromaddr = line
|
|
elif line.startswith("To: "):
|
|
toaddrs = line
|
|
elif line.startswith("Subject: "):
|
|
subject = line
|
|
else:
|
|
body = body + line + "\r\n"
|
|
|
|
for i in fromaddr, toaddrs, subject:
|
|
header = header + i + "\r\n"
|
|
|
|
msg = header + "\r\n" + body # An empty line to finish the header + add the body
|
|
|
|
server = smtplib.SMTP('mail01.ipfire.org')
|
|
#server.set_debuglevel(1)
|
|
#server.login(fromaddr, password)
|
|
server.sendmail(fromaddr, toaddrs, msg)
|
|
server.quit()
|