1. 必备条件:
需要架设完成能正常工作的Mail server(这里使用postfix)
需要支持CGI1.1或以上的Web server(这里使用apache)
2. 需要添加用户及组,默认为mailman/mailman
如需使用其他用户,在编译时需加参数来指明
如:postfix/postfix
--with-username=postfix
--with-groupname=postfix
3. 创建安装目录mailman,编译时指定参数--prefix来使文件都放于此目录
目录的宿主是编译时指定的用户和组
该目录,需要设置为set-gid的权限,用来作为实际安装目录
chmod g+s mailman
4. ./configure \
--prefix=/mail/mailman --with-cgi-gid=postfix \
--with-mailhost=trust-mart.com --with-urlhost=mail.trust-mart.com \
--with-mail-gid=postfix --with-username=postfix --with-groupname=postfix
此处--with-cgi-gid,--with-mail-gid,--with-username,--with-groupname都需要根据apache及mail做具体设
置
例:
./configure --prefix=/usr/local/mailman --with-cgi-gid=apache --with-mailhost=xxxx.net --with-
urlhost= --with-username=mailman --with-groupname=mailman --with-mail-gid=nobody
5. 编译完成后,进入安装目录mailman,执行./bin/check_perms -f,检查安装!
主要是权限的检查,该命令会fix权限不对的地方,一边执行完毕,再执行一边
chown postfix.postfix /mail/mailman/*
6. 使用alias指定mailman的icons及pipermail目录的路径
使用scriptalias,指定mailman的cgi-bin目录的路径
在httpd.conf中,加入:
ScriptAlias /mailman/ /mail/mailman/cgi-bin/
Alias /icons/ /mail/mailman/icons/
Alias /pipermail/ /mail/mailman/archives/public/
order allow,deny
allow from all
order allow,deny
allow from all
Options +FollowSymLinks
order allow,deny
allow from all
/mail/httpd/bin/apachectl restart
7. vi /etc/postfix/main.cf
# recipient_delimiter = +
In order to support Mailman’s optional VERP delivery.
另:VERP(Variable Envelope Return Path,可变信封返回路径)
8. vi /etc/postfix/main.cf
添加:
recipient_delimiter = +
unknown_local_recipient_reject_code = 550
alias_maps = btree:/mail/mailman/data/aliases
virtual_alias_maps = mysql:/etc/postfix/sql/alias, btree:/mail/mailman/data/virtual-mailman
(如果已经该项已经设置,可以使用","在后面追加)
9. vi /mail/mailman/Mainman/mm_cfg.py
在最后,添加:
MTA = 'Postfix'
POSTFIX_ALIAS_CMD = '/usr/sbin/postalias'
POSTFIX_MAP_CMD = '/usr/sbin/postmap'
POSTFIX_STYLE_VIRTUAL_DOMAINS = ['trust-mart.com']
DEFAULT_SERVER_LANGUAGE = 'zh_CN'
10. 初始化别名文件
/mail/mailman/bin/genaliases
11. 设定别名文件权限
chown postfix:postfix data/aliases*
chmod g+w data/aliases*
12. 建立默认mailman列表,不执行此步,无法启动mailmanctl服务
newlist mailman
将初始化virtual-mailman数据库
13. 设定虚拟域文件权限
chown postfix:postfix data/virtual-mailman*
chmod g+w data/virtual-mailman*
14. vi /mail/mailman/data/virtual-mailman
添加本地域转发:@localhost.localdomain
例如:
# LOOP ADDRESSES START
mailman-loop@trust-mart.com mailman-loop@localhost.localdomain
# LOOP ADDRESSES END
# STANZA START: mailman
# CREATED: Fri Mar 21 15:05:53 2008
mailman@trust-mart.com mailman@localhost.localdomain
mailman-admin@trust-mart.com mailman-admin@localhost.localdomain
mailman-bounces@trust-mart.com mailman-bounces@localhost.localdomain
mailman-confirm@trust-mart.com mailman-confirm@localhost.localdomain
mailman-join@trust-mart.com mailman-join@localhost.localdomain
mailman-leave@trust-mart.com mailman-leave@localhost.localdomain
mailman-owner@trust-mart.com mailman-owner@localhost.localdomain
mailman-request@trust-mart.com mailman-request@localhost.localdomain
mailman-subscribe@trust-mart.com mailman-subscribe@localhost.localdomain
mailman-unsubscribe@trust-mart.com mailman-unsubscribe@localhost.localdomain
# STANZA END: mailman
15. 重新生成.db的二进制文件
rm -f /mail/mailman/data/virtual-mailman.db
postmap /mail/mailman/data/virtual-mailman
16. 启动mailman服务
bin/mailmanctl start
17. 重新启动postfix
postfix stop
postfix start
阅读(3562) | 评论(0) | 转发(0) |