Subscribe/Unsubscribe remotely by admin

Hi everyone,
I would like to ask if it is possible for an administrator of a list who knows the list admin password to subscribe/unsubscribe someone remotely. Either via email to mailman or via some other interface, but not the web interface.
I would like to make one automatic process to send a command to mailman to subscribe someone or remove him from the list. I don't want the mailman to send email with confirmation request to this user, but to subscribe/unsubscribe him instantly and just send him the info about it after that.
I hope this is possible, thanks in advance! Tomica
This mail passed through ZGWireless free network - www.zgwireless.net, Internet connection sponsored by Iskon Internet d.o.o. - www.iskon.hr

Hello Tomica,
Address email to: yourlist-request@yourdomain.com
Command lines in the body of your message (no blank lines before):
subscribe adminpasswd digest address=someemail@somedomain.com subscribe adminpasswd nodigest address=someemail@somedomain.com
Best wishes, Rae
At 04:58 AM 11/30/2005, Tomica Crnek wrote:

Rae wrote:
This doesn't do what you want. What it does do (assuming subscribe_policy includes confirm) is enter a pending subscription in digest/nodigest mode for someemail@somedomain.com with initial user password of adminpasswd and sends a confirmation email to someemail@somedomain.com.
See below for more info.
It is not possible by email. There are comand line tools bin/add_members and bin/remove_members that can do what you want if you can run them from your automated process, or you can 'post' to the admin mass (un)subscribe function as discussed in the archives of this list, e.g., the thread beginning at <http://mail.python.org/pipermail/mailman-users/2004-December/041209.html>.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Okay, so the better way would be not to use the adminpasswd in the command but a userpasswd instead.
I tried to run the command as designated in the link below but it does not work as expected. I received this error:
Bug in Mailman version 2.1.6 We're sorry, we hit a bug! Please inform the webmaster for this site of this problem. Printing of traceback and other system information has been explicitly inhibited, but the webmaster can find this information in the Mailman error logs.
Best wishes, Rae
At 11:07 AM 11/30/2005, Mark Sapiro wrote:

Quoting Rae <rae@gitchee.com>:
Rae, the following works for me, and requires procmail. A remote server sends an email message from a web form, and my Mailman server handles the request. I have to substitute a real listname for 'list' below because I have about 15 lists that do this.
/etc/postfix/aliases: list-special: "|/usr/local/bin/procmail -m /etc/procmail/.list.procmailrc"
/etc/procmail/.list.procmailrc: TMPDIR=/tmp MAILDIR=/dev/null DEFAULT=/dev/null LOGFILE=/dev/null
# Remote script writes a From of someone@somewhere.com :0HB
- ^From: .*someone@somewhere.com
- ^.*approve PassWord { :0Bwc:/tmp/listsubs.lock
- ^approve PassWord subscribe
| grep ' subscribe' | sed -e s/.*=//g >> /tmp/list-subs;
chmod 666 /tmp/list-subs
:0Bwc:/tmp/listunsubs.lock
- ^approve Password unsubscribe
| grep ' unsubscribe' | sed -e s/.*=//g >> /tmp/list-unsubs;
chmod 666 /tmp/list-unsubs }
execute only if previous didn't match
# mail leftovers to owner :0E |/usr/local/mailman/mail/mailman owner list
crontab: # Each hour, sub or unsub users from external web pages. 25,50 * * * * /usr/local/bin/hourly-cron 2>&1 > /dev/null
/usr/local/bin/hourly-cron: #!/bin/sh # Once an hour, check /tmp/list-subs and -unsubs and act appropo. # if [ -s /tmp/list-subs ]; then /usr/local/mailman/bin/add_members -r /tmp/list-subs list cat /dev/null > /tmp/list-subs fi if [ -s /tmp/list-unsubs ]; then /usr/local/mailman/bin/remove_members -f /tmp/list-unsubs list cat /dev/null > /tmp/list-unsubs fi
Dennis Black SysAdmin, Internet Applications Academic Information and Communication Technologies (AICT, formerly CNS) ph.492-9329 This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal, and/or privileged information. Please contact us immediately if you are not the intended recipient of this communication. If you are not the intended recipient of this communication, do not copy, distribute, or take action on it. Any communication received in error, or subsequent reply, should be deleted or destroyed.

Rae wrote:
Okay, so the better way would be not to use the adminpasswd in the command but a userpasswd instead.
But this results in a confirmation email to the user which the OP was trying to avoid.
Did you look in Mailman's 'error' log for the error and traceback? What were they?
And did you read the whole thread or did you just try the one UNsubscribe command in the first post of the thread. Most likely the error is a NotAMemberError: exception that resulted from an attempt to unsubscribe a non-member. This error would not normally occur because that particular 'post' comes from a member's options page, so the address would be a member's address.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Hello Tomica,
Address email to: yourlist-request@yourdomain.com
Command lines in the body of your message (no blank lines before):
subscribe adminpasswd digest address=someemail@somedomain.com subscribe adminpasswd nodigest address=someemail@somedomain.com
Best wishes, Rae
At 04:58 AM 11/30/2005, Tomica Crnek wrote:

Rae wrote:
This doesn't do what you want. What it does do (assuming subscribe_policy includes confirm) is enter a pending subscription in digest/nodigest mode for someemail@somedomain.com with initial user password of adminpasswd and sends a confirmation email to someemail@somedomain.com.
See below for more info.
It is not possible by email. There are comand line tools bin/add_members and bin/remove_members that can do what you want if you can run them from your automated process, or you can 'post' to the admin mass (un)subscribe function as discussed in the archives of this list, e.g., the thread beginning at <http://mail.python.org/pipermail/mailman-users/2004-December/041209.html>.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Okay, so the better way would be not to use the adminpasswd in the command but a userpasswd instead.
I tried to run the command as designated in the link below but it does not work as expected. I received this error:
Bug in Mailman version 2.1.6 We're sorry, we hit a bug! Please inform the webmaster for this site of this problem. Printing of traceback and other system information has been explicitly inhibited, but the webmaster can find this information in the Mailman error logs.
Best wishes, Rae
At 11:07 AM 11/30/2005, Mark Sapiro wrote:

Quoting Rae <rae@gitchee.com>:
Rae, the following works for me, and requires procmail. A remote server sends an email message from a web form, and my Mailman server handles the request. I have to substitute a real listname for 'list' below because I have about 15 lists that do this.
/etc/postfix/aliases: list-special: "|/usr/local/bin/procmail -m /etc/procmail/.list.procmailrc"
/etc/procmail/.list.procmailrc: TMPDIR=/tmp MAILDIR=/dev/null DEFAULT=/dev/null LOGFILE=/dev/null
# Remote script writes a From of someone@somewhere.com :0HB
- ^From: .*someone@somewhere.com
- ^.*approve PassWord { :0Bwc:/tmp/listsubs.lock
- ^approve PassWord subscribe
| grep ' subscribe' | sed -e s/.*=//g >> /tmp/list-subs;
chmod 666 /tmp/list-subs
:0Bwc:/tmp/listunsubs.lock
- ^approve Password unsubscribe
| grep ' unsubscribe' | sed -e s/.*=//g >> /tmp/list-unsubs;
chmod 666 /tmp/list-unsubs }
execute only if previous didn't match
# mail leftovers to owner :0E |/usr/local/mailman/mail/mailman owner list
crontab: # Each hour, sub or unsub users from external web pages. 25,50 * * * * /usr/local/bin/hourly-cron 2>&1 > /dev/null
/usr/local/bin/hourly-cron: #!/bin/sh # Once an hour, check /tmp/list-subs and -unsubs and act appropo. # if [ -s /tmp/list-subs ]; then /usr/local/mailman/bin/add_members -r /tmp/list-subs list cat /dev/null > /tmp/list-subs fi if [ -s /tmp/list-unsubs ]; then /usr/local/mailman/bin/remove_members -f /tmp/list-unsubs list cat /dev/null > /tmp/list-unsubs fi
Dennis Black SysAdmin, Internet Applications Academic Information and Communication Technologies (AICT, formerly CNS) ph.492-9329 This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal, and/or privileged information. Please contact us immediately if you are not the intended recipient of this communication. If you are not the intended recipient of this communication, do not copy, distribute, or take action on it. Any communication received in error, or subsequent reply, should be deleted or destroyed.

Rae wrote:
Okay, so the better way would be not to use the adminpasswd in the command but a userpasswd instead.
But this results in a confirmation email to the user which the OP was trying to avoid.
Did you look in Mailman's 'error' log for the error and traceback? What were they?
And did you read the whole thread or did you just try the one UNsubscribe command in the first post of the thread. Most likely the error is a NotAMemberError: exception that resulted from an attempt to unsubscribe a non-member. This error would not normally occur because that particular 'post' comes from a member's options page, so the address would be a member's address.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Dennis Black
-
Mark Sapiro
-
Rae
-
Tomica Crnek