2.1b1 Moderation and From: vs. Sender:
I have a small problem with a moderated list as part of my upgrades from 2.0.8 to 2.1b1.
This is a "joke of the day" style list. I'm supposed to be the only one who can submit messages to the list; all of the members are moderated (except me). Outgoing messages are stored in a queue, and one is sent automatically by cron once per day.
With 2.0.8, I was processing a message by adding a Sender: tag with my address; my address was listed in the 'posters' variable. With "USE_ENVELOPE_SENDER = 1" in my mm_cfg.py, this worked.
The list upgrade process handled the 'posters' variable correctly; my list address was marked *unmoderated*, and the other addresses were copied into the new 'accept_these_nonmembers' field. (Good attention to detail, there, btw; kudos!)
However, my 'trick' of adding a Sender: field doesn't work anymore, and I get a confusing log/hold message that says "humour post from chk@cfrq.net held: Post by a moderated member". 'chk@cfrq.net' is not moderated.
It turns out that, in order to find the moderation flag of the user that send a message, Handlers/Moderate.py calls msg.get_senders, which returns a *list* of senders with the Sender: last; Moderate.py only looks at the first return value, which is the From: header. The address in the From: field *is* moderated, and so the message is rejected. Later, however, Handlers/Hold.py routine hold_for_approval calls the old msg.get_sender (singular vs. plural), which returns the Sender: field if "USE_ENVELOPE_SENDER = 1" is set, which is why I get the confusing log message.
So, two things:
The message rejection is confusing.
What's the right way to do this under 2.1?
Thanks,
-- Harald Koch <chk@pobox.com>
"It takes a child to raze a village." -Michael T. Fry
Once upon a time in a land far, far away I wrote:
- What's the right way to do this under 2.1?
Ok, I just found the Approved: header processing... *sigh.
The hold message is still confusing though. <grin>
-- Harald Koch <chk@pobox.com>
"It takes a child to raze a village." -Michael T. Fry
"HK" == Harald Koch <chk@pobox.com> writes:
HK> However, my 'trick' of adding a Sender: field doesn't work
HK> anymore, and I get a confusing log/hold message that says
HK> "humour post from chk@cfrq.net held: Post by a moderated
HK> member". 'chk@cfrq.net' is not moderated.
HK> It turns out that, in order to find the moderation flag of the
HK> user that send a message, Handlers/Moderate.py calls
HK> msg.get_senders, which returns a *list* of senders with the
HK> Sender: last; Moderate.py only looks at the first return
HK> value, which is the From: header. The address in the From:
HK> field *is* moderated, and so the message is rejected. Later,
HK> however, Handlers/Hold.py routine hold_for_approval calls the
HK> old msg.get_sender (singular vs. plural), which returns the
HK> Sender: field if "USE_ENVELOPE_SENDER = 1" is set, which is
HK> why I get the confusing log message.
HK> So, two things:
HK> 1) The message rejection is confusing.
HK> 2) What's the right way to do this under 2.1?
Later...
"HK" == Harald Koch <chk@pobox.com> writes:
HK> Ok, I just found the Approved: header processing... *sigh.
HK> The hold message is still confusing though. <grin>
You're right it is. And I'll fix that.
I believe that using the Approved: header is the better way to go, since it's more difficult to fake out (someone would have to have the list admin password, rather than trivially be able to forge the Sender: or From: or whatever header).
-Barry
participants (2)
-
barry@zope.com
-
Harald Koch