1 安装邮件列表程序
apt-get install mailman
2 修改配置 /etc/mailman/mm_cfg.py 此服务器采用exim4作为邮件服务
DEFAULT_EMAIL_HOST = ‘netsec.ccert.edu.cn’ 将内容修改为自己的邮件列表后缀域名
DEFAULT_URL_HOST = ‘netsec.ccert.edu.cn’
MTA = None 把#注释去掉
3 添加默认的邮件列表
newlist mailman
4 设置邮件列表管理员帐号
mmsitepass
5 修改exim4配置
增加04_exim4-config_mailman:
MM_HOME=/var/lib/mailman
MM_UID=list
MM_GID=list
domainlist mm_domains=netsec.ccert.edu.cn
MM_WRAP=MM_HOME/mail/mailman
MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
增加router/101_exim4-config_mailman:
代码:
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/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/update-exim4.conf.conf
dc_eximconfig_configtype=’internet’ 这样才能向外发邮件
dc_other_hostnames=’netsec.ccert.edu.cn’
dc_local_interfaces=’202.112.50.221;127.0.0.1 ; ::1′
dc_readhost=”
dc_relay_domains=’netsec.ccert.edu.cn’
dc_minimaldns=’false’
dc_relay_nets=”
dc_smarthost=”
CFILEMODE=’644′
dc_use_split_config=’true’
dc_hide_mailname=”
dc_mailname_in_oh=’true’
dc_localdelivery=’mail_spool’
执行 /etc/init.d/exim4 reload
校验:
代码:
# exim4 -bt mailman@netsec.ccert.edu.cn
mailman@netsec.ccert.edu.cn
router = mailman_router, transport = mailman_transport
6 修改管理转发帐号
修改 /etc/aliases 增加:
mailman: root
mailman-owner: mailman
7 如果添加了新的邮件列表需要向aliases加入类似于
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”
执行newaliases增加完毕。
8 启动mailman
/etc/init.d/mailman start
9 启动计划任务
cd /usr/lib/mailman/cron
crontab crontab.in
10 修改apache2
sudo ln -s /etc/mailman/apache.conf /etc/apache2/sites-enabled/mailman
sudo /etc/init.d/apache2 restart
好了完成!
需要注意的地方:
1 如果建立新列表并添加用户,然后用户能够接受到订阅信,但是向邮件列表发信没有转发时,可以检查exim4设置。看设置是否正确。
2 如果无法访问存档,检查/var/lib/mailman/archives目录权限和读写设置。
apt-get install mailman
2 修改配置 /etc/mailman/mm_cfg.py 此服务器采用exim4作为邮件服务
DEFAULT_EMAIL_HOST = ‘netsec.ccert.edu.cn’ 将内容修改为自己的邮件列表后缀域名
DEFAULT_URL_HOST = ‘netsec.ccert.edu.cn’
MTA = None 把#注释去掉
3 添加默认的邮件列表
newlist mailman
4 设置邮件列表管理员帐号
mmsitepass
5 修改exim4配置
增加04_exim4-config_mailman:
MM_HOME=/var/lib/mailman
MM_UID=list
MM_GID=list
domainlist mm_domains=netsec.ccert.edu.cn
MM_WRAP=MM_HOME/mail/mailman
MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck
增加router/101_exim4-config_mailman:
代码:
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/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/update-exim4.conf.conf
dc_eximconfig_configtype=’internet’ 这样才能向外发邮件
dc_other_hostnames=’netsec.ccert.edu.cn’
dc_local_interfaces=’202.112.50.221;127.0.0.1 ; ::1′
dc_readhost=”
dc_relay_domains=’netsec.ccert.edu.cn’
dc_minimaldns=’false’
dc_relay_nets=”
dc_smarthost=”
CFILEMODE=’644′
dc_use_split_config=’true’
dc_hide_mailname=”
dc_mailname_in_oh=’true’
dc_localdelivery=’mail_spool’
执行 /etc/init.d/exim4 reload
校验:
代码:
# exim4 -bt mailman@netsec.ccert.edu.cn
mailman@netsec.ccert.edu.cn
router = mailman_router, transport = mailman_transport
6 修改管理转发帐号
修改 /etc/aliases 增加:
mailman: root
mailman-owner: mailman
7 如果添加了新的邮件列表需要向aliases加入类似于
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”
执行newaliases增加完毕。
8 启动mailman
/etc/init.d/mailman start
9 启动计划任务
cd /usr/lib/mailman/cron
crontab crontab.in
10 修改apache2
sudo ln -s /etc/mailman/apache.conf /etc/apache2/sites-enabled/mailman
sudo /etc/init.d/apache2 restart
好了完成!
需要注意的地方:
1 如果建立新列表并添加用户,然后用户能够接受到订阅信,但是向邮件列表发信没有转发时,可以检查exim4设置。看设置是否正确。
2 如果无法访问存档,检查/var/lib/mailman/archives目录权限和读写设置。
No comments:
Post a Comment