]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - tools/sendEmail
Merge branch 'master' of git://git.ipfire.org/ipfire-2.x
[people/pmueller/ipfire-2.x.git] / tools / sendEmail
CommitLineData
228638e0
MT
1#!/usr/bin/python
2
3import smtplib
4
5fromaddr = "From: ipfire01@ipfire.org"
6toaddrs = "To: entwickler@ipfire.org"
7#password = "<password>"
8
9msg = ""
10subject = ""
11header = ""
12body = ""
13
14while 1:
15 try:
16 line = raw_input()
17 except EOFError:
18 break
228638e0
MT
19 if line.startswith("From: "):
20 fromaddr = line
21 elif line.startswith("To: "):
22 toaddrs = line
23 elif line.startswith("Subject: "):
24 subject = line
25 else:
26 body = body + line + "\r\n"
27
28for i in fromaddr, toaddrs, subject:
29 header = header + i + "\r\n"
30
31msg = header + "\r\n" + body # An empty line to finish the header + add the body
32
77f63267 33server = smtplib.SMTP('mail01.tremer.info')
228638e0
MT
34#server.set_debuglevel(1)
35#server.login(fromaddr, password)
36server.sendmail(fromaddr, toaddrs, msg)
37server.quit()