On 03/27/2015 03:22 AM, Danijel Domazet wrote:

(Please keep threads on the list unless there is some privacy reason not
to.)
> 
> One more question related to the same issue.
> 
> Here is the code I added to avoid auto reply:
> 
> field = msg.get('to', '')
>         if 'mylist-join' in field:
>             self.respond = False
> 
> I would like to check 'bcc' field instead of 'to', like so:
> field = msg.get('bcc', '')
> But that seems not to work.


Because Bcc: by definition does not appear in the headers of delivered mail.

The problem is you are testing the wrong thing. Instead of looking at
message headers, you should be looking for 'tojoin' in the msgdata which
is set when the mail is initially received be Mailman.

Instead of what you've done, I would do

--- Mailman/Queue/CommandRunner.py      2015-03-01 16:35:02 +0000
+++ Mailman/Queue/CommandRunner.py      2015-03-27 17:42:10 +0000
@@ -276,6 +276,8 @@
                 ret = res.process()
             elif msgdata.get('tojoin'):
                 ret = res.do_command('join')
+                # Don't send response to -join/-subscribe mail
+                res.respond = False.
             elif msgdata.get('toleave'):
                 ret = res.do_command('leave')
             elif msgdata.get('toconfirm'):


-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to