Hi all,
I have a registration form where users, amongst other things, choose a number of mailing lists to sign up to. I don't want users to have to go and individually sign up to each list, so I'm trying to automate the signup process.
After doing a bit of reading around, the closest I've got is to generate a plaintext file of email addresses for each newsletter and then use a cron command to sign these up, using the add_users program.
To test, I've been running this cron command:
echo test@testing.co.uk | /usr/local/cpanel/3rdparty/mailman/bin/add_members -r - info
Where info is the listname (info@nanotp.org)
I get the following error:
Traceback (most recent call last): File "/usr/local/cpanel/3rdparty/mailman/bin/add_members", line 258, in ? main() File "/usr/local/cpanel/3rdparty/mailman/bin/add_members", line 211, in main mlist = MailList.MailList(listname) File "/usr/local/cpanel/3rdparty/mailman/Mailman/MailList.py", line 128, in __init__ self.Lock() File "/usr/local/cpanel/3rdparty/mailman/Mailman/MailList.py", line 161, in Lock self.__lock.lock(timeout) File "/usr/local/cpanel/3rdparty/mailman/Mailman/LockFile.py", line 243, in lock self.__write() File "/usr/local/cpanel/3rdparty/mailman/Mailman/LockFile.py", line 422, in __write fp = open(self.__tmpfname, 'w') IOError: [Errno 13] Permission denied: '/usr/local/cpanel/3rdparty/mailman/locks/info.lock.hephaestus.safeukdns.net.24247.0'
I tried check_perms -f and get the same error:
/usr/local/cpanel/3rdparty/mailman/bin/check_perms -f
Warning: Private archive directory is other-executable (o+x). This could allow other users on your system to read private archives. If you're on a shared multiuser system, you should consult the installation manual on how to fix this. Traceback (most recent call last): File "/usr/local/cpanel/3rdparty/mailman/bin/check_perms", line 399, in ? checkarchivedbs() File "/usr/local/cpanel/3rdparty/mailman/bin/check_perms", line 258, in checkarchivedbs for dir in os.listdir(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR): OSError: [Errno 13] Permission denied: '/usr/local/cpanel/3rdparty/mailman/archives/private'
Can anyone suggest a way to get around this problem? Or an alternative method of automating signups (they can be totally silent). I have tried a similar method using the PHP exec() command to hit the same program but had similar permission problems.
Cheers,
Phil
On Wed, Jan 27, 2010 at 05:29:44PM +0000, Phil Ewels wrote:
After doing a bit of reading around, the closest I've got is to generate a plaintext file of email addresses for each newsletter and then use a cron command to sign these up, using the add_users program.
To test, I've been running this cron command:
echo test@testing.co.uk | /usr/local/cpanel/3rdparty/mailman/bin/add_members -r - info
Where info is the listname (info@nanotp.org)
IOError: [Errno 13] Permission denied: '/usr/local/cpanel/3rdparty/mailman/locks/info.lock.hephaestus.safeukdns.net.24247.0'
Can anyone suggest a way to get around this problem?
If you can, run the crontab as a user in the mailman (or whatever it's set to on your system) group.
Or an alternative method of automating signups (they can be totally silent).
A bundle of HTTP POST requests? Via subscribe-...@?
Phil Ewels wrote:
To test, I've been running this cron command:
echo test@testing.co.uk | /usr/local/cpanel/3rdparty/mailman/bin/add_members -r - info
Where info is the listname (info@nanotp.org)
I get the following error:
Traceback (most recent call last):
[...]
IOError: [Errno 13] Permission denied: '/usr/local/cpanel/3rdparty/mailman/locks/info.lock.hephaestus.safeukdns.net.24247.0'
[...]
Can anyone suggest a way to get around this problem? Or an alternative method of automating signups (they can be totally silent). I have tried a similar method using the PHP exec() command to hit the same program but had similar permission problems.
These commands must be run by root or a member of Mailman's group. Put your add_members command (if you can) in the Mailman user's crontab or a system crontab with the mailman user as it's user.
Another way to do this is to create a SETGID wrapper to run the commands. See the members.c program attached to the FAQ at <http://wiki.list.org/x/uIA9> for an example.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks for the help everyone! I think I've just found the answer I was looking for via Marks link - using PHP to scrape a direct subscribe url:
http://wiki.list.org/pages/viewpage.action?pageId=4030567
No cron / special permissions needed!
Cheers,
Phil
Mark Sapiro wrote:
Phil Ewels wrote:
To test, I've been running this cron command:
echo test@testing.co.uk | /usr/local/cpanel/3rdparty/mailman/bin/add_members -r - info
Where info is the listname (info@nanotp.org)
I get the following error:
Traceback (most recent call last): [...] IOError: [Errno 13] Permission denied: '/usr/local/cpanel/3rdparty/mailman/locks/info.lock.hephaestus.safeukdns.net.24247.0'
[...]
Can anyone suggest a way to get around this problem? Or an alternative method of automating signups (they can be totally silent). I have tried a similar method using the PHP exec() command to hit the same program but had similar permission problems.
These commands must be run by root or a member of Mailman's group. Put your add_members command (if you can) in the Mailman user's crontab or a system crontab with the mailman user as it's user.
Another way to do this is to create a SETGID wrapper to run the commands. See the members.c program attached to the FAQ at <http://wiki.list.org/x/uIA9> for an example.
participants (3)
-
Adam McGreggor
-
Mark Sapiro
-
Phil Ewels