个人工具
119.28.94.63
该IP地址的讨论
登录
查看“UbuntuHelp:Mailman”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Mailman”的源代码
来自Ubuntu中文
←
UbuntuHelp:Mailman
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Mailman}} {{Languages|UbuntuHelp:Mailman}} '''This guide explains how to setup [http://www.list.org/ Mailman] mailing list software with the Apache web server and either the Exim4 or Postfix mail servers on 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 [http://lists.ubuntu.com 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 <code><nowiki>/etc/apt/sources.list</nowiki></code>. == 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: * [http://www.postfix.org Postfix] * [http://www.exim.org Exim] * [http://www.sendmail.org Sendmail] * [http://qmail.org/top.html Qmail] 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 another mail server, please refer the reference pages given at the end of the guide. === Apache2 === Apache2 is already in the repository. Install the following packages: <code><nowiki>apache2</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). === Mailman === Mailman is Main in the repository. Install the following packages: <code><nowiki>mailman</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). It copies the installation files in <code><nowiki>/var/lib/mailman</nowiki></code>. It installs the cgi scripts in <code><nowiki>/usr/lib/cgi-bin/mailman</nowiki></code> directory. The package creates a 'list' user and a 'list' group. The mailman process is be owned by this user. === Mail server installation === You only need one Mail Transport Agent (MTA) installed and configured in order to use Mailman. Here are instructions and for installing Exim4 and Postfix. ==== Exim4 ==== Exim4 is already in the repository. Install the following packages: <code><nowiki>exim4</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). See the [[UbuntuHelp:Exim4|Exim4]] page for more details on installing and configuring Exim4. This example uses split configuration (Exim4 default, multiple configuration files), not monolithic/unsplit configuration (a single file). ==== Postfix ==== Install the following packages: <code><nowiki>postfix</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). Just choose ''Internet Site'' and default options. For further details on Postfix installation, visit the [[UbuntuHelp:Postfix|Postfix]] page. == Configuration == This section assumes you have successfully completed the installation of Mailman, Apache and a Mail server. Now you just need to configure them. At the end of this section, your Mailman will be ready to rock! === Apache Configuration === An example Apache configuration file comes with Mailman and is placed in <code><nowiki>/etc/mailman/apache.conf</nowiki></code>. In order for Apache to use the config file it needs to be copied to <code><nowiki>/etc/apache2/sites-enabled</nowiki></code>: <pre><nowiki> sudo ln -s ../../mailman/apache.conf /etc/apache2/sites-enabled/mailman </nowiki></pre> This will setup a new Apache '''VirtualHost''' for the Mailman administration site. Once you have created the symbolic link, you'll need to enable it and restart Apache: <pre><nowiki> sudo /etc/init.d/apache2 restart </nowiki></pre> === Postfix Configuration === For this integration, we will associates the domain <code><nowiki>lists.example.com</nowiki></code> 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 <code><nowiki>lists.example.com</nowiki></code> is used by the mailing list system and for the mailman web interface). You can use the '''postconf''' command to add the necessary configuration to <code><nowiki>/etc/postfix/main.cf</nowiki></code>: <pre><nowiki> sudo postconf -e 'relay_domains = lists.example.com' sudo postconf -e 'transport_maps = hash:/etc/postfix/transport' sudo postconf -e 'mailman_destination_recipient_limit = 1' </nowiki></pre> In <code><nowiki>/etc/postfix/master.cf</nowiki></code> double check that you have the following transport: <pre><nowiki> mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} </nowiki></pre> It calls the <code><nowiki>postfix-to-mailman.py</nowiki></code> script when a mail is delivered to a list. Associate the domain <code><nowiki>lists.example.com</nowiki></code> to the <code><nowiki>mailman</nowiki></code> transport with the transport map. Edit the file <code><nowiki>/etc/postfix/transport</nowiki></code>: <pre><nowiki> lists.example.com mailman: </nowiki></pre> Now have Postfix build the '''transport''' map by entering the following from a terminal prompt: <pre><nowiki> sudo postmap -v /etc/postfix/transport </nowiki></pre> Then restart Postfix to enable the new configurations: <pre><nowiki> sudo /etc/init.d/postfix restart </nowiki></pre> That's all ! It is very easy and very efficient. === Exim4 Configuration === Once exim4 is installed, you can run it using the following command: <pre><nowiki> # /etc/init.d/exim4 start </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. To run mailman, we should make add new configuration file to each of 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. This is accomplished using certain file names prefixed by a number. See below. ==== Main ==== All the configuration files belonging to main type are stored in <code><nowiki>/etc/exim4/conf.d/main/</nowiki></code> directory. You can add the following content in a new file. You may name it as <code><nowiki>04_exim4-config_mailman</nowiki></code>:: <pre><nowiki> # 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=lists.example.com # # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # 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 </nowiki></pre> '''IMPORTANT: Please replace lists.example.com with your own domain''' ==== Transport ==== All the configuration files belonging to transport type are stored in <code><nowiki>/etc/exim4/conf.d/transport/</nowiki></code> directory. You can add the following content in a new file. You may name it as <code><nowiki>40_exim4-config_mailman</nowiki></code>:: <pre><nowiki> 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 </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 (by deleting the backslashes before each brace) when you save this file. ''' ==== Router ==== All the configuration files belonging to router type are stored in <code><nowiki>/etc/exim4/conf.d/router/</nowiki></code> directory. You can add the following content in a new file. You may name it as <code><nowiki>101_exim4-config_mailman</nowiki></code>:: <pre><nowiki> 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 </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 <code><nowiki>200_exim4-config_primary</nowiki></code> file. These two configuration files contain same type of information. The first file takes the precedence. For more details, please refer to the [http://www.exim.org exim] website or the references section in this page. === Mailman Configuration === Once mailman is installed, you should create the default mailing list. Run the following command: <pre><nowiki> # sudo 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 mailing list 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... # </nowiki></pre> Once mailman is installed and the default mailing list created, you can run it using the following command: <pre><nowiki> sudo /etc/init.d/mailman start </nowiki></pre> We have configured Exim4 or 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 <code><nowiki>/usr/lib/cgi-bin/mailman</nowiki></code> directory. Mailman provides web based administration facility. To access this page, point your browser to the following url: <code><nowiki>http://hostname/cgi-bin/mailman/admin</nowiki></code> 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: * <code><nowiki>http://hostname/cgi-bin/mailman/admin/list</nowiki></code>: admin interface for the list ''list''. * <code><nowiki>http://hostname/cgi-bin/mailman/listinfo/list</nowiki></code>: user interface for the list ''list''. * <code><nowiki>http://hostname/cgi-bin/mailman/admindb/list</nowiki></code>: pending messages waiting for approval. === Command line interface === Mailman also have a set of command line tools. Here are the most important: * <code><nowiki>newlist</nowiki></code>: add a new list * <code><nowiki>rmlist ''list''</nowiki></code>: delete a list * <code><nowiki>list_lists</nowiki></code>: list all the lists * <code><nowiki>list_members ''list''</nowiki></code>: list all the members of the list * <code><nowiki>add_members ''user@example.com'' ''list''</nowiki></code>: add e-mail ''user@example.com'' to the list ''list''. * <code><nowiki>remove_members ''user@example.com'' ''list''</nowiki></code>: remove e-mail ''user@example.com'' to the list ''list'' * <code><nowiki>mmsitepass</nowiki></code>: 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: <code><nowiki> http://hostname/cgi-bin/mailman/listinfo </nowiki></code> 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 == * [http://www.list.org/mailman-install/index.html GNU Mailman - Installation Manual] * [http://www.exim.org/howto/mailman21.html HOWTO - Using Exim 4 and Mailman 2.1 together] Hope this document is useful. Feedbacks are welcome to bhuvaneswaran at NOSPAM gmail.com. ---- [[category:CategoryEmail]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Mailman
。