Files
bpfire/tools/sendEmail
ms 77f6326779 Anderer Mailserver.
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@894 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
2007-09-15 22:41:44 +00:00

40 lines
766 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.tremer.info')
#server.set_debuglevel(1)
#server.login(fromaddr, password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()