Date

So, it appears there is no way built in to cPanel to script the creation of a large number of Mailman lists. Since we are migrating around 50 lists, I was not looking forward to a lot of copy, paste, click, etc. There had to be a better way. Turns out, there was.

wget --no-check-certificate --user=your_cpanel_user "--password=your_cpanel_password" --post-data "email=$L&domain=lists.yourhost.com&password=listpass&password2=listpass" https://your.cpanel.host.com:2083/frontend/x3/mail/doaddlist.html

Some notes:

  • I use the SSL connection to cPanel which has a self-signed certificate, thus the —no-check-certificate option
  • for domain=… use the domain you want to use for the list. In our case, we’ve created a “lists” subdomain, so all lists will be of the form listname@lists.ourdomain.com. If you simply want “listname@yourdomain.com” put “yourdomain.com” as the domain parameter.

For a large number of lists, wrap that in the appropriate for…in…do…done shell syntax.

You’ll still have to configure the lists manually, or copy over the config files (if you have root access), but at least the creation is scripted.


Comments

comments powered by Disqus