diff options
author | Gunnar Wrobel <wrobel@gentoo.org> | 2006-05-29 09:32:41 +0000 |
---|---|---|
committer | Gunnar Wrobel <wrobel@gentoo.org> | 2006-05-29 09:32:41 +0000 |
commit | fb9d4bbc950777e8d61b9b0d02ff1aeaf9852bf8 (patch) | |
tree | 39c06ae8298f7dd63029f6dbc7fa5ca09b580a21 /www-apps | |
parent | Added trackback stuff (diff) | |
download | overlay-fb9d4bbc950777e8d61b9b0d02ff1aeaf9852bf8.tar.gz overlay-fb9d4bbc950777e8d61b9b0d02ff1aeaf9852bf8.tar.bz2 overlay-fb9d4bbc950777e8d61b9b0d02ff1aeaf9852bf8.zip |
Comments update
svn path=/stable/; revision=716
Diffstat (limited to 'www-apps')
-rw-r--r-- | www-apps/pyblosxom-plugins/Manifest | 2 | ||||
-rw-r--r-- | www-apps/pyblosxom-plugins/files/comments.py | 32 |
2 files changed, 18 insertions, 16 deletions
diff --git a/www-apps/pyblosxom-plugins/Manifest b/www-apps/pyblosxom-plugins/Manifest index ae71a13..a8709b2 100644 --- a/www-apps/pyblosxom-plugins/Manifest +++ b/www-apps/pyblosxom-plugins/Manifest @@ -1,6 +1,6 @@ MD5 f67ef44f565d2cfa49ce8e728267081b files/blocks.py 6567 MD5 d4a9d94b9c5eff48ee20510177e22730 files/commentAPI.py 5425 -MD5 3d89ed013ed90e7afff11e8e3a57ebf4 files/comments.py 25302 +MD5 2c50c784d62838e41c3a0b596f9a4160 files/comments.py 25332 MD5 53cf6af3d39e1d47a4d26d20dbe4338b files/contact.py 11517 MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-pyblosxom-plugins-1.3.2 0 MD5 ef8b9559c56fe3bff0bf15672c2239e4 files/getstamps.py 1332 diff --git a/www-apps/pyblosxom-plugins/files/comments.py b/www-apps/pyblosxom-plugins/files/comments.py index 0747137..1d6b505 100644 --- a/www-apps/pyblosxom-plugins/files/comments.py +++ b/www-apps/pyblosxom-plugins/files/comments.py @@ -391,7 +391,7 @@ def send_email(config, entry, comment, comment_dir, comment_filename): @param comment_filename: file name of current comment @type comment_filename: string """ - import smtplib + import smtplib, codecs # import the formatdate function which is in a different # place in Python 2.3 and up. try: @@ -407,23 +407,25 @@ def send_email(config, entry, comment, comment_dir, comment_filename): email = config['comment_smtp_from'] try: - server = smtplib.SMTP(config['comment_smtp_server']) - curl = config['base_url']+'/'+entry['file_path'] - comment_dir = os.path.join(config['comment_dir'], entry['absolute_path']) - - message = [] - message.append("From: %s" % email) - message.append("To: %s" % config["comment_smtp_to"]) - message.append("Date: %s" % formatdate(float(comment['pubDate']))) - message.append("Subject: write back by %s" % author) - message.append("") - message.append("%s\n%s\n%s\n" % (description, comment_filename, curl)) - server.sendmail(from_addr=email, + server = smtplib.SMTP(config['comment_smtp_server']) + curl = config['base_url']+'/'+entry['file_path'] + comment_dir = os.path.join(config['comment_dir'], entry['absolute_path']) + + message = [] + message.append("From: %s" % email) + message.append("To: %s" % config["comment_smtp_to"]) + message.append("Date: %s" % formatdate(float(comment['pubDate']))) + message.append("Subject: write back by %s" % author) + message.append("") + message.append("%s\n%s\n%s\n" % (codecs.ascii_decode(description, 'ignore'), + codecs.ascii_decode(comment_filename, 'ignore'), + codecs.ascii_decode(curl, 'ignore'))) + server.sendmail(from_addr=email, to_addrs=config['comment_smtp_to'], msg="\n".join(message)) - server.quit() + server.quit() except Exception, e: - # tools.log("Error sending mail: %s" % e) + #tools.log("Error sending mail: %s" % e) # FIXME - if we error out, no one will know. pass |