跳至主要内容

Mailman,Apache2,exim4

要安装 exim4,运行下列命令:

sudo apt-get install exim4 exim4-base exim4-config
要配置 exim4,运行下列命令:
sudo dpkg-reconfigure exim4-config

Apache2因为在装WordPress的时候已经装过,所以不在详细安装。

安装maiman

sudo apt-get install mailman(期间会有提示)

它复制安装文件到 /var/lib/mailman 目录,将 CGI 脚本安装到 /usr/lib/cgi-bin/mailman目录,创建 list linux 用户,创建 list linux 用户组。mailman 进程将以该用户运行。

再我安装好以后似乎提示site list for mailman missing,Please create it;until then,mailman will refuse to start

看来还要自己建议一个sitelist才可以启动mainman,暂时先不管他,先继续下面的配置

一旦 apache2 安装之後,您可以在 /etc/apache2/apache2.conf 文件添加下列行:

Alias /images/mailman/ "/usr/share/images/mailman/"
Alias /pipermail/ "/var/lib/mailman/archives/public/"

Mailman 使用 apache2 来运行它的 CGI 脚本。mailman 的 CGI 脚本被安装在 /usr/lib/cgi-bin/mailman 目录中。因此 mailman 的 url 将是 http://hostname/cgi-bin/mailman/。如果您希望改变这一状况,您可以修改 /etc/apache2/apache2.conf 文件。

为了使 mailman 可以和 exim4 一起工作,您需要配置 exim4。正如先前所说的那样,在缺省状态下 exim4 使用不同类型的多个配置文件。详情请参考 Exim 网站。要运行 mailman,我们可以新建一个配置文件到下列配置类型:主,传输,路由。

所有隶属于主类别的配置文件都被保存在 /etc/exim4/conf.d/main/ 目录中。您可以将下面的内容添加到一个名为 04_exim4-config_mailman 的新文件中:

MM_HOME=/var/lib/mailman
MM_UID=list
MM_GID=list
domainlist mm_domains=hostname.com↵
MM_WRAP=MM_HOME/mail/mailman
MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck

所有隶属于传输类型的文件被保存在 /etc/exim4/conf.d/transport/ 目录中。您可以将下面的内容添加到一个名为 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

所有隶属于路由类的所有配置文件都被保存在 /etc/exim4/conf.d/router/ 目录中。您可以将下列内容添加到名为 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

主类和传输类的配置文件的顺序可以随意。但路由类的配置文件的顺序必须相同。该文件必须在 200_exim4-config_primary 文件之前出现。如果两个配置文件包含相同类型的信息。

sudo /usr/sbin/newlist mailman 提示你

Enter the email address of the person running the list: xx@xx.com

Initial mailman password:

似乎我后面的那一段没有就没有添加了,接下来是运行
http://hostname/cgi-bin/mailman/admin,由于不喜欢在localhost上面搞这个,还是用我的远程设置好了

  • 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 ''user@example.com'' ''list'': add e-mail user@example.com to the list list.
  • remove_members ''user@example.com'' ''list'': remove e-mail user@example.com to the list list
  • mmsitepass: define a site password to access administration web interfaces





评论

此博客中的热门博文

4 steps to delete account in Gerrit DB

4 steps to delete account in DB. Delete from accounts where preferred_email=’’; delete from account_ssh_keys where account_id=''; delete from account_external_ids where external_id='gerrit:*’; delete from account_external_ids where external_id='username:*’; whatever it was in H2 database and postgres db . H2: ssh -p 24198 localhost gerrit gsql Postgres: psql

mod

apache安装后,如果想再添加模块,往往不想重新安装一次,再者,我在安装中发现,并不是安装文件中所有的modules都会被默认安装,即使在安装中使用了 ./configure --prefix=/usr/local/apache --enable-so --enable-modules=all --enable-mods-shared=all也是如此。我使用上述方法安装的apache2.2.6就没有安装proxy相关模块。这时,需要手工生成so文件,但会自动的被复制到你的apache安装目录的modules中,然后修改apache的配置文件,加载相关模块,验证apache配置并重启服务即可。以上描述的具体操作步骤如下: 操作系统:linux redhat 4.5 ES apache版本:2.2.6 可自行下载tar包 1. 拷贝安装包到/usr/local,并在目标目录下进行解压。[root@localhost local]# cd /usr/local[root@localhost local]# tar -zxvf httpd-2.2.4.tar.gz2. 配置安装参数,安装的目标目录为/usr/local/apache,建议设置enable-mods-shared=all,不用的module注释掉就行了![root@localhost local]# cd httpd-2.2.4[root@localhost httpd-2.2.4]# ./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all3. 编译并安装。[root@localhost httpd-2.2.4]# make[root@localhost httpd-2.2.4]# make install4. 启动Apache,并测试。[root@localhost httpd-2.2.4]# cd /usr/local/apache/bin[root@localhost bin]# ./apachectl start 打开浏览器,并在地址栏中输入主机的IP地址如 http://192.168.1.254/ 如果出现以下画面则说明安装成功。It works! 注意:安装完成后检查系统服务中的HTTPD服务是否已