UnitedHosting Customer Support Site & Helpdesk UnitedHosting Customer Helpdesk
UnitedHosting Service StatusWeb Hosting ForumsUK Web Hosting
UnitedForums - Hosting ForumsUnitedHosting Sitemap Hosting Customer HelpdeskUK Web HostingUnitedHosting Support SiteUK Reseller HostingUnitedHosting Customer SupportUK Managed Dedicated ServersUnitedHosting HelpdeskUK Domain Name Registration
  UnitedSupport Home » Knowledgebase & Tutorials » Using your Majordomo mailing list  
 Using your Majordomo mailing list
Solution

This guide is split into 3 main sections:

  • Configuring Majordomo Lists
  • Configuring Majordomo Newsletters
  • Subscribing/Unsubscribing from Majordomo


Configuring Majordomo Lists via Email Commands


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 in your control panel.


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:


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.

Configuring Majordomo Lists using 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.

SSH to your account and create a file. For the purpose of this tutorial, assume it is /var/lib/majordomo/lists/my-list.allowed.


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. 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 our other Majordomo tutorial for information on how to do this.


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.

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). Under United Hosting's TOS, changing this policy may result in termination of your account.

Its important to note that Majordomo lists work in a way that all subscribers can email messages to the list, and all subscribers will receive all these messages. If you want to use the Majordomo mailing list so that you are the only person who can send emails to people on your lists (such as a newsletter list) then you need to change the configuration variable called "restrict_post". Instructions for doing this are in the section above titled "Configuring Majordomo Newsletters ".




Article Details
Article ID: 31
Created On: 25 May 2007 01:40 AM

 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options



Home  |  Register  |  Submit a Support Ticket  |  Knowledgebase & Tutorials Web Hosting  |  Reseller Hosting  |  Dedicated Servers
Copyright © 1998-2009 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309