Back to Support

» MAJORDOMO MAILING LISTS ADVANCED

This guide is split into 3 main sections:

- Configuring Majordomo Lists

- Configuring Majordomo Newsletters

- Subscribing/Unsubscribing from Majordomo


We recommend you read our intro tutorial first.


Configuring Majordomo Lists


How to configure a list via email

All majordomo commands are sent to majordomo@yourdomain.com. It is also important to note that all commands are sent in the body of the message.
To configure a list, first retrieve the lists configuration file by sending an email to majordomo@yourdomain.com with the following in the body of the message:

config list-name list-password

where list-name is the name of your mailing list and list-password is the maintenance password you provided when you created the list.

Majordomo will reply with the configuration file for the list. Copy the contents of the email to your favorite text editor and make your configuration changes.
Note: Each line must begin with either a configuration parameter or # (denoting a comment). Remove any other lines.

Compose a new email to majordomo@yourdomain.com with the following in the body of the message:

newconfig list-name list-password

and paste the edited configuration text after the command. After you send the email, Majordomo will reply with the results. If the configuration change was successful, you should receive a message similar to this:

>>>> newconfig list-name list-password

New config for list list-name accepted.

otherwise the reply will specify why the command failed. Hint: If the command fails, check to make sure your email client is sending email as plain text (not html) and that it is not automatically wrapping the contents of the email.


How to configure a list via SSH

If you are comfortable with shell access, you can configure your list configuration file directly. Change directories to your majordomo lists, and edit the list-name .config file using vi or pico:

bash$ cd /var/lib/majordomo/lists

bash$ vi list-name .config

or

bash$ pico list-name .config

How to configure a list via FTP
Use your FTP client to connect to your site.

Change directories to /var/lib/majordomo/lists.

Change your FTP client to ASCII mode and download the file list-name.config, where list-name is the name of your mailing list.

Make the appropriate changes to the file. (It is highly recommended that you save a backup copy of the file prior to making any changes.)

Upload the file. Again, be sure to use ASCII mode so that newlines are translated correctly.


Configuring Majordomo Newsletters


You can configure a Majordomo mailing list to act as a one-way "newsletter" mailing. To do this, you need to change the restrict_post parameter for the list.

  1. SSH to your account and create a file. For the purpose of this tutorial, assume it is /var/lib/majordomo/lists/my-list.allowed .
  2. Edit the file so it contains the email address(es) of the users who are authorized to send newsletters. Email addresses can be separated by colons, spaces, or new lines.
  3. Change the list configuration parameter restrict_post to /var/lib/majordomo/lists/my-list.allowed .
    For instructions on how to do this, see the first section of this tutorial.

Subscribing/Unsubscribing from Majordomo


You can subscribe and unsubscribe users to a mailing list by editing the mailing list through your Ensim control panel. See the Majordomo Mailing List Manager tutorial for more information.

Users can also subscribe and unsubscribe to a list themselves by using Majordomo's email-based command interface. This tutorial will also provide and example of how to create a php script to accomplish this task for your users.

How to subscribe and unsubscribe via email

All majordomo commands are sent to majordomo@yourdomain.com. It is also important to note that all commands are sent in the body of the message.
To subscribe, a user simply sends an email to majordomo@yourdomain.com with the following in the body of the message:

subscribe list-name

where list-name is the name of your mailing list. You can also use this interface to unsubscribe:

unsubscribe list-name

Example php script to allow users to subscribe and unsubscribe

Create an html or php file with the following code in it:

<form method="post" action="list_command.php"> Your email address: <input type="text" name="email_addr"> <br/> <input type="radio" name="command" value="subscribe" checked> Subscribe <br/> <input type="radio" name="command" value="unsubscribe"> Unsubscribe <br/> <input type="submit" value="Submit"> </form>

Now create a php file called list_command.php with the following code in it:

<?php $command = $_POST['command']; $email_addr = $_POST['email_addr']; $list_name = 'your-list'; $to_addr = 'Majordomo@yourdomain.com'; $body = $command . ' ' . $list_name; mail($to_addr, '', $body, "From: $email_addr"); echo 'Your request to ' . $command . ' to the list ' . $list_name . ' has been processed.'; ?>

Be sure to substitute the variables list_name and to_addr with your appropriate information.

Important Note: By default, lists are configured so that subscribing requires confirmation from the user. You are strongly encouraged to keep this setting. Changing it to an open subscription policy will allow unwanted users to register anyone without confirmation (spam). Accel IT Solution's TOS, changing this policy may result in termination of your account.

Back to Support