--On 14 August 2006 14:06:06 -0400 Barry Warsaw <barry@python.org> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Aug 14, 2006, at 9:49 AM, Ian Eiloart wrote:
One thing that would make integration easier, would be a script bin/may_post (or something), which takes a list name (ideally qualified with domain) and sender address, and returns true if the sender address is allowed to post, and false otherwise.
Why don't you code something up and submit it here? :)
- -Barry
I started to write that I've no python coding experience. Well, about 3 lines because php can't do "utf-something or other". Then I thought, well it's about time I got some. I had hacked up a shell script using the existing Mailman scripts, but that was far too inefficient. Instead I've hacked up the attached. It started life as list_config, but hopefully I've not left much trace of that. The second issue below ***MUST*** be resolved before using this script with an MTA. The attached script takes these arguments: -o --outputfile FILE_PATH can be used to specify logging of denies. use '-' to log to stdout -v --verbose causes logging of all results, allows as well as denies. -h --help prints help -s --sender EMAIL_ADDRESS is required The script applies these tests, printing 'allow' or 'deny' to std out on the first match. allow list owners allow list moderators allow members of accept_these_nonmembers deny members of reject_these_nonmembers if generic_nonmember_action is 'reject': allow members to post deny non-members allow by default These issues are outstanding: ---------------------------- On allow, I say "return 1" on deny I say "return 0". I'm not sure whether that's correct. Actually, I think I want the script to succeed every time, so it can't be. I've not figured out how to do a pattern match so accept_these_nonmembers and reject_these_nonmembers are only tested for exact string matches. This *****needs to be fixed***** for accept_these_nonmembers, otherwise some won't be permitted to post. It'd be nice to log to syslog, but the MTA could take care of that. It might be nice to say 'hold' or 'discard' where appropriate. It's often sensible to reject rather than discard a message, for example. The list's nonmember_rejection_notice isn't used here. It could be returned instead of 'deny' for the MTA to construct a rejection string with. I've hard-coded '2' as the 'reject' key to generic_nonmember_action, which is sinful. -- Ian Eiloart IT Services, University of Sussex