Le 07/01/2016 00:20, Barry Warsaw a écrit :
This is really what you want to read. There's a new 'nonmember' rule that
checks for posting conditions described here:
http://mailman.readthedocs.org/en/release-3.0/src/mailman/chains/docs/moderation.html#nonmembers
"Members" are users or addresses subscribed to mailing lists, and every member
has a role and a moderation_action. "Non-member" is a valid role. So the
idea is that you "subscribe" a non-member to a mailing list and give them a
moderation_action of 'accept'. Then their postings won't be held for
approval.
Thanks for the explanation!
I have tried different things with the python client to achieve this but
with no results. I don't know if there are missing features in the
client or if I have misunderstood something.
For instance for known email:
========================================================================
client = Client('http://localhost:8001/3.0', 'restadmin', 'restpass')
my_list = client.get_list(ml_id)
# my_list.nonmembers is a list no "get_member" method
for nm in my_list.nonmembers:
if nm.email == email_to_add:
pass # no moderation_action
========================================================================
Or to "subscribe" an unknown email:
========================================================================
my_list.add_role('non-member', email_to_add)
# non-member / nonmember / etc. are not considered as valid roles
========================================================================
As a fallback I have tried to edit directly the database:
========================================================================
conn = sqlite3.connect(DB)
c = conn.cursor()
sql = """
UPDATE member set moderation_action=?
WHERE member.list_id=? and member.address_id = (
SELECT id from address where email=?)"""
c.execute(sql, [Action.accept.value, ml_id, email_to_add])
conn.commit()
========================================================================
But with no result.
Thanks for any help!
--
Étienne Loks
_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives:
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe:
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org
Security Policy: http://wiki.list.org/x/QIA9