Configuração do DSPAM (mandriva)
  1. Instalar os pacotes necessários ao funcionamento do DSPAM:
    urpmi dspam-backend-pgsql dspam-cgi postfix-pcre apache-mod_auth_imap
    
  2. Adicionar o usuário apache ao grupo mail.
    usermod -G mail apache
    
  3. Copiar o arquivo default.prefs do site da LBr para o servidor:
    cd /var/lib/dspam
    wget suporte.lbr.com.br/confs/eadm/default.prefs
    
  4. Iniciar o serviço postgresql e configurá-lo para iniciar automaticamente:
    service postgresql restart
    chkconfig postgresql on
  5. Criar a base de dados do DSPAM:
    createuser -U postgres --no-createdb --no-adduser --no-createrole dspam
    createdb   -U postgres dspam --owner dspam
    createlang -U postgres plpgsql dspam
    psql       -U postgres dspam < /usr/share/dspam-pgsql/virtual_users.sql
    psql       -U postgres dspam < /usr/share/dspam-pgsql/pgsql_objects.sql
    psql       -U postgres dspam
    dspam=# alter user dspam with password 'xxx';
    ALTER TABLE dspam_preferences OWNER TO dspam;
    ALTER TABLE dspam_signature_data OWNER TO dspam;
    ALTER TABLE dspam_stats OWNER TO dspam;
    ALTER TABLE dspam_token_data OWNER TO dspam;
    ALTER TABLE dspam_virtual_uids OWNER TO dspam;
    ALTER TABLE dspam_virtual_uids_seq OWNER TO dspam;
    q
    
  6. Copiar o arquivo dspam.conf do site da LBr para o servidor:
    cd /etc
    mv dspam.conf dspam.conf.old
    wget suporte.lbr.com.br/confs/eadm/dspam.conf
    
  7. Alterar o seguinte parâmetro no arquivodspam.conf com a senha criada para a base de dados do DSPAM:
    PgSQLServer    	127.0.0.1
    PgSQLPort      	5432
    PgSQLUser      	dspam
    PgSQLPass      	xxx
    
    PgSQLUIDInSignature  on
    
  8. Editar o arquivo dspam.conf:
    TrustedDeliveryAgent "/usr/lib64/dovecot/deliver -d %u"
    
    
    QuarantineAgent "/usr/lib64/dovecot/deliver -d %u -m Spam"
    ps.: Caso a arquitetura seja 32 Bits:
    TrustedDeliveryAgent "/usr/lib/dovecot/deliver -d %u"
    
    
    QuarantineAgent "/usr/lib/dovecot/deliver -d %u -m Spam"
  9. Configurar permissões para o dspam:
    find /var/lib/dspam -type d -exec chmod 770 {} ;
    find /var/lib/dspam -type d -exec chmod g+s {} ;
    chown -R dspam:mail /var/lib/dspam/
    
  10. Copiar o arquivo configure.pl do site de LBr para o servidor:
    cd /usr/share/dspam/cgi-bin
    mv configure.pl configure.pl.old
    wget http://suporte.lbr.com.br/confs/eadm/configure.pl
  11. Editar o arquivo main.cf. Adicionar a seguinte linha:

    smtpd_client_restrictions =
                           permit_sasl_authenticated,
                           check_client_access hash:/etc/postfix/access,
                           permit_mynetworks,
                           reject_unknown_client,
                           reject_rbl_client bl.spamcop.net,
                           reject_rbl_client dnsbl.njabl.org,
                           reject_rbl_client list.dsbl.org,
                           reject_rbl_client sbl.spamhaus.org,
                           check_client_access pcre:/etc/postfix/dspam_filter_access
  12. Copiar o arquivo dspam_filter_access do site de LBr para o servidor:
    cd /etc/postfix
    wget http://suporte.lbr.com.br/confs/eadm/dspam_filter_access
  13. Copiar o arquivo clamd.conf do site da LBr para o servidor:
    cd /etc
    mv clamd.conf clamd.conf.old
    wget http://suporte.lbr.com.br/confs/eadm/clamd.conf
  14. Copiar o arquivo dspam-cgi.conf do site da LBr para o servidor:
    cd /etc/httpd/conf/webapps.d
    rm -f dspam.conf
    wget http://suporte.lbr.com.br/confs/eadm/dspam-cgi.conf
  15. Iniciar o serviço clamd e configurá-lo para iniciar automaticamente:
    service clamd start
    chkconfig clamd on
  16. Reiniciar o postfix:
    service postfix restart
  17. Reiniciar o apache:
    service httpd restart
IP
3.237.16.210