Mudanças entre as edições de "Razor2, pyzor e DCC Antispam no iRedMail"

De MochilaWiki
Ir para navegaçãoIr para pesquisar
(Criou página com 'Instalando Razor2 <source lang="bash"> # apt-get install razor # mkdir /var/lib/amavis/.razor # chown -Rf amavis:amavis /var/lib/amavis/.razor <br /> # su amavis $ razor-admin...')
 
 
(7 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 1: Linha 1:
Instalando Razor2
+
Testado em Debian 7 e 8
 +
 
 +
== Instalando Razor2 ==
 
<source lang="bash">
 
<source lang="bash">
 
# apt-get install razor
 
# apt-get install razor
 
# mkdir /var/lib/amavis/.razor
 
# mkdir /var/lib/amavis/.razor
 
# chown -Rf amavis:amavis /var/lib/amavis/.razor
 
# chown -Rf amavis:amavis /var/lib/amavis/.razor
<br />
+
 
 
# su amavis
 
# su amavis
 
$ razor-admin -home=/var/lib/amavis/.razor -create
 
$ razor-admin -home=/var/lib/amavis/.razor -create
Linha 12: Linha 14:
 
</source>
 
</source>
  
 +
em Debian 8 é necessário recompilar o razor (é importante adicionar repositório sources no sources.list)
 +
<source lang="bash">
 +
apt-get install fakeroot dh-buildinfo
 +
apt-get source razor
 +
apt-get build-dep razor
 +
dpkg-source -x razor_2.85-4.1.dsc
 +
cd razor-2.85/
 +
dpkg-buildpackage -rfakeroot -b
 +
dpkg -i razor_2.85-4.1_amd64.deb
 +
</source>
  
Instalando pyzor
+
== Instalando pyzor ==
 
<source lang="bash">
 
<source lang="bash">
 
# apt-get install pyzor
 
# apt-get install pyzor
 
# mkdir /var/lib/amavis/.pyzor
 
# mkdir /var/lib/amavis/.pyzor
 
# chown amavis:amavis /var/lib/amavis/.pyzor
 
# chown amavis:amavis /var/lib/amavis/.pyzor
<br />
+
 
 
# su amavis
 
# su amavis
 
$ pyzor --homedir /var/lib/amavis/.pyzor discover
 
$ pyzor --homedir /var/lib/amavis/.pyzor discover
 
$ exit
 
$ exit
 
</source>
 
</source>
 +
 +
== Instalando DCC ==
 +
<source lang="bash">
 +
wget http://www.dcc-servers.net/dcc/source/dcc-dccproc.tar.Z
 +
tar xzvf dcc-dccproc.tar.Z
 +
cd dcc-dccproc-*
 +
./configure --with-uid=amavis
 +
make
 +
make install
 +
chown -R amavis:amavis /var/dcc
 +
ln -s /var/dcc/libexec/dccifd /usr/local/bin/dccifd
 +
</source>
 +
 +
em /etc/spamassassin/v310.pre descomente a linha
 +
loadplugin Mail::SpamAssassin::Plugin::DCC
 +
 +
 +
verificando módulos carregados do spamassassin
 +
<source lang="bash">
 +
spamassassin --lint -D
 +
</source>
 +
 +
Verifificando servidores DCC
 +
<source lang="bash">
 +
cdcc info
 +
</source>
 +
  
 
Insira no final do arquivo /etc/spamassassin/local.cf
 
Insira no final do arquivo /etc/spamassassin/local.cf
Linha 28: Linha 67:
 
  score RAZOR2_CHECK 2.500
 
  score RAZOR2_CHECK 2.500
 
  score PYZOR_CHECK 2.500
 
  score PYZOR_CHECK 2.500
 +
<br />
 +
#dcc
 +
use_dcc 1
 +
dcc_path /usr/local/bin/dccproc
 +
score DCC_CHECK 1.500
  
 
Reinicia o amavis
 
Reinicia o amavis
Linha 35: Linha 79:
  
  
Testando
+
 
 +
== Adicionando regras no Iptables ==
 +
adicionei no final do arquivo /etc/default/iptables
 +
 
 +
# Razor2
 +
-A OUTPUT -p tcp --dport 2703 -j ACCEPT
 +
<br />
 +
# pyzor
 +
-A OUTPUT -p udp --dport 24441 -j ACCEPT
 +
-A INPUT -p tcp --dport 24441 -j ACCEPT
 +
 
 +
e reinicie
 +
 
 +
<source lang="bash">
 +
/etc/init.d/iptables restart
 +
</source>
 +
 
 +
== Testando ==
 
<source lang="bash">
 
<source lang="bash">
 
# su amavis
 
# su amavis
  
//test Razor2
+
//testando Razor2
 
$ spamassassin -t -D razor2 < /usr/share/doc/spamassassin/examples/sample-spam.txt
 
$ spamassassin -t -D razor2 < /usr/share/doc/spamassassin/examples/sample-spam.txt
  
//test pyzor
+
//testando pyzor
 
$ spamassassin -t -D pyzor < /usr/share/doc/spamassassin/examples/sample-spam.txt
 
$ spamassassin -t -D pyzor < /usr/share/doc/spamassassin/examples/sample-spam.txt
 
</source>
 
</source>
 +
 +
  
  
 
== Referências ==
 
== Referências ==
 
* http://oskarhane.com/better-spam-protection-for-iredmail-by-adding-razor2-and-pyzor/
 
* http://oskarhane.com/better-spam-protection-for-iredmail-by-adding-razor2-and-pyzor/
 +
* http://www.iredmail.org/forum/topic1880-iredmail-support-tutorial-install-and-enable-dcc-antispam-on-iredmailubuntu.html

Edição atual tal como às 13h00min de 6 de julho de 2017

Testado em Debian 7 e 8

Instalando Razor2

# apt-get install razor
# mkdir /var/lib/amavis/.razor
# chown -Rf amavis:amavis /var/lib/amavis/.razor

# su amavis
$ razor-admin -home=/var/lib/amavis/.razor -create
$ razor-admin -home=/var/lib/amavis/.razor -discover
$ razor-admin -home=/var/lib/amavis/.razor -register
$ exit

em Debian 8 é necessário recompilar o razor (é importante adicionar repositório sources no sources.list)

apt-get install fakeroot dh-buildinfo
apt-get source razor
apt-get build-dep razor
dpkg-source -x razor_2.85-4.1.dsc 
cd razor-2.85/
dpkg-buildpackage -rfakeroot -b
dpkg -i razor_2.85-4.1_amd64.deb

Instalando pyzor

# apt-get install pyzor
# mkdir /var/lib/amavis/.pyzor
# chown amavis:amavis /var/lib/amavis/.pyzor

# su amavis
$ pyzor --homedir /var/lib/amavis/.pyzor discover
$ exit

Instalando DCC

wget http://www.dcc-servers.net/dcc/source/dcc-dccproc.tar.Z
tar xzvf dcc-dccproc.tar.Z
cd dcc-dccproc-*
./configure --with-uid=amavis
make
make install
chown -R amavis:amavis /var/dcc
ln -s /var/dcc/libexec/dccifd /usr/local/bin/dccifd

em /etc/spamassassin/v310.pre descomente a linha

loadplugin Mail::SpamAssassin::Plugin::DCC


verificando módulos carregados do spamassassin

spamassassin --lint -D

Verifificando servidores DCC

cdcc info


Insira no final do arquivo /etc/spamassassin/local.cf

use_razor2 1
score RAZOR2_CHECK 2.500
score PYZOR_CHECK 2.500

#dcc use_dcc 1 dcc_path /usr/local/bin/dccproc score DCC_CHECK 1.500

Reinicia o amavis

/etc/init.d/amavis restart


Adicionando regras no Iptables

adicionei no final do arquivo /etc/default/iptables

# Razor2
-A OUTPUT -p tcp --dport 2703 -j ACCEPT

# pyzor -A OUTPUT -p udp --dport 24441 -j ACCEPT -A INPUT -p tcp --dport 24441 -j ACCEPT

e reinicie

/etc/init.d/iptables restart

Testando

# su amavis

//testando Razor2
$ spamassassin -t -D razor2 < /usr/share/doc/spamassassin/examples/sample-spam.txt

//testando pyzor
$ spamassassin -t -D pyzor < /usr/share/doc/spamassassin/examples/sample-spam.txt



Referências