domingo, 13 de junho de 2010

Instalando Mailman

Instalação e configuração
apt-get install mailman
newlist mailman

vim /etc/mailman/mm_cfg.py
DEFAULT_EMAIL_HOST = 'listas.dominio.com'
DEFAULT_URL_HOST = 'listas.dominio.com'
MTA=None

/etc/init.d/mailman restart

Configuração do EXIM
vim /etc/exim4/conf.d/main/04_mailman_options
MM_HOME=/var/lib/mailman
MM_UID=list
MM_GID=list
domainlist mm_domains=listas.dominio.com
MM_WRAP=MM_HOME/mail/mailman
MM_LISTCHK=MM_HOME/lists/${lc::$local_part}/config.pck

vim /etc/exim4/conf.d/router/450_mailman_aliases
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

vim /etc/exim4/conf.d/transport/40_mailman_pipe
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

update-exim4.conf
/etc/init.d/exim4 restart

Configuração do APACHE
vim /etc/apache2/conf.d/mailman
Alias /pipermail /var/lib/mailman/archives/public
Alias /images/mailman /usr/share/images/mailman
<directory /var/lib/mailman/archives/public>
    DirectoryIndex index.html
</directory>


vim /etc/apache2/sites-enabled/000-default
<virtualhost *:80>
        ServerName listas.dominio.com
        ServerAdmin webmaster@listas.dominio.com
        DocumentRoot /var/www/
        <directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                RedirectMatch ^/$ /cgi-bin/mailman/listinfo
        </directory>
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </directory>
</virtualhost>


Defina a senha administrativa do MailMan com o comando: mmsitepass
Para acessar o MailMan abra seu browser e digite: http://listas.dominio.com/