Working with Mailman

 < Free Open Study > 



Mailman is the GNU Project's MLM (http://www.list.org). It's notable for its Web-based list administration interface. Mailman is written in the Python language and requires Python 1.5.2 or later. Python is free and available from the Web (http://www.python.org). Because most list administration is performed using the Web-based interface, you must also host a Web server. The Apache Web server is recommended (http://www.apache.org).

Mailman's features include:

  • Web-based list administration for nearly all tasks, including list configuration, moderation, and management of subscribers.

  • Web-based subscribing and unsubscribing and user configuration management. Users can temporarily disable their subscriptions, select digest modes, and hide their email addresses from other members.

  • A customizable home page for each mailing list.

  • Per-list privacy features, such as closed-subscriptions, private archives, and private membership rosters.

  • Configurable (per-list and per-user) delivery modes.

  • MIME digests.

  • Plain (RFC 934) digests.

  • Integrated (non-VERP) bounce detection within an extensible framework. Automatic disposition of bouncing addresses (disable, unsubscribe).

  • Junk mail filtering.

  • Automatic Web-based archiving.

  • Gatewaying with Usenet newsgroups.

  • Majordomo-style e-mail-based commands.

  • Multiple list owners and moderators.

  • Support for virtual domains.

  • Runs on most Unix-like systems and compatible with most Web servers and browsers.

  • Extensible mail delivery pipeline.

Installing Mailman

Once you've got qmail and Apache installed, configured, and running and Python 1.5.2 or later installed, you can install Mailman. Apache and Mailman don't have to be running on the same system, but let's assume they are in this example because it's simpler and more reliable. To install Mailman, follow these steps:

  1. Download the Mailman tarball using your Web browser or a command-line utility. For example, using the wget utility:

     $ wget http://www.list.org/mailman.tar.gz --07:49:38-- http://www.list.org/mailman.tar.gz             => `mailman.tar.gz' Connecting to www.list.org:80. . . connected! HTTP request sent, awaiting response. . . 200 OK Length: 411,061 [application/x-gzip]   0K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 12%]  50K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 24%] 100K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 37%] 150K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 49%] 200K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 62%] 250K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 74%] 300K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 87%] 350K -> .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..[ 99%] 400K -> .                                                                   [100%] 07:52:00 (2.85 KB/s) - `mailman.tar.gz' saved [411061/411061] $ 

  2. As root, create the mailman user, group, and directory. For example, using the groupadd and useradd utilities, and selecting /usr/local/mailman as the Mailman installation directory, do this:

     $ su root Password: rootpassword # groupadd mailman # useradd -d /usr/local/mailman -g mailman mailman # chmod a+rx,g+ws /usr/local/mailman # ls -ld ~mailman drwxrwsr-x 4 mailman mailman 4096 Aug 8 08:01 /usr/local/mailman # 

If you're using qmail-users—the file /var/qmail/users/assign exists—and it handles all user accounts, you'll need to run qmail-pw2u and qmail-newu:

 # /var/qmail/bin/qmail-pw2u < /etc/passwd > /var/qmail/users/assign # /var/qmail/bin/qmail-newu # 

  1. Unpack the source tarball and change to the source directory:

     # gunzip -c mailman.tar.gz | tar xf - # chown -R mailman mailman-2.0.6 # su mailman $ cd mailman-2.0.6 $ 

  2. Configure the source code for the build. Check the Apache httpd.conf file for the appropriate setting for cgi-gid. For Red Hat 7.1, it's probably apache. Do not use mailman. For example:

     $ ./configure --prefix /usr/local/mailman --with-cgi-gid=apache \ > --with-mail-gid=nofiles loading cache ./config.cache checking for —with-python. . . no checking for python. . . /usr/bin/python . . .more output ending with something like: creating scripts/Makefile creating cron/crontab.in creating Makefile $ 

  3. Build and install the Mailman programs:

     $ make install Creating architecture independent directories. . . Creating directory hierarchy /usr/local/mailman/logs mkdir /usr/local/mailman/logs . . .lots of output ending with something like: Compiling /usr/local/mailman/Mailman/versions.py . . . Upgrading from version 0x0 to 0x20006f0 no lists == nothing to do, exiting $ 

  4. Check the permissions on the installed files and directories:

     $ cd ~mailman $ bin/check_perms directory permissions must be at least 02775: /usr/local/mailman/.kde directory permissions must be at least 02775: /usr/local/mailman/Desktop directory permissions must be at least 02775: /usr/local/mailman/.kde/Autostart directory permissions must be at least 02775: /usr/local/mailman/Desktop/Autostar t Problems found: 4 Re-run as mailman (or root) with -f flag to fix $ 

These warnings are for directories that Mailman doesn't use—they were created by the useradd utility. You might see more warnings, fewer warnings, or none at all. You can either ignore them or re-run check_perms with the -f option to correct the permissions. Ignore them.

  1. As root, configure Apache to run Mailman's Common Gateway Interface (CGI) scripts and to point to the list archives. For example, with Apache under Red Hat Linux 7.1, you would add the following to /etc/httpd/conf/httpd.conf:

     ScriptAlias   /mailman/       /usr/local/mailman/cgi-bin/ Alias /pipermail/ /usr/local/mailman/archives/public/ 

After modifying httpd.conf, restart Apache. For example:

 # /etc/init.d/httpd restart Stopping httpd:                                    [ OK ] Starting httpd:                                    [ OK ] # 

  1. Install the Mailman images in the appropriate Apache directory. For example:

     # cd ~mailman # cp icons/* ~apache/icons # 

If your Apache image directory isn't accessible as /icons (check your Apache configuration), edit /usr/local/mailman/Mailman/mm_cfg.py and set IMAGE_LOGOS accordingly.

  1. Set up the Mailman cron jobs:

     # crontab -u mailman ~mailman/cron/crontab.in # 

  2. Populate mailman's .qmail and .qmail-owner files. The .qmail file should forward to the person responsible for Mailman or deliver to a mailbox that this person will check regularly. The .qmail-owner file should redirect to mailman. For example, if user ken is responsible for Mailman:

     $ echo "&ken" > ~/.qmail $ echo "&mailman" > ~/.qmail-owner $ 

  3. Customize Mailman. Examine /usr/local/mailman/Mailman/Defaults.py. Make changes by overriding the defaults in /usr/local/mailman/Mailman/mm_cfg.py. At a minimum, add this:

     MTA_ALIASES_STYLE = 'qmail' 

  4. Set the Mailman site password. This password works like a master key: It can be used to administer all Mailman lists on the host. To set the site password, do this:

     $ ~/bin/mmsitepass somepassword Password changed. $ 

Mailman is now installed, configured, and ready for the creation of mailing lists.

Creating Mailing Lists with Mailman

Creating mailing lists with Mailman is also a two-phase process: creating the various directories and files under the Mailman directory and setting up the aliases for qmail to deliver mail to the right place.

For example, say the example.com mail administrator wants to create a list called pop-fans. She would take these steps:

  1. Run Mailman's newlist command to create the list. As mailman, do this:

     $ ~/bin/newlist Enter the name of the list: pop-fans Enter the email of the person running the list: dave@example.com Initial pop-fans password: somepassword To create system aliases:    echo '|preline /usr/local/mailman/mail/wrapper post pop-fans' >~alias/.qmail- pop-fans    echo '|preline /usr/local/mailman/mail/wrapper mailowner pop-fans' >~alias/. qmail-pop-fans-admin    echo '|preline /usr/local/mailman/mail/wrapper mailcmd pop-fans' >~alias/. qmail-pop-fans-request    echo '&pop-fans-admin' >~alias/.qmail-owner-pop-fans    echo '&pop-fans-admin' >~alias/.qmail-pop-fans-owner    chmod 644 ~alias/.qmail-pop-fans ~alias/.qmail-pop-fans-admin    chmod 644 ~alias/.qmail-pop-fans-request ~alias/.qmail-pop-fans-owner    chmod 644 ~alias/.qmail-owner-pop-fans Hit enter to continue with pop-fans owner notification. . . [Enter] $ 

  2. As root, create the list aliases using the suggested commands:

     # echo '|preline /usr/local/mailman/mail/wrapper post pop-fans' \ > >~alias/.qmail-pop-fans # echo '|preline /usr/local/mailman/mail/wrapper mailowner pop-fans' \ > >~alias/.qmail-pop-fans-admin # echo '|preline /usr/local/mailman/mail/wrapper mailcmd pop-fans' \ > >~alias/.qmail-pop-fans-request # echo '&pop-fans-admin' >~alias/.qmail-owner-pop-fans # echo '&pop-fans-admin' >~alias/.qmail-pop-fans-owner # chmod 644 ~alias/.qmail-pop-fans ~alias/.qmail-pop-fans-admin # chmod 644 ~alias/.qmail-pop-fans-request ~alias/.qmail-pop-fans-owner # chmod 644 ~alias/.qmail-owner-pop-fans # 

  3. The newlist command sends a message to the list owner, dave@example.com in this example. The message contains instructions for the list owner:

     The mailing list `pop-fans' has just been created for you. The following is some basic information about your mailing list. Your mailing list password is: somepassword You need this password to configure your mailing list. You also need it to handle administrative requests, such as approving mail if you choose to run a moderated list. You can configure your mailing list at the following web page:     http://example.com/mailman/admin/pop-fans The web page for users of your mailing list is:     http://example.com/mailman/listinfo/pop-fans You can even customize these web pages from the list configuration page. However, you do need to know HTML to be able to do this. There is also an email-based interface for users (not administrators) of your list; you can get info about using it by sending a message with just the word `help' as subject or in the body, to:     pop-fans-request@example.com To unsubscribe a user: from the mailing list 'listinfo' web page, click on or enter the user's email address as if you were that user. Where that user would put in their password to unsubscribe, put in your admin password. You can also use your password to change member's options, including digestification, delivery disabling, etc. Please address all questions to mailman-owner@example.com. 

  4. Visit the user's URL supplied, http://example.com/mailman/listinfo/pop-fans in this example, using a Web browser and subscribe to the list. A confirmation message will be sent to the address entered. For example:

     Pop-fans — confirmation of subscription — request 957336 We have received a request from 192.168.1.6 for subscription of your email address, <dave@example.com>, to the pop-fans@example.com mailing list. To confirm the request, please send a message to pop-fans-request@example.com, and either: - maintain the subject line as is (the reply's additional "Re:" is ok), - or include the following line - and only the following line - in the message body: confirm 957336 (Simply sending a 'reply' to this message should work from most email interfaces, since that usually leaves the subject line in the right form.) If you do not wish to subscribe to this list, please simply disregard this message. Send questions to pop-fans-admin@example.com. 

  5. Send a message to pop-fans-request to confirm the subscription:

     $ (echo to: pop-fans-request@example.com; echo; echo "confirm 957336") \ > |/var/qmail/bin/qmail-inject $ 

In response, the subscriber should receive a welcome message starting like this:

 Welcome to the Pop-fans@example.com mailing list! To post to this list, send your email to:   pop-fans@example.com General information about the mailing list is at:   http://example.com/mailman/listinfo/pop-fans 

  1. Finally, send a message to the list address, pop-fans@example.com, and verify that it's received by the subscriber(s).

     $ (echo to: pop-fans@example.com; echo; echo testing. . .) > |/var/qmail/bin/qmail-inject $ 

Note 

Mailman will reject the message if the sender doesn't appear to be subscribed to the list. If that happens, set the From field to the address subscribed to the list.

Subscribing to Mailman Lists

Steps 4 through 6 of "Creating Mailing Lists with Mailman" show the Web-initiated subscription process. The process can also be initiated by sending a subscribe command to the listname-request@domain address. For example:

 $ (echo to: pop-fans@example.com; echo; echo subscribe) > |/var/qmail/bin/qmail-inject $ 

Mailman will send back a confirmation request like the one it sends for Web-initiated requests.



 < Free Open Study > 



The Qmail Handbook
The qmail Handbook
ISBN: 1893115402
EAN: 2147483647
Year: 2001
Pages: 186
Authors: Dave Sill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net