Re: Some spam getting through without email notification

Ryan Barrett <pyblosxom-6sb6M7qyT/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
On Wed, 28 Mar 2007, Michael Olson wrote:

> From the log, it appears that comments are being sent using the email
> address typed into the comment form, rather than the one I specified here.
> I'm not sure why.

it's a bug in comments.py. thanks for the catch!

i have a fix, but i don't have an open SMTP server to test against. mind 
trying it out? i've attached a patch against comments.py.

-Ryan

--
http://snarfed.org/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
pyblosxom-users mailing list
pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
comment_email_fix.patch (text/plain, 2.4 KB)
Index: contrib/plugins/comments/plugins/comments.py
===================================================================
--- contrib/plugins/comments/plugins/comments.py	(revision 1007)
+++ contrib/plugins/comments/plugins/comments.py	(working copy)
@@ -32,12 +32,12 @@
                          through.
    comment_mta_cmd - alternatively, a command line to invoke your MTA (e.g.
                      sendmail) to send comment notifications through.
-   comment_smtp_from - the person comment notifications will be from. If
-                        you're using SMTP, this should be an email address
-                        accepted by your SMTP server. If you omit this, the
-                        from address will be the e-mail address as input in
-                        the comment form.
-   comment_smtp_to - the person to send comment notifications to.
+   comment_smtp_from - the email address comment notifications will be from. If
+                       you're using SMTP, this should be an email address
+                       accepted by your SMTP server. If you omit this, the
+                       from address will be the e-mail address as input in
+                       the comment form.
+   comment_smtp_to - the email address to send comment notifications to.
    comment_nofollow - set this to 1 to add rel="nofollow" attributes to
                  links in the description -- these attributes are embedded
                  in the stored representation.
@@ -504,10 +504,10 @@
     description = escape_SMTP_commands(comment['description'])
     ipaddress = escape_SMTP_commands(comment.get('ipaddress', '?'))
 
-    if comment.has_key('email'):
+    if config.has_key('comment_smtp_from'):
+        email = config['comment_smtp_from']
+    else:
         email = escape_SMTP_commands(clean_author(comment['email']))
-    else:
-        email = config['comment_smtp_from']
 
     try:
         curl = config['base_url']+'/'+entry['file_path_urlencoded']
@@ -561,7 +561,7 @@
             mimemsg = MIMEText("\n".join(message).encode("utf-8"), 'plain', 'utf-8')
 
             # set the message headers
-            mimemsg["From"] = config["comment_smtp_to"]
+            mimemsg["From"] = email
             mimemsg["To"] = config["comment_smtp_to"]
             mimemsg["Date"] = formatdate(float(comment["pubDate"]))
             mimemsg["Subject"] = ("comment on %s" % curl)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.