Chinaunix首页 | 论坛 | 博客
  • 博客访问: 758095
  • 博文数量: 434
  • 博客积分: 11187
  • 博客等级: 上将
  • 技术积分: 5221
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-19 01:00
文章分类

全部博文(434)

文章存档

2016年(2)

2013年(1)

2012年(115)

2011年(195)

2010年(32)

2009年(89)

分类: LINUX

2011-06-22 13:58:35

1、mailman-2.1.14-1下载并安装:
#wget %202.1%20%28stable%29/2.1.14/mailman-2.1.14-1.tgz?r=http%3A%2F%2Fsourceforge.net%2Fsearch%2F%3Fq%3Dmailman&ts=1308636612&use_mirror=cdnetworks-kr-1

#groupadd mailman
#useradd -d /no/home -c "GNU Mailman" -s /sbin/nologin -g mailman mailman
#mkdir /var/www/extsuite/mailman&&chown vmail.vmail /var/www/extsuite/mailman&&chmod 02775 /var/www/extsuite/mailman
 
#tar zxvf  mailman-2.1.14-1.tgz
#cd mailman-2.1.14-1
#./configure --prefix=/var/www/extsuite/mailman \
--with-username=vmail \
--with-groupname=vmail \
--with-mail-gid=1006 \
--with-cgi-gid=1001 \
--with-mailhost=mail.test.com \
--with-urlhost=mail.test.com
# make
# make install

注意:
mailman:x:1006:1006:GNU Mailman:/no/home:/sbin/nologin
vmail:x:1001:1001::/home/vmail:/bin/bash
在此使用mailman做为MAIL_GID是为了避免在后期的维护中使用check_perms -f修复权限的时候,
mailman会自动默认修改为mailman这个用户来转发邮件。
而使用 CGI_GID=vmail作为mailman的CGI执行权限是为了跟extmail/extman执行cgi时的权限一致。

2、配置mailman
#cd /var/www/extsuite/mailman
#touch data/aliases
#touch data/virtual-mailman

Run the bin/genaliases script to initialize your aliases file.
# ./bin/genaliases

#chown -R vmail.vmail /var/www/extsuite/mailman/data/aliases*
#chown -R vmail.vmail /var/www/extsuite/mailman/data/virtual-mailman*
#chmod 664 /var/www/extsuite/mailman/data/aliases*
#chmod 664 /var/www/extsuite/mailman/data/virtual-mailman*
#cp -Rfp icons/ cgi-bin/icons

修改mailman管理界面的管理员密码,以便通过界面认证后能够通过界面创建和操作邮件列表
Next, setup Mailman site password and list creator password with following command:
# ./bin/mmsitepass        << 初设密码为:654321
# ./bin/mmsitepass -c    << 初设密码为:654321

编辑/var/www/extsuite/mailman/Mailman/mm_cfg.py,增加如下内容:
# vi Mailman/mm_cfg.py
增加如下部分
DEFAULT_EMAIL_HOST = 'mail.test.com'
DEFAULT_URL_HOST = 'mail.test.com'
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
MTA = 'Postfix'
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['mail.test.com','test.com']
add_virtualhost('mail.test.com','test.com')
DEFAULT_SERVER_LANGUAGE = 'zh_CN'

# 执行配置自动检查和修复
# ./bin/check_perms -f
#chmod o-x /var/www/extsuite/mailman/archives/private

# 创建邮件列表mailman
Create the system list for mailman:
# ./bin/newlist mailman
Enter the email of the person running the list: (这里输入邮件列表所有者的邮件地址)
Initial public password: (这里输入管理密码)
Hit enter to notify public owner...(回车)
即:
Enter the email of the person running the list: <Initial mailman password:   <<输入密码123456
Hit enter to notify mailman owner...

# 把用户添加到邮件列表里测试一下,建一个文本文件,比如members.txt,一行一个邮件地址,然后执行如下命令
#vi members.txt
admin@test.com
test@test.com
# ./bin/add_members -n members.txt mailman

3、配置postfix
# vi /etc/postfix/main.cf
#myorigin = $mydomain   #建议注释掉myorigin(不注释该行mailman将无法使用,原因暂时不明)
virtual_alias_domains = mail.test.com
recipient_delimiter = +
owner_request_special = no
alias_maps = hash:/etc/aliases,hash:/var/www/extsuite/mailman/data/aliases
virtual_alias_maps = hash:/var/www/extsuite/mailman/data/virtual-mailman,mysql:/etc/postfix/mysql/mysql_virtual_alias_maps.cf
transport_maps = hash:/etc/postfix/transport
default_privs = mailman

#postalias /var/www/extsuite/mailman/data/aliases
#postmap /var/www/extsuite/mailman/data/virtual-mailman

# vi /etc/postfix/transport
insert into transport set domain='mail.test.com',destination='local:';
# /usr/sbin/postmap /etc/postfix/transport
#postfix reload

4、配置mailman的web配置,这里以httpd.conf的虚拟主机为例
#  vi /etc/apache/extra/httpd-vhosts.conf

   
    ServerName mail.test.com
    ScriptAlias /mailman/ "/var/www/extsuite/mailman/cgi-bin/"
       
        Options  ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
       


        Alias /pipermail "/var/www/extsuite/mailman/archives/public/"
       
        AddDefaultCharset Off
        AllowOverride None
        Options +FollowSymlinks
        Order allow,deny
        Allow from all
       

   


#chmod -R vmail.vmail /var/www/extsuite/mailman
#chmod 02775 /var/www/extsuite/mailman -R
#./bin/check_perms -f
#chmod u-s,g-s /var/www/extsuite/mailman/cgi-bin -R
#chmod g-w cgi-bin /var/www/extsuite/mailman/cgi-bin -R

重启apache:
#/usr/local/apache/bin/apachectl stop
#/usr/local/apache/bin/apachectl start

启动Mailman's qrunner daemon 服务:
#/var/www/extsuite/mailman/bin/mailmanctl start

5、配置完成,重启httpd、postfix、mailman即可
使用以下链接登录mailman的管理员界面

使用以下链接查看当前主机的所有邮件列表

使用以下链接创建一个新的邮件列表:


6、参考:Setting up suEXEC and Mailman so they'll play nice:


On the system I administer (A Redhat 6.0 installation) we are
running suEXEC so that users can safely run CGIs.  However, this presents
difficulties with Mailman, since its CGIs are SGID so that, in a normal
environment, any user can run it.  That being said, here's how to set up
an installation of Mailman in an suEXEC environment:

1. Create your installation directory.  I used
/usr/local/apache/htdocs/mailman on my system.  I have mailman in the
/usr/local/apache/htdocs directory since that is "root" to suEXEC.

2. You'll need to create a Mailman user, then chgrp the directory
to the Mailman user so that the configure script doesn't complain.  Then,
chmod 2755 the directory since configure also wants it to be SGID.

3. Run configure like this:

    ./configure --prefix=/usr/local/apache/htdocs/mailman --with-cgi-gid=doug
    --with-mail-gid=your_mailservers_gid

4. Make install

5. Change ownership on the Mailman installation to the user
owning it.  "chmod -R doug.doug /usr/local/apache/htdocs/mailman" worked
for me.

6. "chmod u-s,g-s" the contents of the cgi-bin directory so that
suEXEC doesn't complain about trying to run a SUID/SGID program.

7. "chmod g-w cgi-bin" so that suEXEC doesn't complain about the
directory being writable by others.

8. Configure the webserver(s) using Mailman with the User and Group
directive to be set accordingly.

9. Proceed with the other steps in the mailman installation, but
be sure that it's done in terms of the user that you set this up, NOT
mailman.  In fact, after configure is run, you should be able to safely
delete the mailman user and his home directory, as they will not be
needed anymore.



阅读(3163) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~