Changeset 3013
- Timestamp:
- 09/06/06 22:36:35 (18 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r3012 r3013 42 42 from email.MIMEText import MIMEText 43 43 from email.Header import Header 44 import email.Utils 44 45 45 46 from mx import DateTime … … 1037 1038 else : 1038 1039 msg["To"] = adminmail 1040 msg["Date"] = email.Utils.formatdate(localtime=True) 1039 1041 server.sendmail(adminmail, destination, msg.as_string()) 1040 1042 except smtplib.SMTPException, answer : -
pykota/trunk/bin/pkmail
r2829 r3013 30 30 import smtplib 31 31 import email 32 from email.MIMEText import MIMEText 33 from email.Header import Header 34 import email.Utils 32 35 33 36 from pykota.tool import PyKotaTool, PyKotaCommandLineError, crashed, N_ … … 96 99 97 100 if cheatmeonce : 98 self. logdebug("Possible intruder at %s : %s" % (useremail, str(arguments)))101 self.printInfo("Possible intruder at %s : %s" % (useremail, str(arguments)), "warn") 99 102 result = "Either you mistyped your command, or you're a bad guy !" 100 103 else : … … 104 107 105 108 self.logdebug("Sending answer to : %s" % useremail) 109 emailmsg = MIMEText(result, _charset=self.charset) 110 emailmsg["Subject"] = str(Header(_("Result of your commands"), charset=self.charset)) 111 emailmsg["From"] = whoami 112 emailmsg["To"] = useremail 113 emailmsg["Date"] = email.Utils.formatdate(localtime=True) 106 114 server = smtplib.SMTP(self.smtpserver) 107 server.sendmail(whoami, [ useremail ], "From: %s\nTo: %s\nSubject: Result of your commands\n\n%s\n" % (whoami, useremail, result))115 server.sendmail(whoami, [ useremail ], emailmsg.as_string()) 108 116 server.quit() 109 117 self.logdebug("Answer sent to : %s" % useremail) -
pykota/trunk/pykota/tool.py
r3006 r3013 35 35 from email.MIMEText import MIMEText 36 36 from email.Header import Header 37 import email.Utils 37 38 38 39 from mx import DateTime … … 360 361 msg["To"] = crashrecipient 361 362 msg["Cc"] = admin 363 msg["Date"] = email.Utils.formatdate(localtime=True) 362 364 server.sendmail(admin, [admin, crashrecipient], msg.as_string()) 363 365 server.quit() … … 495 497 msg["From"] = adminmail 496 498 msg["To"] = usermail 499 msg["Date"] = email.Utils.formatdate(localtime=True) 497 500 self.sendMessage(adminmail, usermail, msg.as_string()) 498 501 -
pykota/trunk/TODO
r3012 r3013 21 21 22 22 TODO, in no particular order : 23 24 - Add a date header to all email messages sent, because some25 spam detection tools cause SMTP servers to reject the26 messages with no date.27 23 28 24 - Allow the disabling of an user print quota entry without