个人工具

“UbuntuHelp:Mailman”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/Mailman}} {{Languages|php5}} '''This guide explains how to setup [http://www.list.org/ Mailman] mailing list software with the apache web server an...)
 
第37行: 第37行:
 
     Allow from all
 
     Allow from all
 
</Directory>
 
</Directory>
</nowiki></code>
+
</nowiki></pre>
  
 
=== Mail server integration ===
 
=== Mail server integration ===
第48行: 第48行:
 
<pre><nowiki>
 
<pre><nowiki>
 
dc_use_split_config='true'
 
dc_use_split_config='true'
</nowiki></code>
+
</nowiki></pre>
  
 
We can discuss more about exim4 configuration in next section.
 
We can discuss more about exim4 configuration in next section.
第80行: 第80行:
 
<pre><nowiki>
 
<pre><nowiki>
 
# /etc/init.d/exim4 start
 
# /etc/init.d/exim4 start
</nowiki></code>
+
</nowiki></pre>
  
 
In order to make mailman work with exim4, you need to configure exim4. As mentioned earlier, by default, exim4 uses multiple configuration files of different types. For details, please refer [http://www.exim.org Exim] website.
 
In order to make mailman work with exim4, you need to configure exim4. As mentioned earlier, by default, exim4 uses multiple configuration files of different types. For details, please refer [http://www.exim.org Exim] website.
第128行: 第128行:
 
  MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
 
  MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
 
  # end
 
  # end
</nowiki></code>
+
</nowiki></pre>
  
 
===== Transport =====
 
===== Transport =====
第148行: 第148行:
 
     user = MM_UID
 
     user = MM_UID
 
     group = MM_GID
 
     group = MM_GID
</nowiki></code>
+
</nowiki></pre>
  
 
'''IMPORTANT: In the above configuration, in line no 5, i've escaped three braces (\}\}\}) to make it compatible with this document. Please unescape it when you save this file. '''
 
'''IMPORTANT: In the above configuration, in line no 5, i've escaped three braces (\}\}\}) to make it compatible with this document. Please unescape it when you save this file. '''
第167行: 第167行:
 
                       -owner : -request : -admin
 
                       -owner : -request : -admin
 
   transport = mailman_transport
 
   transport = mailman_transport
</nowiki></code>
+
</nowiki></pre>
  
 
'''IMPORTANT:''' The order of main and transport configuration files can be in any order. But, the order of router configuration files must be in the same order. This particular file, must appear before
 
'''IMPORTANT:''' The order of main and transport configuration files can be in any order. But, the order of router configuration files must be in the same order. This particular file, must appear before
第182行: 第182行:
 
transport_maps = hash:/etc/postfix/transport
 
transport_maps = hash:/etc/postfix/transport
 
mailman_destination_recipient_limit = 1
 
mailman_destination_recipient_limit = 1
</nowiki></code>
+
</nowiki></pre>
  
 
In <code><nowiki>master.cf</nowiki></code> check that you ever have the following transport:
 
In <code><nowiki>master.cf</nowiki></code> check that you ever have the following transport:
第189行: 第189行:
 
   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
 
   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
 
   ${nexthop} ${user}
 
   ${nexthop} ${user}
</nowiki></code>
+
</nowiki></pre>
  
 
It calls the <code><nowiki>postfix-to-mailman.py</nowiki></code> script when a mail is delivered to a list.
 
It calls the <code><nowiki>postfix-to-mailman.py</nowiki></code> script when a mail is delivered to a list.
第196行: 第196行:
 
<pre><nowiki>
 
<pre><nowiki>
 
lists.example.com      mailman:
 
lists.example.com      mailman:
</nowiki></code>
+
</nowiki></pre>
  
 
Do not forget to launch <code><nowiki>postmap -v /etc/postfix/transport</nowiki></code> after this modification.
 
Do not forget to launch <code><nowiki>postmap -v /etc/postfix/transport</nowiki></code> after this modification.
第228行: 第228行:
  
 
   #  
 
   #  
</nowiki></code>
+
</nowiki></pre>
  
  
第234行: 第234行:
 
<pre><nowiki>
 
<pre><nowiki>
 
# /etc/init.d/mailman start
 
# /etc/init.d/mailman start
</nowiki></code>
+
</nowiki></pre>
  
 
We have configured exim and postfix to recognize all emails from mailman. So, it's not mandatory to make any new entries in /etc/aliases.
 
We have configured exim and postfix to recognize all emails from mailman. So, it's not mandatory to make any new entries in /etc/aliases.

2007年5月13日 (日) 12:34的版本

This guide explains how to setup Mailman mailing list software with the apache web server and the exim mail server in Ubuntu. The intended audience is experienced linux users and system administrators.

Introduction

If you are new to Mailman, this section provides a quick introduction to Mailman.

Mailman is an open source program for managing electronic mail discussions and e-newsletter lists. Many open source mailing lists (including all the Ubuntu mailing lists) use Mailman as their mailing list software. It is powerful, easy to install and easy to maintain.

Assumptions

It is assumed that you know how to run linux commands, edit files, and start and stop services in the linux system. It is also assumed that you have administrative access to an Ubuntu system, that you have internet connection and that you have configured /etc/apt/sources.list.

Installation

Mailman provides the web interface for the administrators and users. Mailman uses an external mailserver to send/receive emails. It works perfectly with the following mailservers:

In this section, we will see howto install mailman, apache web server and Exim or Postfix mail server. If you wish to install mailman with other mail server, please refer the references pages. The references are given at the end of this page.

Apache2

Apache2 is already in the repository. Install the following packages: apache2 (see InstallingSoftware).

To be able to view archives of the mailman list you will need to create an alias in the apache configuration. Create a file in /etc/apache2/conf.d called mailman.conf and add the following

Alias /pipermail/ /var/lib/mailman/archives/public/
<Directory /var/lib/mailman/archives/public>
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Mail server integration

Exim4

Exim4 is already in the repository. Install the following packages: exim4 (see InstallingSoftware).

Once exim4 is installed, the configuration files are stored in /etc/exim4/. In ubuntu, by default, the exim4 configuration files are split accross different files. You can change this behaviour by changing the following variable in the file /etc/exim4/update-exim4.conf:

dc_use_split_config='true'

We can discuss more about exim4 configuration in next section.

If you face any problem during installation and if you are unable to solve it, please ask on the appropriate mailing list for further assistance.

Postfix

Install the following packages: postfix (see InstallingSoftware).

Just choose Internet Site and default options. For further details on Postfix installation, visit the UbuntuHelp:Postfix page.

Mailman

Mailman is already in the repository. Install the following packages: mailman (see InstallingSoftware).

It copies the installation files in /var/lib/mailman. It installs the cgi scripts in /usr/lib/cgi-bin/mailman directory.

It creates 'list' linux user'. It creates 'list' linux group. The mailman process would be owned by this user.

Configuration

This section assumes you have successfully completed the installation of mailman, apache and mail server. Now you just need to configure them. At the end of this section, your mailman will be ready to rock!

Mail server installation

Exim4 integration

Once exim4 is installed, you can run it using the following command:

# /etc/init.d/exim4 start

In order to make mailman work with exim4, you need to configure exim4. As mentioned earlier, by default, exim4 uses multiple configuration files of different types. For details, please refer Exim website.

To run mailman, we should make add new configuration file to the following configuration types:

  • Main
  • Transport
  • Router

Exim creates a master configuration file, by sorting all these mini configuration files. So, the order of these configuration files is important.

Main

All the configuration files belonging to main type are stored in /etc/exim4/conf.d/main/ directory. You can add the following content in a new file. You may name it as 04_exim4-config_mailman::

 # start
 # Home dir for your Mailman installation -- aka Mailman's prefix
 # directory.
 # By default this is set to "/usr/local/mailman"
 # On a Red Hat/Fedora system using the RPM use "/var/mailman"
 # On Debian using the deb package use "/var/lib/mailman"
 # This is normally the same as ~mailman
 MM_HOME=/var/lib/mailman
 #
 # User and group for Mailman, should match your --with-mail-gid
 # switch to Mailman's configure script.  Value is normally "mailman"
 MM_UID=list
 MM_GID=list
 #
 # Domains that your lists are in - colon separated list
 # you may wish to add these into local_domains as well
 domainlist mm_domains=bluestar.co.in
 #
 # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 #
 # These values are derived from the ones above and should not need
 # editing unless you have munged your mailman installation
 #
 # The path of the Mailman mail wrapper script
 MM_WRAP=MM_HOME/mail/mailman
 #
 # The path of the list config file (used as a required file when
 # verifying list addresses)
 MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
 # end
Transport

All the configuration files belonging to transport type are stored in /etc/exim4/conf.d/transport/ directory. You can add the following content in a new file. You may name it as 40_exim4-config_mailman::

  mailman_transport:
   driver = pipe
   command = MM_WRAP \
               '${if def:local_part_suffix \
                     {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1\}\}\} \
                     {post}}' \
               $local_part
    current_directory = MM_HOME
    home_directory = MM_HOME
    user = MM_UID
    group = MM_GID

IMPORTANT: In the above configuration, in line no 5, i've escaped three braces (\}\}\}) to make it compatible with this document. Please unescape it when you save this file.

Router

All the configuration files belonging to router type are stored in /etc/exim4/conf.d/router/ directory. You can add the following content in a new file. You may name it as 101_exim4-config_mailman::

  mailman_router:
   driver = accept
   require_files = MM_HOME/lists/$local_part/config.pck
   local_part_suffix_optional
   local_part_suffix = -bounces : -bounces+* : \
                       -confirm+* : -join : -leave : \
                       -owner : -request : -admin
   transport = mailman_transport

IMPORTANT: The order of main and transport configuration files can be in any order. But, the order of router configuration files must be in the same order. This particular file, must appear before 200_exim4-config_primary file. These two configuration files contain same type of information. The first file takes the precedence. For more details, please refer to the exim website or the references section in this page.

Postfix integration

For this integration, we will associates the domain lists.example.com with the mailing lists. As a consequence, the domain will be reserved for the mailing-list traffic. You can nevertheless have a website to this domain (usually, the domain lists.example.com is used by the mailing list system and for the mailman web interface).

Edit the main.cf to add the following lines:

relay_domains = lists.example.com
transport_maps = hash:/etc/postfix/transport
mailman_destination_recipient_limit = 1

In master.cf check that you ever have the following transport:

mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

It calls the postfix-to-mailman.py script when a mail is delivered to a list.

Associate the domain lists.example.com to the mailman transport with the transport map. Edit the file /etc/postfix/transport:

lists.example.com      mailman:

Do not forget to launch postmap -v /etc/postfix/transport after this modification.

That's all ! It is very easy and very efficient.

Mailman

Once mailman is installed, you should create the default mailing list. Run the following command:

  # newlist mailman
  Enter the email of the person running the list: bhuvaneswaran at NOSPAM gmail.com
  Initial mailman password:
  To finish creating your mailing list, you must edit your /etc/aliases (or
  equivalent) file by adding the following lines, and possibly running the
  `newaliases' program:

    mailman:              "|/var/lib/mailman/mail/mailman post mailman"
  mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
  mailman-bounces:      "|/var/lib/mailman/mail/mailman bounces mailman"
  mailman-confirm:      "|/var/lib/mailman/mail/mailman confirm mailman"
  mailman-join:         "|/var/lib/mailman/mail/mailman join mailman"
  mailman-leave:        "|/var/lib/mailman/mail/mailman leave mailman"
  mailman-owner:        "|/var/lib/mailman/mail/mailman owner mailman"
  mailman-request:      "|/var/lib/mailman/mail/mailman request mailman"
  mailman-subscribe:    "|/var/lib/mailman/mail/mailman subscribe mailman"
  mailman-unsubscribe:  "|/var/lib/mailman/mail/mailman unsubscribe mailman"

  Hit enter to notify mailman owner...

  # 


Once mailman is installed and the default mailing list created, you can run it using the following command:

# /etc/init.d/mailman start

We have configured exim and postfix to recognize all emails from mailman. So, it's not mandatory to make any new entries in /etc/aliases.

If you have made any changes to the configuration files, please ensure that you restart those services, before continuing to next section.

Administration

Web administration

In this section, we assume you have done the default installation. The mailman cgi scripts are still in /usr/lib/cgi-bin/mailman directory.

Mailman provides web based administration facility. To access this page, point your browser to the following url: http://hostname/cgi-bin/mailman/admin

The default mailing list, 'mailman' would appear in this screen. If you click the mailing list name, it would ask for authentication password. If you enter the correct password, you would be able to change administrative settings of this mailing list.

You can create new mailing list using command line utilility (newlist). Alternatively, you can create new mailing list using web interface.

For each list, you have three web sections:

  • http://hostname/cgi-bin/mailman/admin/list: admin interface for the list list.
  • http://hostname/cgi-bin/mailman/listinfo/list: user interface for the list list.
  • http://hostname/cgi-bin/mailman/admindb/list: pending messages waiting for approval.

Command line interface

Mailman also have a set of command line tools. Here are the most important:

  • newlist: add a new list
  • rmlist ''list'': delete a list
  • list_lists: list all the lists
  • list_members ''list'': list all the members of the list
  • add_members ''[email protected]'' ''list'': add e-mail [email protected] to the list list.
  • remove_members ''[email protected]'' ''list'': remove e-mail [email protected] to the list list
  • mmsitepass: define a site password to access administration web interfaces

Users

Mailman provides web based interfaces for users. To access this page, point your browser to the following url:

 http://hostname/cgi-bin/mailman/listinfo 

The default mailing list, 'mailman' would appear in this screen. If you click the mailing list name, it would display the subscription form. You can enter your email address, name (optional) and password to subscribe. An email intimation would be sent to you. You can follow the instructions in the email to subscribe.

References

Hope this document is useful. Feedbacks are welcome to bhuvaneswaran at NOSPAM gmail.com.


CategoryDocumentation