1 安装邮件列表程序
apt-get install mailman
2 修改配置 /etc/mailman/mm_cfg.py 此服务器采用exim4作为邮件服务
DEFAULT_EMAIL_HOST = 'lists.mydomain.com'
DEFAULT_URL_HOST = 'www.mydomain.com'
MTA = None
3 添加默认的邮件列表
newlist mailman
4 设置邮件列表管理员帐号
mmsitepass
5 设置网页访问在apache的配置文件中增加:
代码:
ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
Alias /pipermail/ /var/lib/mailman/archives/public/
RedirectMatch ^/*$ http://www.mydomain.com/mailman/listinfo
<Directory "/var/lib/mailman/archives/public/">
AddDefaultCharset Off
</Directory>
<Directory "/usr/lib/cgi-bin/mailman/">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
使用 http://www.mydomain.com/ 来访问
6 修改exim4配置
增加:
MM_HOME=/var/lib/mailman
MM_UID=list
MM_GID=list
domainlist mm_domains=lists.mydomain.com
MM_WRAP=MM_HOME/mail/mailman
MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
增加router:
代码:
mailman_router:
driver = accept
domains = +mm_domains
require_files = MM_LISTCHK
local_part_suffix_optional
local_part_suffix = -admin : \
-bounces : -bounces+* : \
-confirm : -confirm+* : \
-join : -leave : \
-owner : -request : \
-subscribe : -unsubscribe
transport = mailman_transport
增加transport:
代码:
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/init.d/exim4 reload
校验:
代码:
# exim4 -bt test@lists.mydomain.com
test@lists.mydomain.com
router = mailman_router, transport = mailman_transport
7 修改管理转发帐号
修改 /etc/aliases 增加:
mailman: root
mailman-owner: mailman
执行newaliases增加完毕。
8 启动mailman
/etc/init.d/mailman start
9 启动计划任务
cd /usr/lib/mailman/cron
crontab crontab.in
好了完成!
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073