<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Coleção de shell scrits e tutoriais</title>
	<atom:link href="http://shellscript.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shellscript.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 16 Sep 2006 16:35:41 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='shellscript.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Coleção de shell scrits e tutoriais</title>
		<link>http://shellscript.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://shellscript.wordpress.com/osd.xml" title="Coleção de shell scrits e tutoriais" />
	<atom:link rel='hub' href='http://shellscript.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Finalizando todos os processos de um usuário</title>
		<link>http://shellscript.wordpress.com/2006/09/16/finalizando-todos-os-processos-de-um-usuario/</link>
		<comments>http://shellscript.wordpress.com/2006/09/16/finalizando-todos-os-processos-de-um-usuario/#comments</comments>
		<pubDate>Sat, 16 Sep 2006 16:35:35 +0000</pubDate>
		<dc:creator>clubedebian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shellscript.wordpress.com/2006/09/16/finalizando-todos-os-processos-de-um-usuario/</guid>
		<description><![CDATA[Para matar um programa com o comando kill é preciso do número PID do processo, para conseguir o número PID, ou você usa pidof programa ou lista todos os processos e olha o PID do programa que te interessa. E se você quiser finalizar todos os processos de um determinado usuário ? E se tiver [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=6&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[</p>
<p>Para<br />
matar um programa com o comando kill é preciso do número PID do<br />
processo, para conseguir o número PID, ou você usa pidof programa ou<br />
lista todos os processos e olha o PID do programa que te interessa. E<br />
se você quiser finalizar todos os processos de um determinado usuário ?<br />
E se tiver mais de um número de PID referente aquele processo (como o<br />
apache) ?</p>
<p>Uma solução vem do comando abaixo:</p>
<p>ps auxww | grep &#8220;mitre&#8221; | awk &#8216;{print $2}&#8217;</p>
<p>Com ele, nós listamos todos os PID do usuario mitre. Ainda podemos com a modificação do comando abaixo:</p>
<p>ps auxww | grep &#8220;apache&#8221; | awk &#8216;{print $2}&#8217;</p>
<p>listar todos os processos que contenham a expressão regular &#8220;apache&#8221;.</p>
<p>Essencialmente, podemos listar todos os PIDs de qualquer processo que possa ser<br />identificado por uma expressão regular apropriada como argumento do comando intermediário &#8220;grep&#8221;.<br /><em><br /></em>
<div align="right"><a href="http://diegosaraiva.blogspot.com/2006/08/finalizando-todos-os-processos-de-um.html"><em>Link Original</em></a></div>
<p><a href="http://diegosaraiva.blogspot.com/"><em><a href="http://diegosaraiva.blogspot.com/2006/08/finalizando-todos-os-processos-de-um.html" title="permanent link"></a></em></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shellscript.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shellscript.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shellscript.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shellscript.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shellscript.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shellscript.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shellscript.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shellscript.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shellscript.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shellscript.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=6&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shellscript.wordpress.com/2006/09/16/finalizando-todos-os-processos-de-um-usuario/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1010c78bece0e9a1706cc403a0079073?s=96&#38;d=identicon" medium="image">
			<media:title type="html">clubedebian</media:title>
		</media:content>
	</item>
		<item>
		<title>Convertendo arquivos UTF-8 em ISO-8859-1</title>
		<link>http://shellscript.wordpress.com/2006/09/16/convertendo-arquivos-utf-8-em-iso-8859-1/</link>
		<comments>http://shellscript.wordpress.com/2006/09/16/convertendo-arquivos-utf-8-em-iso-8859-1/#comments</comments>
		<pubDate>Sat, 16 Sep 2006 16:30:27 +0000</pubDate>
		<dc:creator>clubedebian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shellscript.wordpress.com/2006/09/16/convertendo-arquivos-utf-8-em-iso-8859-1/</guid>
		<description><![CDATA[iconv -f codificacao_de_origem -t codificacao_de_saida arquivo Assim para converter UTF-8 para ISO-8859-1 temos: iconv -f utf-8 -t iso-8859-1 arquivo Para o contrário utilizamos: iconv -f iso-8859-1 -t utf-8 arquivo É necessário redirecionar a saida de arquivo para algum lugar, algo como: iconv -f utf-8 -t iso-8859-1 arquivo &#62; novo_arquivo Sendo assim, eu acrescentei ao meu [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=5&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><i>iconv -f codificacao_de_origem -t codificacao_de_saida arquivo</i></p>
<p>Assim para converter UTF-8 para ISO-8859-1 temos:
<div style="color:rgb(102, 153, 51);"><i>iconv -f utf-8 -t iso-8859-1 arquivo</i></div>
<p>Para o contrário utilizamos:
<div style="color:rgb(102, 153, 51);"><i>iconv -f iso-8859-1 -t utf-8 arquivo</i></div>
<p>É necessário redirecionar a saida de arquivo para algum lugar, algo como:
<div style="color:rgb(102, 153, 51);"><i>iconv -f utf-8 -t iso-8859-1 arquivo &gt; novo_arquivo</i></div>
<p>Sendo assim, eu acrescentei ao meu ~/.bashrc* as seguintes linhas
<div style="color:rgb(102, 153, 51);"> alias iso2utf=&#8217;iconv -f iso-8859-1 -t utf-8&#8242;<br /> alias utf2iso=&#8217;iconv -f utf-8 -t iso-8859-1&#8242;</div>
<p>Agora quando eu quiser converter um tipo de arquivo em outro, eu só preciso usar o <i><b>iso2utf</b></i> ou o <i><b>utf2iso</p>
<p></b></i>
<div align="right"><a href="http://diegosaraiva.blogspot.com/2006/09/convertendo-arquivos-utf-8-em-iso-8859.html">Link Original</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shellscript.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shellscript.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shellscript.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shellscript.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shellscript.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shellscript.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shellscript.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shellscript.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shellscript.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shellscript.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=5&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shellscript.wordpress.com/2006/09/16/convertendo-arquivos-utf-8-em-iso-8859-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1010c78bece0e9a1706cc403a0079073?s=96&#38;d=identicon" medium="image">
			<media:title type="html">clubedebian</media:title>
		</media:content>
	</item>
		<item>
		<title>Criando pacotes Debian</title>
		<link>http://shellscript.wordpress.com/2006/09/16/criando-pacotes-debian/</link>
		<comments>http://shellscript.wordpress.com/2006/09/16/criando-pacotes-debian/#comments</comments>
		<pubDate>Sat, 16 Sep 2006 16:29:03 +0000</pubDate>
		<dc:creator>clubedebian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shellscript.wordpress.com/2006/09/16/criando-pacotes-debian/</guid>
		<description><![CDATA[O sistema de pacotes do Debian é simples e eficiênte. Para criar um pacote .deb faça: 1. Crie um diretório com o nome do pacote2. Crie, no novo diretório, toda a estrutura de diretórios do seu pacote3. Crie o diretório de nome &#8220;DEBIAN&#8221; dentro do diretório debian criado previamente. No diretório DEBIAN, estarão os arquivos [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=4&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>O sistema de pacotes do Debian é simples e eficiênte. </p>
<p>Para criar um pacote .deb faça:</p>
<p>1. Crie um diretório com o nome do pacote<br />2. Crie, no novo diretório, toda a estrutura de diretórios do seu pacote<br />3. Crie o diretório de nome &#8220;DEBIAN&#8221; dentro do diretório debian criado <br />previamente. No diretório DEBIAN, estarão os arquivos com as informações <br />de controle do pacote.<br />4. Dentro do diretório DEBIAN, crie um arquivo de texto chamado control. <br />Este arquivo conterá as informações de controle do pacote Debian. <br />Basicamente, os seguintes campos descrevem as informações do arquivo <br />control: </p>
<p>Package: nome do pacote com o nome da versão;</p>
<p>Priority:<br />
grau de prioridade do pacote. Indica se o pacote é estritamente<br />
essencial para o funcionamento do sistema ou não;</p>
<p>Version:<br />
número de versão. Modifique este campo toda vez que for<br />
criado uma nova versão do programa correspondente ao pacote<br />
sendo criado;</p>
<p>Architecture: arquitetura de hardware para a qual o programa foi desenvolvido (por exemplo, i386 para processadores);</p>
<p>Mantainer: nome e e-mail do responsável pela manutenção do pacote;</p>
<p>Depends:<br />
listagem com os nomes de outros pacotes Debian, dos quais o pacote<br />
sendo construído depende. Caso haja mais de uma<br />
dependência, separe cada uma com uma vírgula. Pode-se<br />
ainda especificar quais versões das dependências<br />
são aplicáveis ao pacote sendo construído. Para<br />
tanto, depois do nome de uma dependência, defina entre<br />
parênteses um operador de relação (operadores<br />
possíveis: &lt;&lt;, &lt;=, =, &gt;= and &gt;&gt;) e o<br />
número de versão da dependência.</p>
<p>Description: breve descrição do pacote.</p>
<p>5.Depois<br />
de preencher este arquivo /DEBIAN/control e verificar se todos os<br />
arquivos estão nos lugares corretos, use o comando &#8220;dpkg-deb -b&#8221;<br />
para gerar o pacote. Basta fornecer o diretório onde<br />
estão os arquivos do pacote e o nome do arquivo que será<br />
criado
<div align="right"><a href="http://diegosaraiva.blogspot.com/2006/09/criando-pacotes-debian.html">Link Original</a></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shellscript.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shellscript.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shellscript.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shellscript.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shellscript.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shellscript.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shellscript.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shellscript.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shellscript.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shellscript.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=4&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shellscript.wordpress.com/2006/09/16/criando-pacotes-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1010c78bece0e9a1706cc403a0079073?s=96&#38;d=identicon" medium="image">
			<media:title type="html">clubedebian</media:title>
		</media:content>
	</item>
		<item>
		<title>Atualiza o Clamav Anti-Vírus para versão mais recente e instala o F-prot Anti-vírus.</title>
		<link>http://shellscript.wordpress.com/2006/09/16/atualiza-o-clamav-anti-virus-para-versao-mais-recente-e-instala-o-f-prot-anti-virus/</link>
		<comments>http://shellscript.wordpress.com/2006/09/16/atualiza-o-clamav-anti-virus-para-versao-mais-recente-e-instala-o-f-prot-anti-virus/#comments</comments>
		<pubDate>Sat, 16 Sep 2006 16:23:26 +0000</pubDate>
		<dc:creator>clubedebian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://shellscript.wordpress.com/2006/09/16/atualiza-o-clamav-anti-virus-para-versao-mais-recente-e-instala-o-f-prot-anti-virus/</guid>
		<description><![CDATA[#!/bin/bash # atualizar_clamav.sh VERSAO=&#8221;0.1.26 -14/09/2006&#8243; echo -e &#8220;==================================================================================&#8221; echo -e &#8220;================ ATENÇÂO =====================================================&#8221;\\n echo -e &#8220;Este script vai fazer a atualização do Clamav Anti-Vírus para versão mais recente&#8221; echo -e &#8220;e instalar o F-prot Anti-vírus.&#8221;\\n echo -e &#8220;============================================= Versão $VERSAO ==========&#8221;\\n echo &#8220;Pressione ENTER para prosseguir&#8221; read p echo -e \\n echo -e &#8220;Iremos agora [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=3&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>#!/bin/bash<br />
# atualizar_clamav.sh<br />
VERSAO=&#8221;0.1.26 -14/09/2006&#8243;</p>
<p>echo -e &#8220;==================================================================================&#8221;<br />
echo -e &#8220;================   ATENÇÂO   =====================================================&#8221;\\n<br />
echo -e &#8220;Este script vai fazer a atualização do Clamav Anti-Vírus para versão mais recente&#8221;<br />
echo -e &#8220;e instalar o F-prot Anti-vírus.&#8221;\\n<br />
echo -e &#8220;============================================= Versão $VERSAO ==========&#8221;\\n</p>
<p>echo &#8220;Pressione ENTER para prosseguir&#8221;<br />
read p</p>
<p>echo -e \\n<br />
echo -e &#8220;Iremos agora fazer a atualização do Clamav Anti-virus.&#8221;\\n</p>
<p>echo -e &#8220;Fazendo backup do /etc/apt/sources.list para /etc/apt/sources.list_ORIGINAL&#8221;\\n</p>
<p>if (test -f /etc/apt/sources.list_ORIGINAL)<br />
 then<br />
     echo &#8220;Arquivo de backup já Existe&#8221;<br />
      else<br />
      echo &#8220;Criando backup:&#8221;<br />
      echo &#8220;cp /etc/apt/sources.list /etc/apt/sources.list_ORIGINAL&#8221;<br />
      cp /etc/apt/sources.list /etc/apt/sources.list_ORIGINAL<br />
fi</p>
<p>#cat  /etc/apt/sources.list<br />
#deb ftp://ftp.uk.debian.org/debian/ testing main<br />
#EOF<br />
cat &gt; /etc/apt/sources.list<br />
#Clamav Binary packages for Debian stable/sarge:<br />
deb http://ftp2.de.debian.org/debian-volatile sarge/volatile main<br />
EOF</p>
<p>echo -e \\n<br />
echo -e &#8220;Fazendo a atualização do anti-virus&#8221;\\n</p>
<p>apt-get update<br />
apt-get install clamav clamav-daemon<br />
freshclam</p>
<p>echo -e \\n<br />
echo -e &#8220;Agora, precisamos instalar uma nova versão do kernel, porque durante a instalação&#8221;<br />
echo -e &#8220;da versão nova do Clamav, ele tentou remover a versão mais antiga do kernel.&#8221;\\n<br />
echo -e &#8220;Instalaremos a versão kernel-image-2.4.27-3-386 e mais alguns pacotes que também foram removidos&#8221;\\n</p>
<p>apt-get install kernel-image-2.4.27-2-386 kernel-image-2.4.27-3-386  base-config initrd-tools libgmp3</p>
<p>echo -e \\n<br />
echo -e &#8220;OK, seu sistema foi atualizado.&#8221;\\n</p>
<p>echo -e &#8220;Instalando um anti-vírus adicional, o F-Prot&#8221;\\n</p>
<p>cd /tmp<br />
wget http://http.us.debian.org/debian/pool/contrib/f/f-prot-installer/f-prot-installer_0.5.22_i386.deb</p>
<p>apt-get install libwww-perl liburi-perl libhtml-parser-perl libhtml-tree-perl libhtml-tagset-perl</p>
<p>dpkg -i f-prot-installer_0.5.22_i386.deb</p>
<p>echo -e \\n<br />
echo -e &#8220;Gerando uma entrado no crontab para que o F-Prot se atualize&#8221;\\n</p>
<p>echo /etc/cron.d/f-prot-installer<br />
#<br />
27 4,16 * * * root if [ -x /usr/lib/f-prot/tools/check-updates ]; then /usr/lib/f-prot/tools/check-updates -cron; fi<br />
#<br />
# Uncomment to check for new version of program once a week<br />
#<br />
00 12 * * 1 root if [ -x /usr/sbin/update-f-prot ]; then /usr/sbin/update-f-prot -i; fi<br />
EOF</p>
<p>echo -e &#8220;Alterando o /etc/amavis/amavisd.conf para dar suporte ao F-Prot&#8221;\\n</p>
<p>#echo &#8220;Pressione ENTER para prosseguir&#8221;<br />
#read p</p>
<p>echo -e &#8220;Fazendo backup do /etc/amavis/amavisd.conf para /etc/amavis/amavisd.conf_OLD&#8221;\\n</p>
<p>if (test -f /etc/amavis/amavisd.conf_OLD)<br />
 then<br />
     echo &#8220;Arquivo de backup já Existe&#8221;<br />
      else<br />
      echo &#8220;Criando backup:&#8221;<br />
      echo &#8220;mv /etc/amavis/amavisd.conf /etc/amavis/amavisd.conf_OLD&#8221;<br />
      mv /etc/amavis/amavisd.conf /etc/amavis/amavisd.conf_OLD<br />
fi</p>
<p>cat  /etc/amavis/amavisd.conf<br />
use strict;</p>
<p># Configuration file for amavisd-new<br />
# Defaults modified for the Debian amavisd-new package<br />
# \$Id: amavisd.conf,v 1.27.2.2 2004/11/18 23:27:55 hmh Exp \$<br />
#<br />
# This software is licensed under the GNU General Public License (GPL).<br />
# See comments at the start of amavisd-new for the whole license text.</p>
<p>#Sections:<br />
# Section I    &#8211; Essential daemon and MTA settings<br />
# Section II   &#8211; MTA specific<br />
# Section III  &#8211; Logging<br />
# Section IV   &#8211; Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine<br />
# Section V    &#8211; Per-recipient and per-sender handling, whitelisting, etc.<br />
# Section VI   &#8211; Resource limits<br />
# Section VII  &#8211; External programs, virus scanners, SpamAssassin<br />
# Section VIII &#8211; Debugging</p>
<p>#GENERAL NOTES:<br />
#  This file is a normal Perl code, interpreted by Perl itself.<br />
#  &#8211; make sure this file (or directory where it resides) is NOT WRITABLE<br />
#    by mere mortals (not even vscan/amavis; best to make it owned by root),<br />
#    otherwise it represents a severe security risk!<br />
#  &#8211; for values which are interpreted as booleans, it is recommended<br />
#    to use 1 for true, undef for false.<br />
#    THIS IS DIFFERENT FROM OLD AMAVIS VERSIONS where &#8220;no&#8221; also meant false,<br />
#    now it means true, like any nonempty string does!<br />
#  &#8211; Perl syntax applies. Most notably: strings in &#8220;&#8221; may include variables<br />
#    (which start with \$ or @); to include characters @ and \$ in double<br />
#    quoted strings, precede them by a backslash; in single-quoted strings<br />
#    the \$ and @ lose their special meaning, so it is usually easier to use<br />
#    single quoted strings (or qw operator) for e-mail addresses.<br />
#    Still, in both cases a backslash needs to be doubled.<br />
#  &#8211; variables with names starting with a &#8216;@&#8217; are lists, the values assigned<br />
#    to them should be lists as well, e.g. (&#8216;one@foo&#8217;, \$mydomain, &#8220;three&#8221;);<br />
#    note the comma-separation and parenthesis. If strings in the list<br />
#    do not contain spaces nor variables, a Perl operator qw() may be used<br />
#    as a shorthand to split its argument on whitespace and produce a list<br />
#    of strings, e.g. qw( one@foo example.com three );  Note that the argument<br />
#    to qw is quoted implicitly and no variable interpretation is done within<br />
#    (no &#8216;\$&#8217; variable evaluations). The #-initiated comments can NOT be used<br />
#    within a string. In other words, \$ and # lose their special meaning<br />
#    within a qw argument, just like within &#8216;&#8230;&#8217; strings.<br />
#  &#8211; all e-mail addresses in this file and as used internally by the daemon<br />
#    are in their raw (rfc2821-unquoted and non-bracketed) form, i.e.<br />
#    Bob &#8220;Funny&#8221; Dude@example.com, not: &#8220;Bob \&#8221;Funny\&#8221; Dude&#8221;@example.com<br />
#    and not ; also: &#8221; and not &#8221;.<br />
#  &#8211; the term &#8216;default value&#8217; in examples below refers to the value of a<br />
#    variable pre-assigned to it by the program; any explicit assignment<br />
#    to a variable in this configuration file overrides the default value;</p>
<p>#<br />
# Section I &#8211; Essential daemon and MTA settings<br />
#</p>
<p># \$MYHOME serves as a quick default for some other configuration settings.<br />
# More refined control is available with each individual setting further down.<br />
# \$MYHOME is not used directly by the program. No trailing slash!<br />
\$MYHOME = &#8216;/var/lib/amavis&#8217;;   # (default is &#8216;/var/amavis&#8217;)</p>
<p># \$mydomain serves as a quick default for some other configuration settings.<br />
# More refined control is available with each individual setting further down.<br />
# \$mydomain is never used directly by the program.<br />
\$mydomain = &#8216;example.com&#8217;;      # (no useful default)</p>
<p># \$myhostname = &#8216;host.example.com&#8217;;  # fqdn of this host, default by uname(3)</p>
<p># Set the user and group to which the daemon will change if started as root<br />
# (otherwise just keeps the UID unchanged, and these settings have no effect):<br />
\$daemon_user  = &#8216;amavis&#8217;;	# (no default (undef))<br />
\$daemon_group = &#8216;amavis&#8217;;	# (no default (undef))</p>
<p># Runtime working directory (cwd), and a place where<br />
# temporary directories for unpacking mail are created.<br />
# if you change this, you might want to modify the cleanup()<br />
# function in /etc/init.d/amavisd-new<br />
# (no trailing slash, may be a scratch file system)<br />
\$TEMPBASE = \$MYHOME;           # (must be set if other config vars use is)<br />
#\$TEMPBASE = &#8220;\$MYHOME/tmp&#8221;;     # prefer to keep home dir /var/amavis clean?</p>
<p># \$helpers_home sets environment variable HOME, and is passed as option<br />
# &#8216;home_dir_for_helpers&#8217; to Mail::SpamAssassin::new. It should be a directory<br />
# on a normal persistent file system, not a scratch or temporary file system<br />
#\$helpers_home = \$MYHOME;      # (defaults to \$MYHOME)</p>
<p># Run the daemon in the specified chroot jail if nonempty:<br />
#\$daemon_chroot_dir = \$MYHOME;  # (default is undef, meaning: do not chroot)</p>
<p>\$pid_file  = &#8220;/var/run/amavis/amavisd.pid&#8221;;  # (default: &#8220;\$MYHOME/amavisd.pid&#8221;)<br />
\$lock_file = &#8220;/var/run/amavis/amavisd.lock&#8221;; # (default: &#8220;\$MYHOME/amavisd.lock&#8221;)</p>
<p># set environment variables if you want (no defaults):<br />
\$ENV{TMPDIR} = \$TEMPBASE;       # wise to set TMPDIR, but not obligatory<br />
#&#8230;</p>
<p># MTA SETTINGS, UNCOMMENT AS APPROPRIATE,<br />
# both \$forward_method and \$notify_method default to &#8216;smtp:127.0.0.1:10025&#8242;</p>
<p># POSTFIX, or SENDMAIL in dual-MTA setup, or EXIM V4<br />
# (set host and port number as required; host can be specified<br />
# as IP address or DNS name (A or CNAME, but MX is ignored)<br />
#\$forward_method = &#8216;smtp:127.0.0.1:10025&#8242;;  # where to forward checked mail<br />
#\$notify_method = \$forward_method;          # where to submit notifications</p>
<p># NOTE: The defaults (above) are good for Postfix or dual-sendmail. You MUST<br />
#       uncomment the appropriate settings below if using other setups!</p>
<p># SENDMAIL MILTER, using amavis-milter.c helper program:<br />
# SEE amavisd-new-milter package docs FOR DEBIAN INSTRUCTIONS<br />
#\$forward_method = undef;  # no explicit forwarding, sendmail does it by itself<br />
# milter; option -odd is needed to avoid deadlocks<br />
#\$notify_method = &#8216;pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -odd -f \${sender} &#8212; \${recipient}&#8217;;<br />
# just a thought: can we use use -Am instead of -odd ?</p>
<p># SENDMAIL (old non-milter setup, as relay):<br />
#\$forward_method = &#8216;pipe:flags=q argv=/usr/sbin/sendmail -C/etc/sendmail.orig.cf -i -f \${sender} &#8212; \${recipient}&#8217;;<br />
#\$notify_method = \$forward_method;</p>
<p># SENDMAIL (old non-milter setup, amavis.c calls local delivery agent):<br />
#\$forward_method = undef;  # no explicit forwarding, amavis.c will call LDA<br />
#\$notify_method = &#8216;pipe:flags=q argv=/usr/sbin/sendmail -Ac -i -f \${sender} &#8212; \${recipient}&#8217;;</p>
<p># EXIM v3 (not recommended with v4 or later, which can use SMTP setup instead):<br />
#\$forward_method = &#8216;pipe:flags=q argv=/usr/sbin/exim -oMr scanned-ok -i -f \${sender} &#8212; \${recipient}&#8217;;<br />
#\$notify_method = \$forward_method;</p>
<p># prefer to collect mail for forwarding as BSMTP files?<br />
#\$forward_method = &#8220;bsmtp:\$MYHOME/out-%i-%n.bsmtp&#8221;;<br />
#\$notify_method = \$forward_method;</p>
<p># Net::Server pre-forking settings<br />
# You may want \$max_servers to match the width of your MTA pipe<br />
# feeding amavisd, e.g. with Postfix the &#8216;Max procs&#8217; field in the<br />
# master.cf file, like the &#8217;2&#8242; in the:  smtp-amavis unix &#8211; - n &#8211; 2 smtp<br />
#<br />
\$max_servers  =  2;   # number of pre-forked children          (default 2)<br />
\$max_requests = 10;   # retire a child after that many accepts (default 10)</p>
<p>\$child_timeout=5*60;  # abort child if it does not complete each task in n sec<br />
                      # (default: 8*60 seconds)</p>
<p># Check also the settings of @av_scanners at the end if you want to use<br />
# virus scanners. If not, you may want to delete the whole long assignment<br />
# to the variable @av_scanners, which will also remove the virus checking<br />
# code (e.g. if you only want to do spam scanning).</p>
<p># Here is a QUICK WAY to completely DISABLE some sections of code<br />
# that WE DO NOT WANT (it won&#8217;t even be compiled-in).<br />
# For more refined controls leave the following two lines commented out,<br />
# and see further down what these two lookup lists really mean.<br />
#<br />
# @bypass_virus_checks_acl = qw( . );  # uncomment to DISABLE anti-virus code<br />
# @bypass_spam_checks_acl  = qw( . );  # uncomment to DISABLE anti-spam code<br />
#<br />
# Any setting can be changed with a new assignment, so make sure<br />
# you do not unintentionally override these settings further down!<br />
@bypass_spam_checks_acl  = qw( . );    # No default dependency on spamassassin</p>
<p># Lookup list of local domains (see README.lookups for syntax details)<br />
#<br />
# NOTE:<br />
#   For backwards compatibility the variable names @local_domains (old) and<br />
#   @local_domains_acl (new) are synonyms. For consistency with other lookups<br />
#   the name @local_domains_acl is now preferred. It also makes it more<br />
#   obviously distinct from the new %local_domains hash lookup table.<br />
#<br />
# local_domains* lookup tables are used in deciding whether a recipient<br />
# is local or not, or in other words, if the message is outgoing or not.<br />
# This affects inserting spam-related headers for local recipients,<br />
# limiting recipient virus notifications (if enabled) to local recipients,<br />
# in deciding if address extension may be appended, and in SQL lookups<br />
# for non-fqdn addresses. Set it up correctly if you need features<br />
# that rely on this setting (or just leave empty otherwise).<br />
#<br />
# With Postfix (2.0) a quick reminder on what local domains normally are:<br />
# a union of domains specified in: \$mydestination, \$virtual_alias_domains,<br />
# \$virtual_mailbox_domains, and \$relay_domains.<br />
#<br />
@local_domains_acl = ( &#8220;.\$mydomain&#8221; );  # \$mydomain and its subdomains<br />
# @local_domains_acl = ( &#8220;.\$mydomain&#8221;, &#8220;my.other.domain&#8221; );<br />
# @local_domains_acl = qw();  # default is empty, no recipient treated as local<br />
# @local_domains_acl = qw( .example.com );<br />
# @local_domains_acl = qw( .example.com !host.sub.example.net .sub.example.net );</p>
<p># or alternatively(A), using a Perl hash lookup table, which may be assigned<br />
# directly, or read from a file, one domain per line; comments and empty lines<br />
# are ignored, a dot before a domain name implies its subdomains:<br />
#<br />
#read_hash(\%local_domains, &#8216;/etc/amavis/local_domains&#8217;);</p>
<p>#or alternatively(B), using a list of regular expressions:<br />
# \$local_domains_re = new_RE( qr&#8217;[@.]example\.com\$&#8217;i );<br />
#<br />
# see README.lookups for syntax and semantics</p>
<p>#<br />
# Section II &#8211; MTA specific (defaults should be ok)<br />
#</p>
<p># if \$relayhost_is_client is true, the IP address in \$notify_method and<br />
# \$forward_method is dynamically overridden with SMTP client peer address<br />
# (if available), which makes it possible for several hosts to share one<br />
# daemon.  The static port number is also overridden, and is dynamically<br />
# calculated  as being one above the incoming SMTP/LMTP session port number.<br />
#<br />
# These are logged at level 3, so enable logging until you know you got it<br />
# right.<br />
\$relayhost_is_client = 0;         # (defaults to false)</p>
<p>\$insert_received_line = 1;        # behave like MTA: insert &#8216;Received:&#8217; header<br />
			          # (does not apply to sendmail/milter)<br />
			          # (default is true (1) )</p>
<p># AMAVIS-CLIENT PROTOCOL INPUT SETTINGS (e.g. with sendmail milter)<br />
#   (used with amavis helper clients like amavis-milter.c and amavis.c,<br />
#   NOT needed for Postfix and Exim  or dual-sendmail &#8211; keep it undefined.)<br />
#\$unix_socketname = &#8220;/var/lib/amavis/amavisd.sock&#8221;; # amavis helper protocol socket<br />
\$unix_socketname = undef;         # disable listening on a unix socket<br />
                                  # (default is undef, i.e. disabled)</p>
<p># Do we receive quoted or raw addresses from the helper program?<br />
# (does not apply to SMTP;  defaults to true)<br />
#\$gets_addr_in_quoted_form = 1;   # &#8220;Bob \&#8221;Funny\&#8221; Dude&#8221;@example.com<br />
#\$gets_addr_in_quoted_form = 0;   # Bob &#8220;Funny&#8221; Dude@example.com</p>
<p># SMTP SERVER (INPUT) PROTOCOL SETTINGS (e.g. with Postfix, Exim v4, &#8230;)<br />
#   (used when MTA is configured to pass mail to amavisd via SMTP or LMTP)<br />
\$inet_socket_port = 10024;        # accept SMTP on this local TCP port<br />
                                  # (default is undef, i.e. disabled)<br />
# multiple ports may be provided: \$inet_socket_port = [10024, 10026, 10028];</p>
<p># SMTP SERVER (INPUT) access control<br />
# &#8211; do not allow free access to the amavisd SMTP port !!!<br />
#<br />
# when MTA is at the same host, use the following (one or the other or both):<br />
\$inet_socket_bind = &#8217;127.0.0.1&#8242;;  # limit socket bind to loopback interface<br />
                                  # (default is &#8217;127.0.0.1&#8242;)<br />
@inet_acl = qw( 127.0.0.1 );      # allow SMTP access only from localhost IP<br />
                                  # (default is qw( 127.0.0.1 ) )</p>
<p># when MTA (one or more) is on a different host, use the following:<br />
# @inet_acl = qw(127/8 10.1.0.1 10.1.0.2);  # adjust the list as appropriate<br />
# \$inet_socket_bind = undef;      # bind to all IP interfaces if undef<br />
#<br />
# Example1:<br />
# @inet_acl = qw( 127/8 10/8 172.16/12 192.168/16 );<br />
# permit only SMTP access from loopback and rfc1918 private address space<br />
#<br />
# Example2:<br />
# @inet_acl = qw( !192.168.1.12 172.16.3.3 !172.16.3/255.255.255.0<br />
#		  127.0.0.1 10/8 172.16/12 192.168/16 );<br />
# matches loopback and rfc1918 private address space except host 192.168.1.12<br />
# and net 172.16.3/24 (but host 172.16.3.3 within 172.16.3/24 still matches)<br />
#<br />
# Example3:<br />
# @inet_acl = qw( 127/8<br />
#		  !172.16.3.0   !172.16.3.127 172.16.3.0/25<br />
#		  !172.16.3.128 !172.16.3.255 172.16.3.128/25 );<br />
# matches loopback and both halves of the 172.16.3/24 C-class,<br />
# split into two subnets, except all four broadcast addresses<br />
# for these subnets<br />
#<br />
# See README.lookups for details on specifying access control lists.</p>
<p>#<br />
# Section III &#8211; Logging<br />
#</p>
<p># true (e.g. 1) =&gt; syslog;  false (e.g. 0) =&gt; logging to file<br />
\$DO_SYSLOG = 1;                 # (defaults to false)<br />
#\$SYSLOG_LEVEL = &#8216;user.info&#8217;;     # (facility.priority, default &#8216;mail.info&#8217;)</p>
<p># Log file (if not using syslog)<br />
\$LOGFILE = &#8220;/var/log/amavis.log&#8221;;  # (defaults to empty, no log)</p>
<p>#NOTE: levels are not strictly observed and are somewhat arbitrary<br />
# 0: startup/exit/failure messages, viruses detected<br />
# 1: args passed from client, some more interesting messages<br />
# 2: virus scanner output, timing<br />
# 3: server, client<br />
# 4: decompose parts<br />
# 5: more debug details<br />
#\$log_level = 2;		# (defaults to 0)</p>
<p># Customizable template for the most interesting log file entry (e.g. with<br />
# \$log_level=0) (take care to properly quote Perl special characters like &#8216;\&#8217;)<br />
# For a list of available macros see README.customize .</p>
<p># only log infected messages (useful with log level 0):<br />
# \$log_templ = &#8216;[? %#V |[? %#F ||banned filename ([%F|,])]|infected ([%V|,])]#<br />
# [? %#V |[? %#F ||, from=[?%o|(?)|], to=[|,][? %i ||, quarantine %i]]#<br />
# |, from=[?%o|(?)|], to=[|,][? %i ||, quarantine %i]]&#8217;;</p>
<p># log both infected and noninfected messages (default):<br />
\$log_templ = &#8216;[? %#V |[? %#F |[?%#D|Not-Delivered|Passed]|BANNED name/type (%F)]|INFECTED (%V)], #<br />
[?%o|(?)|] -&gt; [|,][? %i ||, quarantine %i], Message-ID: %m, Hits: %c&#8217;;</p>
<p>#<br />
# Section IV &#8211; Notifications/DSN, BOUNCE/REJECT/DROP/PASS destiny, quarantine<br />
#</p>
<p># Select notifications text encoding when Unicode-aware Perl is converting<br />
# text from internal character representation to external encoding (charset<br />
# in MIME terminology). Used as argument to Perl Encode::encode subroutine.<br />
#<br />
#   to be used in RFC 2047-encoded header field bodies, e.g. in Subject:<br />
#\$hdr_encoding = &#8216;iso-8859-1&#8242;;  # (default: &#8216;iso-8859-1&#8242;)<br />
#<br />
#   to be used in notification body text: its encoding and Content-type.charset<br />
#\$bdy_encoding = &#8216;iso-8859-1&#8242;;  # (default: &#8216;iso-8859-1&#8242;)</p>
<p># Default template texts for notifications may be overruled by directly<br />
# assigning new text to template variables, or by reading template text<br />
# from files. A second argument may be specified in a call to read_text(),<br />
# specifying character encoding layer to be used when reading from the<br />
# external file, e.g. &#8216;utf8&#8242;, &#8216;iso-8859-1&#8242;, or often just \$bdy_encoding.<br />
# Text will be converted to internal character representation by Perl 5.8.0<br />
# or later; second argument is ignored otherwise. See PerlIO::encoding,<br />
# Encode::PerlIO and perluniintro man pages.<br />
#<br />
# \$notify_sender_templ      = read_text(&#8216;/var/amavis/notify_sender.txt&#8217;);<br />
# \$notify_virus_sender_templ= read_text(&#8216;/var/amavis/notify_virus_sender.txt&#8217;);<br />
# \$notify_virus_admin_templ = read_text(&#8216;/var/amavis/notify_virus_admin.txt&#8217;);<br />
# \$notify_virus_recips_templ= read_text(&#8216;/var/amavis/notify_virus_recips.txt&#8217;);<br />
# \$notify_spam_sender_templ = read_text(&#8216;/var/amavis/notify_spam_sender.txt&#8217;);<br />
# \$notify_spam_admin_templ  = read_text(&#8216;/var/amavis/notify_spam_admin.txt&#8217;);</p>
<p># If notification template files are collectively available in some directory,<br />
# use read_l10n_templates which calls read_text for each known template.<br />
#<br />
#   read_l10n_templates(&#8216;/etc/amavis/en_US&#8217;);<br />
#<br />
# Debian available locales: en_US, pt_BR, de_DE, it_IT<br />
read_l10n_templates(&#8216;en_US&#8217;, &#8216;/etc/amavis&#8217;);</p>
<p># Here is an overall picture (sequence of events) of how pieces fit together<br />
# (only virus controls are shown, spam controls work the same way):<br />
#<br />
#   bypass_virus_checks? ==&gt; PASS<br />
#   no viruses?   ==&gt; PASS<br />
#   log virus     if \$log_templ is nonempty<br />
#   quarantine    if \$virus_quarantine_to is nonempty<br />
#   notify admin  if \$virus_admin (lookup) nonempty<br />
#   notify recips if \$warnvirusrecip and (recipient is local or \$warn_offsite)<br />
#   add address extensions if adding extensions is enabled and virus will pass<br />
#   send (non-)delivery notifications<br />
#      to sender if DSN needed (BOUNCE or (\$warn_virus_sender and D_PASS))<br />
#   virus_lovers or final_destiny==D_PASS  ==&gt; PASS<br />
#   DISCARD (2xx) or REJECT (5xx) (depending on final_*_destiny)<br />
#<br />
# Equivalent flow diagram applies for spam checks.<br />
# If a virus is detected, spam checking is skipped entirely.</p>
<p># The following symbolic constants can be used in *destiny settings:<br />
#<br />
# D_PASS     mail will pass to recipients, regardless of bad contents;<br />
#<br />
# D_DISCARD  mail will not be delivered to its recipients, sender will NOT be<br />
#            notified. Effectively we lose mail (but will be quarantined<br />
#            unless disabled). Losing mail is not decent for a mailer,<br />
#            but might be desired.<br />
#<br />
# D_BOUNCE   mail will not be delivered to its recipients, a non-delivery<br />
#            notification (bounce) will be sent to the sender by amavisd-new;<br />
#            Exception: bounce (DSN) will not be sent if a virus name matches<br />
#            \$viruses_that_fake_sender_re, or to messages from mailing lists<br />
#            (Precedence: bulk|list|junk);<br />
#<br />
# D_REJECT   mail will not be delivered to its recipients, sender should<br />
#            preferably get a reject, e.g. SMTP permanent reject response<br />
#            (e.g. with milter), or non-delivery notification from MTA<br />
#            (e.g. Postfix). If this is not possible (e.g. different recipients<br />
#            have different tolerances to bad mail contents and not using LMTP)<br />
#            amavisd-new sends a bounce by itself (same as D_BOUNCE).<br />
#<br />
# Notes:<br />
#   D_REJECT and D_BOUNCE are similar, the difference is in who is responsible<br />
#            for informing the sender about non-delivery, and how informative<br />
#            the notification can be (amavisd-new knows more than MTA);<br />
#   With D_REJECT, MTA may reject original SMTP, or send DSN (delivery status<br />
#            notification, colloquially called &#8216;bounce&#8217;) &#8211; depending on MTA;<br />
#            Best suited for sendmail milter, especially for spam.<br />
#   With D_BOUNCE, amavisd-new (not MTA) sends DSN (can better explain the<br />
#            reason for mail non-delivery, but unable to reject the original<br />
#            SMTP session). Best suited to reporting viruses, and for Postfix<br />
#            and other dual-MTA setups, which can&#8217;t reject original client SMTP<br />
#            session, as the mail has already been enqueued.</p>
<p>\$final_virus_destiny      = D_DISCARD; # (defaults to D_BOUNCE)<br />
\$final_banned_destiny     = D_BOUNCE;  # (defaults to D_BOUNCE)<br />
\$final_spam_destiny       = D_REJECT;  # (defaults to D_REJECT)<br />
\$final_bad_header_destiny = D_PASS;  # (defaults to D_PASS), D_BOUNCE suggested</p>
<p># Alternatives to consider for spam:<br />
# &#8211; use D_PASS if clients will do filtering based on inserted mail headers;<br />
# &#8211; use D_DISCARD, if kill_level is set safely high;<br />
# &#8211; use D_BOUNCE instead of D_REJECT if not using milter;<br />
#<br />
# D_BOUNCE is preferred for viruses, but consider:<br />
# &#8211; use D_DISCARD to avoid bothering the rest of the network, it is hopeless<br />
#   to try to keep up with the viruses that faker the envelope sender anyway,<br />
#   and bouncing only increases the network cost of viruses for everyone<br />
# &#8211; use D_PASS (or virus_lovers) and \$warnvirussender=1 to deliver viruses;<br />
# &#8211; use D_REJECT instead of D_BOUNCE if using milter and under heavy<br />
#   virus storm;<br />
#<br />
# Don&#8217;t bother to set both D_DISCARD and \$warn*sender=1, it will get mapped<br />
# to D_BOUNCE.<br />
#<br />
# The separation of *_destiny values into D_BOUNCE, D_REJECT, D_DISCARD<br />
# and D_PASS made settings \$warnvirussender and \$warnspamsender only still<br />
# useful with D_PASS.</p>
<p># The following \$warn*sender settings are ONLY used when mail is<br />
# actually passed to recipients (\$final_*_destiny=D_PASS, or *_lovers*).<br />
# Bounces or rejects produce non-delivery status notification anyway.</p>
<p># Notify virus sender?<br />
#\$warnvirussender = 1;	# (defaults to false (undef))</p>
<p># Notify spam sender?<br />
#\$warnspamsender = 1;	# (defaults to false (undef))</p>
<p># Notify sender of banned files?<br />
#\$warnbannedsender = 1;	# (defaults to false (undef))</p>
<p># Notify sender of syntactically invalid header containing non-ASCII characters?<br />
#\$warnbadhsender = 1;	# (defaults to false (undef))</p>
<p># Notify virus (or banned files) RECIPIENT?<br />
#  (not very useful, but some policies demand it)<br />
#\$warnvirusrecip = 1;	# (defaults to false (undef))<br />
#\$warnbannedrecip = 1;	# (defaults to false (undef))</p>
<p># Notify also non-local virus/banned recipients if \$warn*recip is true?<br />
#  (including those not matching local_domains*)<br />
#\$warn_offsite = 1;    # (defaults to false (undef), i.e. only notify locals)</p>
<p># Treat envelope sender address as unreliable and don&#8217;t send sender<br />
# notification / bounces if name(s) of detected virus(es) match the list.<br />
# Note that virus names are supplied by external virus scanner(s) and are<br />
# not standardized, so virus names may need to be adjusted.<br />
# See README.lookups for syntax, check also README.policy-on-notifications<br />
#<br />
\$viruses_that_fake_sender_re = new_RE(<br />
  qr&#8217;nimda|hybris|klez|bugbear|yaha|braid|sobig|fizzer|palyh|peido|holar&#8217;i,<br />
  qr&#8217;tanatos|lentin|bridex|mimail|trojan\.dropper|dumaru|parite|spaces&#8217;i,<br />
  qr&#8217;dloader|galil|gibe|swen|netwatch|bics|sbrowse|sober|rox|val(hal)?la&#8217;i,<br />
  qr&#8217;frethem|sircam|be?agle|tanx|mydoom|novarg|shimg|netsky|somefool|moodown&#8217;i,<br />
  qr&#8217;@mm|@MM&#8217;,    # mass mailing viruses as labeled by f-prot and uvscan<br />
  qr&#8217;Worm&#8217;i,      # worms as labeled by ClamAV, Kaspersky, etc<br />
  [qr'^(EICAR|Joke\.|Junk\.)'i         =&gt; 0],<br />
  [qr'^(WM97|OF97|W95/CIH-|JS/Fort)'i  =&gt; 0],<br />
  [qr/.*/ =&gt; 1],  # true by default  (remove or comment-out if undesired)<br />
);</p>
<p># where to send ADMIN VIRUS NOTIFICATIONS (should be a fully qualified address)<br />
# &#8211; the administrator address may be a simple fixed e-mail address (a scalar),<br />
#   or may depend on the SENDER address (e.g. its domain), in which case<br />
#   a ref to a hash table can be specified (specify lower-cased keys,<br />
#   dot is a catchall, see README.lookups).<br />
#<br />
#   Empty or undef lookup disables virus admin notifications.</p>
<p># \$virus_admin = undef;   # do not send virus admin notifications (default)<br />
# \$virus_admin = {&#8216;not.example.com&#8217; =&gt; &#8221;, &#8216;.&#8217; =&gt; &#8216;virusalert@example.com&#8217;};<br />
# \$virus_admin = &#8216;virus-admin@example.com&#8217;;<br />
\$virus_admin = &#8220;postmaster\@\$mydomain&#8221;;		# due to D_DISCARD default</p>
<p># equivalent to \$virus_admin, but for spam admin notifications:<br />
# \$spam_admin = &#8220;spamalert\@\$mydomain&#8221;;<br />
# \$spam_admin = undef;    # do not send spam admin notifications (default)<br />
# \$spam_admin = {&#8216;not.example.com&#8217; =&gt; &#8221;, &#8216;.&#8217; =&gt; &#8216;spamalert@example.com&#8217;};</p>
<p>#advanced example, using a hash lookup table:<br />
#\$virus_admin = {<br />
# &#8216;baduser@sub1.example.com&#8217; =&gt; &#8216;HisBoss@sub1.example.com&#8217;,<br />
# &#8216;.sub1.example.com&#8217;  =&gt; &#8216;virusalert@sub1.example.com&#8217;,<br />
# &#8216;.sub2.example.com&#8217;  =&gt; &#8221;,                  # don&#8217;t send admin notifications<br />
# &#8216;a.sub3.example.com&#8217; =&gt; &#8216;abuse@sub3.example.com&#8217;,<br />
# &#8216;.sub3.example.com&#8217;  =&gt; &#8216;virusalert@sub3.example.com&#8217;,<br />
# &#8216;.example.com&#8217;       =&gt; &#8216;noc@example.com&#8217;,   # catchall for our virus senders<br />
# &#8216;.&#8217;                  =&gt; &#8216;virusalert@hq.example.com&#8217;,  # catchall for the rest<br />
#};</p>
<p># whom notification reports are sent from (ENVELOPE SENDER);<br />
# may be a null reverse path, or a fully qualified address:<br />
#   (admin and recip sender addresses default to \$mailfrom<br />
#   for compatibility, which in turn defaults to undef (empty) )<br />
#   If using strings in double quotes, don&#8217;t forget to quote @, i.e. \@<br />
#<br />
#\$mailfrom_notify_admin     = &#8220;virusalert\@\$mydomain&#8221;;<br />
#\$mailfrom_notify_recip     = &#8220;virusalert\@\$mydomain&#8221;;<br />
#\$mailfrom_notify_spamadmin = &#8220;spam.police\@\$mydomain&#8221;;</p>
<p># &#8216;From&#8217; HEADER FIELD for sender and admin notifications.<br />
# This should be a replyable address, see rfc1894. Not to be confused<br />
# with \$mailfrom_notify_sender, which is the envelope return address<br />
# and should be empty (null reverse path) according to rfc2821.<br />
#<br />
# The syntax of the &#8216;From&#8217; header field is specified in rfc2822, section<br />
# &#8217;3.4. Address Specification&#8217;. Note in particular that display-name must be<br />
# a quoted-string if it contains any special characters like spaces and dots.<br />
#<br />
# \$hdrfrom_notify_sender = &#8220;amavisd-new &#8220;;<br />
# \$hdrfrom_notify_sender = &#8216;amavisd-new &#8216;;<br />
# \$hdrfrom_notify_sender = &#8216;&#8221;Content-Filter Master&#8221; &#8216;;<br />
#   (defaults to: &#8220;amavisd-new &#8220;)<br />
# \$hdrfrom_notify_admin = \$mailfrom_notify_admin;<br />
#   (defaults to: \$mailfrom_notify_admin)<br />
# \$hdrfrom_notify_spamadmin = \$mailfrom_notify_spamadmin;<br />
#   (defaults to: \$mailfrom_notify_spamadmin)</p>
<p># whom quarantined messages appear to be sent from (envelope sender);<br />
# keeps original sender if undef, or set it explicitly, default is undef<br />
\$mailfrom_to_quarantine = &#8221;;   # override sender address with null return path</p>
<p># Location to put infected mail into: (applies to &#8216;local:&#8217; quarantine method)<br />
#   empty for not quarantining, may be a file (mailbox),<br />
#   or a directory (no trailing slash)<br />
#   (the default value is undef, meaning no quarantine)<br />
#<br />
\$QUARANTINEDIR = &#8216;/var/lib/amavis/virusmails&#8217;;</p>
<p>#\$virus_quarantine_method = &#8220;local:virus-%i-%n&#8221;;    # default<br />
#\$spam_quarantine_method  = &#8220;local:spam-%b-%i-%n&#8221;;  # default<br />
#<br />
#use the new &#8216;bsmtp:&#8217; method as an alternative to the default &#8216;local:&#8217;<br />
#\$virus_quarantine_method = &#8220;bsmtp:\$QUARANTINEDIR/virus-%i-%n.bsmtp&#8221;;<br />
#\$spam_quarantine_method  = &#8220;bsmtp:\$QUARANTINEDIR/spam-%b-%i-%n.bsmtp&#8221;;</p>
<p># When using the &#8216;local:&#8217; quarantine method (default), the following applies:<br />
#<br />
# A finer control of quarantining is available through variable<br />
# \$virus_quarantine_to/\$spam_quarantine_to. It may be a simple scalar string,<br />
# or a ref to a hash lookup table, or a regexp lookup table object,<br />
# which makes possible to set up per-recipient quarantine addresses.<br />
#<br />
# The value of scalar \$virus_quarantine_to/\$spam_quarantine_to (or a<br />
# per-recipient lookup result from the hash table %\$virus_quarantine_to)<br />
# is/are interpreted as follows:<br />
#<br />
# VARIANT 1:<br />
#   empty or undef disables quarantine;<br />
#<br />
# VARIANT 2:<br />
#   a string NOT containing an &#8216;@&#8217;;<br />
# amavisd will behave as a local delivery agent (LDA) and will quarantine<br />
# viruses to local files according to hash %local_delivery_aliases (pseudo<br />
# aliases map) &#8211; see subroutine mail_to_local_mailbox() for details.<br />
# Some of the predefined aliases are &#8216;virus-quarantine&#8217; and &#8216;spam-quarantine&#8217;.<br />
# Setting \$virus_quarantine_to (\$spam_quarantine_to) to this string will:<br />
#<br />
# * if \$QUARANTINEDIR is a directory, each quarantined virus will go<br />
#   to a separate file in the \$QUARANTINEDIR directory (traditional<br />
#   amavis style, similar to maildir mailbox format);<br />
#<br />
# * otherwise \$QUARANTINEDIR is treated as a file name of a Unix-style<br />
#   mailbox. All quarantined messages will be appended to this file.<br />
#   Amavisd child process must obtain an exclusive lock on the file during<br />
#   delivery, so this may be less efficient than using individual files<br />
#   or forwarding to MTA, and it may not work across NFS or other non-local<br />
#   file systems (but may be handy for pickup of quarantined files via IMAP<br />
#   for example);<br />
#<br />
# VARIANT 3:<br />
#   any email address (must contain &#8216;@&#8217;).<br />
# The e-mail messages to be quarantined will be handed to MTA<br />
# for delivery to the specified address. If a recipient address local to MTA<br />
# is desired, you may leave the domain part empty, e.g. &#8216;infected@&#8217;, but the<br />
# &#8216;@&#8217; character must nevertheless be included to distinguish it from variant 2.<br />
#<br />
# This method enables more refined delivery control made available by MTA<br />
# (e.g. its aliases file, other local delivery agents, dealing with<br />
# privileges and file locking when delivering to user&#8217;s mailbox, nonlocal<br />
# delivery and forwarding, fan-out lists). Make sure the mail-to-be-quarantined<br />
# will not be handed back to amavisd for checking, as this will cause a loop<br />
# (hopefully broken at some stage)! If this can be assured, notifications<br />
# will benefit too from not being unnecessarily virus-scanned.<br />
#<br />
# By default this is safe to do with Postfix and Exim v4 and dual-sendmail<br />
# setup, but probably not safe with sendmail milter interface without<br />
# precaution.</p>
<p># (the default value is undef, meaning no quarantine)</p>
<p>\$virus_quarantine_to  = &#8216;virus-quarantine&#8217;;    # traditional local quarantine<br />
#\$virus_quarantine_to = &#8216;infected@&#8217;;           # forward to MTA for delivery<br />
#\$virus_quarantine_to = &#8220;virus-quarantine\@\$mydomain&#8221;;   # similar<br />
#\$virus_quarantine_to = &#8216;virus-quarantine@example.com&#8217;;  # similar<br />
#\$virus_quarantine_to = undef;                 # no quarantine<br />
#<br />
#\$virus_quarantine_to = new_RE(                # per-recip multiple quarantines<br />
#  [qr'^user@example\.com\$'i =&gt; 'infected@'],<br />
#  [qr'^(.*)@example\.com\$'i =&gt; 'virus-\${1}@example.com'],<br />
#  [qr'^(.*)(@[^@])?\$&#8217;i      =&gt; &#8216;virus-\${1}\${2}&#8217;],<br />
#  [qr/.*/                   =&gt; 'virus-quarantine'] );</p>
<p># similar for spam<br />
# (the default value is undef, meaning no quarantine)<br />
#<br />
\$spam_quarantine_to = &#8216;spam-quarantine&#8217;;<br />
#\$spam_quarantine_to = &#8220;spam-quarantine\@\$mydomain&#8221;;<br />
#\$spam_quarantine_to = new_RE(                 # per-recip multiple quarantines<br />
#  [qr'^(.*)@example\.com\$'i =&gt; 'spam-\${1}@example.com'],<br />
#  [qr/.*/                   =&gt; 'spam-quarantine'] );</p>
<p># In addition to per-recip quarantine, a by-sender lookup is possible. It is<br />
# similar to \$spam_quarantine_to, but the lookup key is the sender address:<br />
#\$spam_quarantine_bysender_to = undef;   # dflt: no by-sender spam quarantine</p>
<p># Add X-Virus-Scanned header field to mail?<br />
\$X_HEADER_TAG = &#8216;X-Virus-Scanned&#8217;;	# (default: undef)<br />
# Leave empty to add no header		# (default: undef)<br />
\$X_HEADER_LINE = &#8220;by \$myversion (Debian) at \$mydomain&#8221;;</p>
<p># a string to prepend to Subject (for local recipients only) if mail could<br />
# not be decoded or checked entirely, e.g. due to password-protected archives<br />
\$undecipherable_subject_tag = &#8216;***UNCHECKED*** &#8216;;  # undef disables it</p>
<p>\$remove_existing_x_scanned_headers = 0; # leave existing X-Virus-Scanned alone<br />
#\$remove_existing_x_scanned_headers= 1; # remove existing headers<br />
					# (defaults to false)<br />
#\$remove_existing_spam_headers = 0;     # leave existing X-Spam* headers alone<br />
\$remove_existing_spam_headers  = 1;     # remove existing spam headers if<br />
					# spam scanning is enabled (default)</p>
<p># set \$bypass_decode_parts to true if you only do spam scanning, or if you<br />
# have a good virus scanner that can deal with compression and recursively<br />
# unpacking archives by itself, and save amavisd the trouble.<br />
# Disabling decoding also causes banned_files checking to only see<br />
# MIME names and MIME content types, not the content classification types<br />
# as provided by the file(1) utility.<br />
# It is a double-edged sword, make sure you know what you are doing!<br />
#<br />
#\$bypass_decode_parts = 1;		# (defaults to false)</p>
<p># don&#8217;t trust this file type or corresponding unpacker for this file type,<br />
# keep both the original and the unpacked file for a virus checker to see<br />
# (lookup key is what file(1) utility returned):<br />
#<br />
\$keep_decoded_original_re = new_RE(<br />
# qr&#8217;^MAIL\$&#8217;,   # retain full original message for virus checking (can be slow)<br />
  qr&#8217;^MAIL-UNDECIPHERABLE\$&#8217;,  # retain full mail if it contains undecipherables<br />
  qr&#8217;^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)&#8217;i,<br />
# qr&#8217;^Zip archive data&#8217;,<br />
);</p>
<p># Checking for banned MIME types and names. If any mail part matches,<br />
# the whole mail is rejected, much like the way viruses are handled.<br />
# A list in object \$banned_filename_re can be defined to provide a list<br />
# of Perl regular expressions to be matched against each part&#8217;s:<br />
#<br />
#  * Content-Type value (both declared and effective mime-type),<br />
#    including the possible security risk content types<br />
#    message/partial and message/external-body, as specified by rfc2046;<br />
#<br />
#  * declared (i.e. recommended) file names as specified by MIME subfields<br />
#    Content-Disposition.filename and Content-Type.name, both in their<br />
#    raw (encoded) form and in rfc2047-decoded form if applicable;<br />
#<br />
#  * file content type as guessed by &#8216;file&#8217; utility, both the raw<br />
#    result from &#8216;file&#8217;, as well as short type name, classified<br />
#    into names such as .asc, .txt, .html, .doc, .jpg, .pdf,<br />
#    .zip, .exe, &#8230; &#8211; see subroutine determine_file_types().<br />
#    This step is done only if \$bypass_decode_parts is not true.<br />
#<br />
#  * leave \$banned_filename_re undefined to disable these checks<br />
#    (giving an empty list to new_RE() will also always return false)</p>
<p>\$banned_filename_re = new_RE(<br />
#  qr&#8217;^UNDECIPHERABLE\$&#8217;,  # is or contains any undecipherable components<br />
   qr&#8217;\.[^.]*\.(exe|vbs|pif|scr|bat|cmd|com|dll)\$&#8217;i, # some double extensions<br />
   qr&#8217;[{}]&#8216;,     # curly braces in names (serve as Class ID extensions &#8211; CLSID)<br />
#  qr&#8217;.\.(exe|vbs|pif|scr|bat|cmd|com)\$&#8217;i,           # banned extension &#8211; basic<br />
#  qr&#8217;.\.(ade|adp|bas|bat|chm|cmd|com|cpl|crt|exe|hlp|hta|inf|ins|isp|js|<br />
#         jse|lnk|mdb|mde|msc|msi|msp|mst|pcd|pif|reg|scr|sct|shs|shb|vb|<br />
#         vbe|vbs|wsc|wsf|wsh)\$&#8217;ix,                  # banned extension &#8211; long<br />
#  qr&#8217;.\.(mim|b64|bhx|hqx|xxe|uu|uue)\$&#8217;i, # banned extension &#8211; WinZip vulnerab.<br />
#  qr&#8217;^\.(zip|lha|tnef|cab)\$&#8217;i,                      # banned file(1) types<br />
#  qr&#8217;^\.exe\$&#8217;i,                                     # banned file(1) types<br />
#  qr&#8217;^application/x-msdownload\$&#8217;i,                  # banned MIME types<br />
#  qr&#8217;^application/x-msdos-program\$&#8217;i,<br />
   qr&#8217;^message/partial\$&#8217;i,  # rfc2046. this one is deadly for Outcrook<br />
#  qr&#8217;^message/external-body\$&#8217;i, # block rfc2046<br />
);<br />
# See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262631<br />
# and http://www.cknow.com/vtutor/vtextensions.htm</p>
<p># A little trick: a pattern qr&#8217;\.exe\$&#8217; matches both a short type name &#8216;.exe&#8217;,<br />
# as well as any file name which happens to end with .exe. If only matching<br />
# a file name is desired, but not the short name, a pattern qr&#8217;.\.exe\$&#8217;i<br />
# or similar may be used, which requires that at least one character precedes<br />
# the &#8216;.exe&#8217;, and so it will never match short file types, which always start<br />
# with a dot.</p>
<p>#<br />
# Section V &#8211; Per-recipient and per-sender handling, whitelisting, etc.<br />
#</p>
<p># %virus_lovers, @virus_lovers_acl and \$virus_lovers_re lookup tables:<br />
#   (these should be considered policy options, they do not disable checks,<br />
#   see bypass*checks for that!)<br />
#<br />
# Exclude certain RECIPIENTS from virus filtering by adding their lower-cased<br />
# envelope e-mail address (or domain only) to the hash %virus_lovers, or to<br />
# the access list @virus_lovers_acl &#8211; see README.lookups and examples.<br />
# Make sure the appropriate form (e.g. external/internal) of address<br />
# is used in case of virtual domains, or when mapping external to internal<br />
# addresses, etc. &#8211; this is MTA-specific.<br />
#<br />
# Notifications would still be generated however (see the overall<br />
# picture above), and infected mail (if passed) gets additional header:<br />
#   X-AMaViS-Alert: INFECTED, message contains virus: &#8230;<br />
# (header not inserted with milter interface!)<br />
#<br />
# NOTE (milter interface only): in case of multiple recipients,<br />
# it is only possible to drop or accept the message in its entirety &#8211; for all<br />
# recipients. If all of them are virus lovers, we&#8217;ll accept mail, but if<br />
# at least one recipient is not a virus lover, we&#8217;ll discard the message.</p>
<p># %bypass_virus_checks, @bypass_virus_checks_acl and \$bypass_virus_checks_re<br />
# lookup tables:<br />
#   (this is mainly a time-saving option, unlike virus_lovers* !)<br />
#<br />
# Similar in concept to %virus_lovers, a hash %bypass_virus_checks,<br />
# access list @bypass_virus_checks_acl and regexp list \$bypass_virus_checks_re<br />
# are used to skip entirely the decoding, unpacking and virus checking,<br />
# but only if ALL recipients match the lookup.<br />
#<br />
# %bypass_virus_checks/@bypass_virus_checks_acl/\$bypass_virus_checks_re<br />
# do NOT GUARANTEE the message will NOT be checked for viruses &#8211; this may<br />
# still happen when there is more than one recipient for a message, and<br />
# not all of them match these lookup tables. To guarantee virus delivery,<br />
# a recipient must also match %virus_lovers/@virus_lovers_acl lookups<br />
# (but see milter limitations above),</p>
<p># NOTE: it would not be clever to base virus checks on SENDER address,<br />
# since there are no guarantees that it is genuine. Many viruses<br />
# and spam messages fake sender address. To achieve selective filtering<br />
# based on the source of the mail (e.g. IP address, MTA port number, &#8230;),<br />
# use mechanisms provided by MTA if available.</p>
<p># Similar to lookup tables controlling virus checking, there exist<br />
# spam scanning, banned names/types, and headers_checks control counterparts:<br />
#   %spam_lovers, @spam_lovers_acl, \$spam_lovers_re<br />
#   %banned_files_lovers, @banned_files_lovers_acl, \$banned_files_lovers_re<br />
#   %bad_header_lovers, @bad_header_lovers_acl, \$bad_header_lovers_re<br />
# and:<br />
#   %bypass_spam_checks/@bypass_spam_checks_acl/\$bypass_spam_checks_re<br />
#   %bypass_banned_checks/@bypass_banned_checks_acl/\$bypass_banned_checks_re<br />
#   %bypass_header_checks/@bypass_header_checks_acl/\$bypass_header_checks_re<br />
# See README.lookups for details about the syntax.</p>
<p># The following example disables spam checking altogether,<br />
# since it matches any recipient e-mail address (any address<br />
# is a subdomain of the top-level root DNS domain):<br />
#   @bypass_spam_checks_acl = qw( . );</p>
<p>#   @bypass_header_checks_acl = qw( user@example.com );<br />
#   @bad_header_lovers_acl    = qw( user@example.com );</p>
<p># See README.lookups for further detail, and examples below.</p>
<p># \$virus_lovers{lc(&#8220;postmaster\@\$mydomain&#8221;)} = 1;<br />
# \$virus_lovers{lc(&#8216;postmaster@example.com&#8217;)} = 1;<br />
# \$virus_lovers{lc(&#8216;abuse@example.com&#8217;)} = 1;<br />
# \$virus_lovers{lc(&#8216;some.user@&#8217;)} = 1;  # this recipient, regardless of domain<br />
# \$virus_lovers{lc(&#8216;boss@example.com&#8217;)} = 0; # never, even if domain matches<br />
# \$virus_lovers{lc(&#8216;example.com&#8217;)} = 1; # this domain, but not its subdomains<br />
# \$virus_lovers{lc(&#8216;.example.com&#8217;)}= 1; # this domain, including its subdomains<br />
#or:<br />
# @virus_lovers_acl = qw( me@lab.xxx.com !lab.xxx.com .xxx.com yyy.org );<br />
#<br />
# \$bypass_virus_checks{lc(&#8216;some.user2@butnot.example.com&#8217;)} = 1;<br />
# @bypass_virus_checks_acl = qw( some.ddd !butnot.example.com .example.com );</p>
<p># @virus_lovers_acl = qw( postmaster@example.com );<br />
# \$virus_lovers_re = new_RE( qr&#8217;^(helpdesk|postmaster)@example\.com\$&#8217;i );</p>
<p># \$spam_lovers{lc(&#8220;postmaster\@\$mydomain&#8221;)} = 1;<br />
# \$spam_lovers{lc(&#8216;postmaster@example.com&#8217;)} = 1;<br />
# \$spam_lovers{lc(&#8216;abuse@example.com&#8217;)} = 1;<br />
# @spam_lovers_acl = qw( !.example.com );<br />
# \$spam_lovers_re = new_RE( qr&#8217;^user@example\.com\$&#8217;i );</p>
<p># don&#8217;t run spam check for these RECIPIENT domains:<br />
#   @bypass_spam_checks_acl = qw( d1.com .d2.com a.d3.com );<br />
# or the other way around (bypass check for all BUT these):<br />
#   @bypass_spam_checks_acl = qw( !d1.com !.d2.com !a.d3.com . );<br />
# a practical application: don&#8217;t check outgoing mail for spam:<br />
#   @bypass_spam_checks_acl = ( &#8220;!.\$mydomain&#8221;, &#8220;.&#8221; );<br />
# (a downside of which is that such mail will not count as ham in SA bayes db)</p>
<p># Where to find SQL server(s) and database to support SQL lookups?<br />
# A list of triples: (dsn,user,passw).   (dsn = data source name)<br />
# More than one entry may be specified for multiple (backup) SQL servers.<br />
# See &#8216;man DBI&#8217;, &#8216;man DBD::mysql&#8217;, &#8216;man DBD::Pg&#8217;, &#8230; for details.<br />
# When chroot-ed, accessing SQL server over inet socket may be more convenient.<br />
#<br />
# @lookup_sql_dsn =<br />
#   ( ['DBI:mysql:database=mail;host=127.0.0.1;port=3306', 'user1', 'passwd1'],<br />
#     ['DBI:mysql:database=mail;host=host2', 'username2', 'password2'] );<br />
#<br />
# (&#8216;mail&#8217; in the example is the database name, choose what you like)<br />
# With PostgreSQL the dsn (first element of the triple) may look like:<br />
#      &#8216;DBI:Pg:host=host1;dbname=mail&#8217;</p>
<p># The SQL select clause to fetch per-recipient policy settings.<br />
# The %k will be replaced by a comma-separated list of query addresses<br />
# (e.g. full address, domain only, catchall).  Use ORDER, if there<br />
# is a chance that multiple records will match &#8211; the first match wins.<br />
# If field names are not unique (e.g. &#8216;id&#8217;), the later field overwrites the<br />
# earlier in a hash returned by lookup, which is why we use &#8216;*,users.id&#8217;.<br />
# \$sql_select_policy = &#8216;SELECT *,users.id FROM users,policy&#8217;.<br />
#   &#8216; WHERE (users.policy_id=policy.id) AND (users.email IN (%k))&#8217;.<br />
#   &#8216; ORDER BY users.priority DESC&#8217;;<br />
#<br />
# The SQL select clause to check sender in per-recipient whitelist/blacklist<br />
# The first SELECT argument &#8216;?&#8217; will be users.id from recipient SQL lookup,<br />
# the %k will be sender addresses (e.g. full address, domain only, catchall).<br />
# \$sql_select_white_black_list = &#8216;SELECT wb FROM wblist,mailaddr&#8217;.<br />
#     &#8216; WHERE (wblist.rid=?) AND (wblist.sid=mailaddr.id)&#8217;.<br />
#     &#8216;   AND (mailaddr.email IN (%k))&#8217;.<br />
#   &#8216; ORDER BY mailaddr.priority DESC&#8217;;</p>
<p>\$sql_select_white_black_list = undef;  # undef disables SQL white/blacklisting</p>
<p># If you decide to pass viruses (or spam) to certain recipients using the<br />
# above lookup tables or using \$final_virus_destiny=D_PASS, you can set<br />
# the variable \$addr_extension_virus (\$addr_extension_spam) to some<br />
# string, and the recipient address will have this string appended<br />
# as an address extension to the local-part of the address. This extension<br />
# can be used by final local delivery agent to place such mail in different<br />
# folders. Leave these two variables undefined or empty strings to prevent<br />
# appending address extensions. Setting has no effect on recipient which will<br />
# not be receiving viruses/spam. Recipients who do not match lookup tables<br />
# local_domains* are not affected.<br />
#<br />
# LDAs usually default to stripping away address extension if no special<br />
# handling is specified, so having this option enabled normally does no harm,<br />
# provided the \$recipients_delimiter matches the setting on the final<br />
# MTA&#8217;s LDA.</p>
<p># \$addr_extension_virus  = &#8216;virus&#8217;;	# (default is undef, same as empty)<br />
# \$addr_extension_spam   = &#8216;spam&#8217;;	# (default is undef, same as empty)<br />
# \$addr_extension_banned = &#8216;banned&#8217;;	# (default is undef, same as empty)</p>
<p># Delimiter between local part of the recipient address and address extension<br />
# (which can optionally be added, see variables \$addr_extension_virus and<br />
# \$addr_extension_spam). E.g. recipient address  gets changed<br />
# to .<br />
#<br />
# Delimiter should match equivalent (final) MTA delimiter setting.<br />
# (e.g. for Postfix add &#8216;recipient_delimiter = +&#8217; to main.cf)<br />
# Setting it to an empty string or to undef disables this feature<br />
# regardless of \$addr_extension_virus and \$addr_extension_spam settings.</p>
<p>\$recipient_delimiter = &#8216;+&#8217;;		# (default is &#8216;+&#8217;)</p>
<p># true: replace extension;  false: append extension<br />
\$replace_existing_extension = 1;	# (default is false)</p>
<p># Affects matching of localpart of e-mail addresses (left of &#8216;@&#8217;)<br />
# in lookups: true = case sensitive, false = case insensitive<br />
\$localpart_is_case_sensitive = 0;	# (default is false)</p>
<p># ENVELOPE SENDER WHITELISTING / BLACKLISTING  &#8211; GLOBAL (RECIPIENT-INDEPENDENT)<br />
# (affects spam checking only, has no effect on virus and other checks)</p>
<p># WHITELISTING: use ENVELOPE SENDER lookups to ENSURE DELIVERY from whitelisted<br />
# senders even if the message would be recognized as spam. Effectively, for<br />
# the specified senders, message recipients temporarily become &#8216;spam_lovers&#8217;.<br />
# To avoid surprises, whitelisted sender also suppresses inserting/editing<br />
# the tag2-level header fields (X-Spam-*, Subject), appending spam address<br />
# extension, and quarantining.</p>
<p># BLACKLISTING: messages from specified SENDERS are DECLARED SPAM.<br />
# Effectively, for messages from blacklisted senders, spam level<br />
# is artificially pushed high, and the normal spam processing applies,<br />
# resulting in &#8216;X-Spam-Flag: YES&#8217;, high &#8216;X-Spam-Level&#8217; bar and other usual<br />
# reactions to spam, including possible rejection. If the message nevertheless<br />
# still passes (e.g. for spam loving recipients), it is tagged as BLACKLISTED<br />
# in the &#8216;X-Spam-Status&#8217; header field, but the reported spam value and<br />
# set of tests in this report header field (if available from SpamAssassin,<br />
# which may have not been called) is not adjusted.<br />
#<br />
# A sender may be both white- and blacklisted at the same time, settings<br />
# are independent. For example, being both white- and blacklisted, message<br />
# is delivered to recipients, but is not tagged as spam (X-Spam-Flag: No;<br />
# X-Spam-Status: No, &#8230;), but the reported spam level (if computed) may<br />
# still indicate high spam score.<br />
#<br />
# If ALL recipients of the message either white- or blacklist the sender,<br />
# spam scanning (calling the SpamAssassin) is bypassed, saving on time.<br />
#<br />
# The following variables (lookup tables) are available, with the semantics<br />
# and syntax as specified in README.lookups:<br />
#<br />
# %whitelist_sender, @whitelist_sender_acl, \$whitelist_sender_re<br />
# %blacklist_sender, @blacklist_sender_acl, \$blacklist_sender_re</p>
<p># SOME EXAMPLES:<br />
#<br />
#ACL:<br />
# @whitelist_sender_acl = qw( .example.com );<br />
#<br />
# @whitelist_sender_acl = ( &#8220;.\$mydomain&#8221; );  # \$mydomain and its subdomains<br />
# NOTE: This is not a reliable way of turning off spam checks for<br />
#       locally-originating mail, as sender address can easily be faked.<br />
#       To reliably avoid spam-scanning outgoing mail,<br />
#       use @bypass_spam_checks_acl .</p>
<p>#RE:<br />
# \$whitelist_sender_re = new_RE(<br />
#   qr&#8217;^postmaster@.*\bexample\.com\$&#8217;i,<br />
#   qr&#8217;owner-[^@]*@&#8217;i,  qr&#8217;-request@&#8217;i,<br />
#   qr&#8217;\.example\.com\$&#8217;i );<br />
#<br />
\$blacklist_sender_re = new_RE(<br />
    qr&#8217;^(bulkmail|offers|cheapbenefits|earnmoney|foryou|greatcasino)@&#8217;i,<br />
    qr&#8217;^(investments|lose_weight_today|market\.alert|money2you|MyGreenCard)@&#8217;i,<br />
    qr&#8217;^(new\.tld\.registry|opt-out|opt-in|optin|saveonl|smoking2002k)@&#8217;i,<br />
    qr&#8217;^(specialoffer|specialoffers|stockalert|stopsnoring|wantsome)@&#8217;i,<br />
    qr&#8217;^(workathome|yesitsfree|your_friend|greatoffers)@&#8217;i,<br />
    qr&#8217;^(inkjetplanet|marketopt|MakeMoney)\d*@&#8217;i,<br />
);</p>
<p>#HASH lookup variant:<br />
# NOTE: Perl operator qw splits its argument string by whitespace<br />
# and produces a list. This means that addresses can not contain<br />
# whitespace, and there is no provision for comments within the string.<br />
# You can use the normal Perl list syntax if you have special requirements,<br />
# e.g. map {&#8230;} (&#8216;one user@bla&#8217;, &#8216;.second.com&#8217;), or use read_hash to read<br />
# addresses from a file.<br />
#</p>
<p># a hash lookup table can be read from a file,<br />
# one address per line, comments and empty lines are permitted:<br />
#<br />
# read_hash(\%whitelist_sender, &#8216;/var/amavis/whitelist_sender&#8217;);</p>
<p># &#8230; or set directly:<br />
map { \$whitelist_sender{lc(\$_)}=1 } (qw(<br />
  nobody@cert.org<br />
  owner-alert@iss.net<br />
  slashdot@slashdot.org<br />
  bugtraq@securityfocus.com<br />
  NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM<br />
  security-alerts@linuxsecurity.com<br />
  amavis-user-admin@lists.sourceforge.net<br />
  razor-users-admin@lists.sourceforge.net<br />
  notification-return@lists.sophos.com<br />
  mailman-announce-admin@python.org<br />
  zope-announce-admin@zope.org<br />
  owner-postfix-users@postfix.org<br />
  owner-postfix-announce@postfix.org<br />
  owner-sendmail-announce@lists.sendmail.org<br />
  sendmail-announce-request@lists.sendmail.org<br />
  ca+envelope@sendmail.org<br />
  owner-technews@postel.ACM.ORG<br />
  lvs-users-admin@LinuxVirtualServer.org<br />
  ietf-123-owner@loki.ietf.org<br />
  cvs-commits-list-admin@gnome.org<br />
  rt-users-admin@lists.fsck.com<br />
  owner-announce@mnogosearch.org<br />
  owner-hackers@ntp.org<br />
  owner-bugs@ntp.org<br />
  clp-request@comp.nus.edu.sg<br />
  surveys-errors@lists.nua.ie<br />
  emailNews@genomeweb.com<br />
  owner-textbreakingnews@CNNIMAIL12.CNN.COM<br />
  yahoo-dev-null@yahoo-inc.com<br />
));</p>
<p># ENVELOPE SENDER WHITELISTING / BLACKLISTING &#8211; PER-RECIPIENT</p>
<p># The same semantics as for global white/blacklisting applies, but this<br />
# time each recipient (or its domain, or subdomain, &#8230;) can be given<br />
# an individual lookup table for matching senders. The per-recipient lookups<br />
# override the global lookups, which serve as a fallback default.</p>
<p># Specify a two-level lookup table: the key for the outer table is recipient,<br />
# and the result should be an inner lookup table (hash or ACL or RE),<br />
# where the key used will be the sender.<br />
#<br />
#\$per_recip_blacklist_sender_lookup_tables = {<br />
# &#8216;user1@my.example.com&#8217;=&gt;new_RE(qr&#8217;^(inkjetplanet|marketopt|MakeMoney)\d*@&#8217;i),<br />
# &#8216;user2@my.example.com&#8217;=&gt;[qw( spammer@d1.example,org .d2.example,org )],<br />
#};<br />
#\$per_recip_whitelist_sender_lookup_tables = {<br />
# &#8216;user@my.example.com&#8217; =&gt; [qw( friend@example.org .other.example.org )],<br />
# &#8216;.my1.example.com&#8217;    =&gt; [qw( !foe.other.example,org .other.example,org )],<br />
# &#8216;.my2.example.com&#8217;    =&gt; read_hash(&#8216;/var/amavis/my2-wl.dat&#8217;),<br />
# &#8216;abuse@&#8217; =&gt; { &#8216;postmaster@&#8217;=&gt;1,<br />
#               &#8216;cert-advisory-owner@cert.org&#8217;=&gt;1, &#8216;owner-alert@iss.net&#8217;=&gt;1 },<br />
#};</p>
<p>#<br />
# Section VI &#8211; Resource limits<br />
#</p>
<p># Sanity limit to the number of allowed recipients per SMTP transaction<br />
# \$smtpd_recipient_limit = 1000;  # (default is 1000)</p>
<p># Resource limits to protect unpackers, decompressors and virus scanners<br />
# against mail bombs (e.g. 42.zip)</p>
<p># Maximum recursion level for extraction/decoding (0 or undef disables limit)<br />
\$MAXLEVELS = 14;		# (default is undef, no limit)</p>
<p># Maximum number of extracted files (0 or undef disables the limit)<br />
\$MAXFILES = 1500;		# (default is undef, no limit)</p>
<p># For the cumulative total of all decoded mail parts we set max storage size<br />
# to defend against mail bombs. Even though parts may be deleted (replaced<br />
# by decoded text) during decoding, the size they occupied is _not_ returned<br />
# to the quota pool.<br />
#<br />
# Parameters to storage quota formula for unpacking/decoding/decompressing<br />
#   Formula:<br />
#     quota = max(\$MIN_EXPANSION_QUOTA,<br />
#                 \$mail_size*\$MIN_EXPANSION_FACTOR,<br />
#                 min(\$MAX_EXPANSION_QUOTA, \$mail_size*\$MAX_EXPANSION_FACTOR))<br />
#   In plain words (later condition overrules previous ones):<br />
#     allow MAX_EXPANSION_FACTOR times initial mail size,<br />
#     but not more than MAX_EXPANSION_QUOTA,<br />
#     but not less than MIN_EXPANSION_FACTOR times initial mail size,<br />
#     but never less than MIN_EXPANSION_QUOTA<br />
#<br />
\$MIN_EXPANSION_QUOTA =      100*1024;  # bytes  (default undef, not enforced)<br />
\$MAX_EXPANSION_QUOTA = 300*1024*1024;  # bytes  (default undef, not enforced)<br />
\$MIN_EXPANSION_FACTOR =   5;  # times original mail size  (must be specified)<br />
\$MAX_EXPANSION_FACTOR = 500;  # times original mail size  (must be specified)</p>
<p>#<br />
# Section VII &#8211; External programs, virus scanners<br />
#</p>
<p># Specify a path string, which is a colon-separated string of directories<br />
# (no trailing slashes!) to be assigned to the environment variable PATH<br />
# and to serve for locating external programs below.</p>
<p># NOTE: if \$daemon_chroot_dir is nonempty, the directories will be<br />
#       relative to the chroot directory specified;</p>
<p>\$path = &#8216;/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:/bin&#8217;;</p>
<p># Specify one string or a search list of strings (first match wins).<br />
# The string (or: each string in a list) may be an absolute path,<br />
# or just a program name, to be located via \$path;<br />
# Empty string or undef (=default) disables the use of that external program.<br />
# Optionally command arguments may be specified &#8211; only the first substring<br />
# up to the whitespace is used for file searching.</p>
<p>\$file   = &#8216;file&#8217;;   # file(1) utility; use 3.41 or later to avoid vulnerability</p>
<p>\$gzip   = &#8216;gzip&#8217;;<br />
\$bzip2  = &#8216;bzip2&#8242;;<br />
\$lzop   = &#8216;lzop&#8217;;<br />
\$uncompress = ['uncompress', 'gzip -d', 'zcat'];<br />
\$unfreeze   = ['unfreeze', 'freeze -d', 'melt', 'fcat'];<br />
\$arc        = ['nomarch', 'arc'];<br />
\$unarj      = ['arj', 'unarj'];  # both can extract, arj is recommended<br />
\$unrar      = ['rar', 'unrar'];  # both can extract, same options<br />
\$zoo    = &#8216;zoo&#8217;;<br />
\$lha    = &#8216;lha&#8217;;<br />
\$cpio   = &#8216;cpio&#8217;;   # comment out if cpio does not support GNU options</p>
<p># SpamAssassin settings</p>
<p># \$sa_local_tests_only is passed to Mail::SpamAssassin::new as a value<br />
# of the option local_tests_only. See Mail::SpamAssassin man page.<br />
# If set to 1, SA tests are restricted to local tests only, i.e. no tests<br />
# that require internet access will be performed.<br />
#<br />
\$sa_local_tests_only = 1;   # (default: false)<br />
#\$sa_auto_whitelist = 1;    # turn on AWL (default: false)</p>
<p># Timout for SpamAssassin. This is only used if spamassassin does NOT<br />
# override it (which it often does if sa_local_tests_only is not true)<br />
\$sa_timeout = 30;           # timeout in seconds for a call to SpamAssassin<br />
                            # (default is 30 seconds, undef disables it)</p>
<p># AWL (auto whitelisting), requires spamassassin 2.44 or better<br />
# \$sa_auto_whitelist = 1;   # defaults to undef</p>
<p>\$sa_mail_body_size_limit = 150*1024;  # don&#8217;t waste time on SA is mail is larger<br />
			    # (less than 1% of spam is &gt; 64k)<br />
			    # default: undef, no limitations</p>
<p># default values, can be overridden by more specific lookups, e.g. SQL<br />
\$sa_tag_level_deflt  = 4.0; # add spam info headers if at, or above that level<br />
\$sa_tag2_level_deflt = 6.3; # add &#8216;spam detected&#8217; headers at that level<br />
\$sa_kill_level_deflt = \$sa_tag2_level_deflt; # triggers spam evasive actions<br />
                           # at or above that level: bounce/reject/drop,<br />
                           # quarantine, and adding mail address extension</p>
<p>\$sa_dsn_cutoff_level = 10;  # spam level beyond which a DSN is not sent,<br />
                            # effectively turning D_BOUNCE into D_DISCARD;<br />
                            # undef disables this feature and is a default;</p>
<p>#<br />
# The \$sa_tag_level_deflt, \$sa_tag2_level_deflt and \$sa_kill_level_deflt<br />
# may also be hashrefs to hash lookup tables, to make static per-recipient<br />
# settings possible without having to resort to SQL or LDAP lookups.</p>
<p># a quick reference:<br />
#   tag_level  controls adding the X-Spam-Status and X-Spam-Level headers,<br />
#   tag2_level controls adding &#8216;X-Spam-Flag: YES&#8217;, and editing Subject,<br />
#   kill_level controls &#8216;evasive actions&#8217; (reject, quarantine, extensions);<br />
# it only makes sense to maintain the relationship:<br />
# tag_level ]*&gt;clean/,<br />
#   qr/(?i)]*&gt;infected/,<br />
#   qr/(?i)(.+)/ ],</p>
<p>  ['KasperskyLab AVP - aveclient',<br />
    ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient',<br />
     '/opt/kav/bin/aveclient','aveclient'],<br />
    &#8216;-p /var/run/aveserver -s {}/*&#8217;, [0,3,6,8], qr/\b(INFECTED|SUSPICION)\b/,<br />
    qr/(?:INFECTED|SUSPICION) (.+)/,<br />
  ],</p>
<p>  ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp'],<br />
    &#8216;-* -P -B -Y -O- {}&#8217;, [0,8,16,24], [2,3,4,5,6, 18,19,20,21,22],<br />
    qr/infected: (.+)/,<br />
    sub {chdir(&#8216;/opt/AVP&#8217;) or die &#8220;Can&#8217;t chdir to AVP: \$!&#8221;},<br />
    sub {chdir(\$TEMPBASE) or die &#8220;Can&#8217;t chdir back to \$TEMPBASE \$!&#8221;},<br />
  ],</p>
<p>  ### The kavdaemon and AVPDaemonClient have been removed from Kasperky<br />
  ### products and replaced by aveserver and aveclient<br />
  ['KasperskyLab AVPDaemonClient',<br />
    [ '/opt/AVP/kavdaemon',       'kavdaemon',<br />
      '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient',<br />
      '/opt/AVP/AvpTeamDream',    'AvpTeamDream',<br />
      '/opt/AVP/avpdc', 'avpdc' ],<br />
    &#8220;-f=\$TEMPBASE {}&#8221;, [0,8,16,24], [2,3,4,5,6, 18,19,20,21,22],<br />
    qr/infected: ([^\r\n]+)/ ],<br />
    # change the startup-script in /etc/init.d/kavd to:<br />
    #   DPARMS=&#8221;-* -Y -dl -f=/var/amavis /var/amavis&#8221;<br />
    #   (or perhaps:   DPARMS=&#8221;-I0 -Y -* /var/amavis&#8221; )<br />
    # adjusting /var/amavis above to match your \$TEMPBASE.<br />
    # The &#8216;-f=/var/amavis&#8217; is needed if not running it as root, so it<br />
    # can find, read, and write its pid file, etc., see &#8216;man kavdaemon&#8217;.<br />
    # defUnix.prf: there must be an entry &#8220;*/var/amavis&#8221; (or whatever<br />
    #   directory \$TEMPBASE specifies) in the &#8216;Names=&#8217; section.<br />
    # cd /opt/AVP/DaemonClients; configure; cd Sample; make<br />
    # cp AvpDaemonClient /opt/AVP/<br />
    # su &#8211; vscan -c &#8220;\${PREFIX}/kavdaemon \${DPARMS}&#8221;</p>
<p>  ### http://www.hbedv.com/ or http://www.centralcommand.com/<br />
  ['H+BEDV AntiVir or CentralCommand Vexira Antivirus',<br />
    ['antivir','vexira'],<br />
    &#8216;&#8211;allfiles -noboot -nombr -rs -s -z {}&#8217;, [0], qr/ALERT:|VIRUS:/,<br />
    qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* &#8216; ) |<br />
         (?i) VIRUS:\ .*?\ virus\ &#8216;?) ( [^\]\s&#8217;]+ )/ ],<br />
    # NOTE: if you only have a demo version, remove -z and add 214, as in:<br />
    #  &#8216;&#8211;allfiles -noboot -nombr -rs -s {}&#8217;, [0,214], qr/ALERT:|VIRUS:/,</p>
<p>  ### http://www.commandsoftware.com/<br />
  ['Command AntiVirus for Linux', 'csav',<br />
    '-all -archive -packed {}', [50], [51,52,53],<br />
    qr/Infection: (.+)/ ],</p>
<p>  ### http://www.symantec.com/<br />
  ['Symantec CarrierScan via Symantec CommandLineScanner',<br />
    'cscmdline', '-a scan -i 1 -v -s 127.0.0.1:7777 {}',<br />
    qr/^Files Infected:\s+0\$/, qr/^Infected\b/,<br />
    qr/^(?:Info|Virus Name):\s+(.+)/ ],</p>
<p>  ### http://www.symantec.com/<br />
  ['Symantec AntiVirus Scan Engine',<br />
    'savsecls', '-server 127.0.0.1:7777 -mode scanrepair -details -verbose {}',<br />
    [0], qr/^Infected\b/,<br />
    qr/^(?:Info|Virus Name):\s+(.+)/ ],<br />
    # NOTE: check options and patterns to see which entry better applies</p>
<p>  ### http://www.sald.com/, http://drweb.imshop.de/<br />
  ['drweb - DrWeb Antivirus',<br />
    ['/usr/local/drweb/drweb', '/opt/drweb/drweb', 'drweb'],<br />
    &#8216;-path={} -al -go -ot -cn -upn -ok-&#8217;,<br />
    [0,32], [1,33], qr&#8217; infected (?:with|by)(?: virus)? (.*)\$&#8217;],</p>
<p># ### http://www.sald.com/, http://www.dials.ru/english/, http://www.drweb.ru/<br />
# ['DrWebD', \&amp;ask_daemon,   # DrWebD 4.31 or later<br />
#   [pack('N',1).  # DRWEBD_SCAN_CMD<br />
#    pack('N',0x00280001).   # DONT_CHANGEMAIL, IS_MAIL, RETURN_VIRUSES<br />
#    pack('N',     # path length<br />
#      length("\$TEMPBASE/amavis-yyyymmddTHHMMSS-xxxxx/parts/part-xxxxx")).<br />
#    '{}/*'.       # path<br />
#    pack('N',0).  # content size<br />
#    pack('N',0),<br />
#    '/var/drweb/run/drwebd.sock',<br />
#  # '/var/amavis/var/run/drwebd.sock',   # suitable for chroot<br />
#  # '/usr/local/drweb/run/drwebd.sock',  # FreeBSD drweb ports default<br />
#  # '127.0.0.1:3000',                    # or over an inet socket<br />
#   ],<br />
#   qr/\A\x00(\x10|\x11)\x00\x00/s,              # IS_CLEAN, EVAL_KEY<br />
#   qr/\A\x00(\x00|\x01)\x00(\x20|\x40|\x80)/s,  # KNOWN_V, UNKNOWN_V, V._MODIF<br />
#   qr/\A.{12}(?:infected with )?([^\x00]+)\x00/s,<br />
# ],<br />
# # NOTE: If you are using amavis-milter, change length to:<br />
# # length(&#8220;\$TEMPBASE/amavis-milter-xxxxxxxxxxxxxx/parts/part-xxxxx&#8221;).</p>
<p>  ### http://www.f-secure.com/products/anti-virus/<br />
  ['F-Secure Antivirus', 'fsav',<br />
   '--dumb --mime --archive {}', [0], [3,8],<br />
   qr/(?:infection|Infected|Suspected): (.+)/ ],</p>
<p>  ['CAI InoculateIT', 'inocucmd',<br />
    '-sec -nex {}', [0], [100],<br />
    qr/was infected by virus (.+)/ ],</p>
<p>  ['MkS_Vir for Linux (beta)', ['mks32','mks'],<br />
    &#8216;-s {}/*&#8217;, [0], [1,2],    # any use for options: -a -c  ?<br />
    qr/&#8211;[ \t]*(.+)/ ], </p>
<p>  ### http://www.nod32.com/<br />
  ['ESET Software NOD32', 'nod32',<br />
    '-all -subdir+ {}', [0], [1,2],<br />
    qr/^.+? &#8211; (.+?)\s*(?:backdoor|joke|trojan|virus|worm)/ ],</p>
<p>  ### http://www.nod32.com/<br />
  ['ESET Software NOD32 - Client/Server Version', 'nod32cli',<br />
    '-a -r -d recurse --heur standard {}', [0], [10,11],<br />
    qr/^\S+\s+infected:\s+(.+)/ ],</p>
<p>  ### http://www.norman.com/products_nvc.shtml<br />
  ['Norman Virus Control v5 / Linux', 'nvcc',<br />
    '-c -l:0 -s -u {}', [0], [1],<br />
    qr/(?i).* virus in .* -&gt; \&#8217;(.+)\&#8217;/ ],</p>
<p>  ### http://www.pandasoftware.com/<br />
  ['Panda Antivirus for Linux', ['pavcl'],<br />
    &#8216;-aut -aex -heu -cmp -nbr -nor -nso -eng {}&#8217;,<br />
    qr/Number of files infected[ .]*: 0(?!\d)/,<br />
    qr/Number of files infected[ .]*: 0*[1-9]/,<br />
    qr/Found virus :\s*(\S+)/ ],</p>
<p># GeCAD AV technology is acquired by Microsoft; RAV has been discontinued.<br />
# Check your RAV license terms before fiddling with the following two lines!<br />
# ['GeCAD RAV AntiVirus 8', 'ravav',<br />
#   '--all --archive --mail {}', [1], [2,3,4,5], qr/Infected: (.+)/ ],<br />
# # NOTE: the command line switches changed with scan engine 8.5 !<br />
# # (btw, assigning stdin to /dev/null causes RAV to fail)</p>
<p>  ### http://www.nai.com/<br />
  ['NAI McAfee AntiVirus (uvscan)', 'uvscan',<br />
    '--secure -rv --mime --summary --noboot - {}', [0], [13],<br />
    qr/(?x) Found (?:<br />
        \ the\ (.+)\ (?:virus|trojan)  |<br />
        \ (?:virus|trojan)\ or\ variant\ ([^ ]+)  |<br />
        :\ (.+)\ NOT\ a\ virus)/,<br />
  # sub {\$ENV{LD_PRELOAD}=&#8217;/lib/libc.so.6&#8242;},<br />
  # sub {delete \$ENV{LD_PRELOAD}},<br />
  ],<br />
  # NOTE1: with RH9: force the dynamic linker to look at /lib/libc.so.6 before<br />
  # anything else by setting environment variable LD_PRELOAD=/lib/libc.so.6<br />
  # and then clear it when finished to avoid confusing anything else.<br />
  # NOTE2: to treat encrypted files as viruses replace the [13] with:<br />
  #  qr/^\s{5,}(Found|is password-protected|.*(virus|trojan))/</p>
<p>  ### http://www.virusbuster.hu/en/<br />
  ['VirusBuster', ['vbuster', 'vbengcl'],<br />
    # VirusBuster Ltd. does not support the daemon version for the workstation<br />
    # engine (vbuster-eng-1.12-linux-i386-libc6.tgz) any longer. The names of<br />
    # binaries, some parameters AND return codes (from 3 to 1) changed.<br />
    &#8220;{} -ss -i &#8216;*&#8217; -log=\$MYHOME/vbuster.log&#8221;, [0], [1],<br />
    qr/: &#8216;(.*)&#8217; &#8211; Virus/ ],</p>
<p># ### http://www.virusbuster.hu/en/<br />
# ['VirusBuster (Client + Daemon)', 'vbengd',<br />
#   # HINT: for an infected file it returns always 3,<br />
#   # although the man-page tells a different story<br />
#   '-f -log scandir {}', [0], [3],<br />
#   qr/Virus found = (.*);/ ],</p>
<p>  ### http://www.cyber.com/<br />
  ['CyberSoft VFind', 'vfind',<br />
    '--vexit {}/*', [0], [23], qr/##==&gt;&gt;&gt;&gt; VIRUS ID: CVDL (.+)/,<br />
  # sub {\$ENV{VSTK_HOME}=&#8217;/usr/lib/vstk&#8217;},<br />
  ],</p>
<p>  ### http://www.ikarus-software.com/<br />
  ['Ikarus AntiVirus for Linux', 'ikarus',<br />
    '{}', [0], [40], qr/Signature (.+) found/ ],</p>
<p>  ### http://www.bitdefender.com/<br />
  ['BitDefender', 'bdc',<br />
    '--all --arc --mail {}', qr/^Infected files *:0(?!\d)/,<br />
    qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/,<br />
    qr/(?:suspected|infected): (.*)(?:33|\$)/ ],</p>
<p>### F-Prot http://www.f-prot.com<br />
['FRISK F-Prot Antivirus', ['f-prot','/usr/lib/f-prot/f-prot.sh'],<br />
   &#8216;-dumb -archive -packed {}&#8217;, [0,8], [3,6],<br />
    qr/Infection: (.+)|\s+contains\s+(.+)\$/ ],<br />
);</p>
<p># If no virus scanners from the @av_scanners list produce &#8216;clean&#8217; nor<br />
# &#8216;infected&#8217; status (e.g. they all fail to run or the list is empty),<br />
# then _all_ scanners from the @av_scanners_backup list are tried.<br />
# When there are both daemonized and command-line scanners available,<br />
# it is customary to place slower command-line scanners in the<br />
# @av_scanners_backup list. The default choice is somewhat arbitrary,<br />
# move entries from one list to another as desired.</p>
<p>@av_scanners_backup = (</p>
<p>  ### http://www.clamav.net/<br />
  ['Clam Antivirus - clamscan', 'clamscan',<br />
    "--stdout --no-summary -r --tempdir=\$TEMPBASE {}", [0], [1],<br />
    qr/^.*?: (?!Infected Archive)(.*) FOUND\$/ ],</p>
<p>  ### http://www.f-prot.com/<br />
  ['FRISK F-Prot Antivirus', ['f-prot','f-prot.sh'],<br />
    &#8216;-dumb -archive -packed {}&#8217;, [0,8], [3,6],<br />
    qr/Infection: (.+)/ ],</p>
<p>  ### http://www.trendmicro.com/<br />
  ['Trend Micro FileScanner', ['/etc/iscan/vscan','vscan'],<br />
    &#8216;-za -a {}&#8217;, [0], qr/Found virus/, qr/Found virus (.+) in/ ],</p>
<p>  ['KasperskyLab kavscanner', ['/opt/kav/bin/kavscanner','kavscanner'],<br />
    &#8216;-i1 -xp {}&#8217;, [0,10,15], [5,20,21,25],<br />
    qr/(?:CURED|INFECTED|CUREFAILED|WARNING|SUSPICION) (.*)/ ,<br />
    sub {chdir(&#8216;/opt/kav/bin&#8217;) or die &#8220;Can&#8217;t chdir to kav: \$!&#8221;},<br />
    sub {chdir(\$TEMPBASE) or die &#8220;Can&#8217;t chdir back to \$TEMPBASE \$!&#8221;},<br />
  ],</p>
<p># Commented out because the name &#8216;sweep&#8217; clashes with the Debian package of<br />
# the same name. Make sure the correct sweep is found in the path when enabling<br />
#<br />
# ### http://www.sophos.com/<br />
# ['Sophos Anti Virus (sweep)', 'sweep',<br />
#   '-nb -f -all -rec -ss -sc -archive -cab -tnef --no-reset-atime {}',<br />
#   [0,2], qr/Virus .*? found/,<br />
#   qr/^&gt;&gt;&gt; Virus(?: fragment)? &#8216;?(.*?)&#8217;? found/,<br />
# ],<br />
# # other options to consider: -mime -oe -idedir=/usr/local/sav</p>
<p># always succeeds (uncomment to consider mail clean if all other scanners fail)<br />
# ['always-clean', sub {0}],</p>
<p>);</p>
<p>#<br />
# Section VIII &#8211; Debugging<br />
#</p>
<p># The most useful debugging tool is to run amavisd-new non-detached<br />
# from a terminal window:<br />
# amavisd debug</p>
<p># Some more refined approaches:</p>
<p># If sender matches ACL, turn log level fully up, just for this one message,<br />
# and preserve temporary directory<br />
#@debug_sender_acl = ( &#8220;test-sender\@\$mydomain&#8221; );<br />
#@debug_sender_acl = qw( debug@example.com );</p>
<p># May be useful along with @debug_sender_acl:<br />
# Prevent all decoded originals being deleted (replaced by decoded part)<br />
#\$keep_decoded_original_re = new_RE( qr/.*/ );</p>
<p># Turn on SpamAssassin debugging (output to STDERR, use with &#8216;amavisd debug&#8217;)<br />
#\$sa_debug = 1;            # defaults to false</p>
<p>#&#8212;&#8212;&#8212;&#8212;-<br />
1;  # insure a defined return</p>
<p>EOF</p>
<p>echo -e &#8220;Re-iniciando o amavis&#8221;\\m</p>
<p>/etc/init.d/amavis restart </p>
<p># Dando uma olhada no syslog<br />
tail -n 10 /var/log/syslog</p>
<p>echo -e \\n<br />
echo -e &#8220;Pronto, seu Clamav {http://www.clamav.net/}  foi atualizado e adicionamos o Anti-Vírus F-Prot &#8220;<br />
echo -e &#8220;{http://www.f-prot.com.pt/} para melhor proteção&#8221;\\n<br />
echo -e &#8220;O seguinte conteudo foi adicionado ao seu /etc/amavis/amavisd.conf:&#8221;<br />
echo -e &#8220;<br />
   ### F-Prot http://www.f-prot.com<br />
   ['FRISK F-Prot Antivirus', ['f-prot','/usr/lib/f-prot/f-prot.sh'],<br />
      &#8216;-dumb -archive -packed {}&#8217;, [0,8], [3,6],<br />
        qr/Infection: (.+)|\s+contains\s+(.+)\$/ ],<br />
&#8220;\\n</p>
<p>echo -e &#8220;Para instalar outros software adicionais e melhorar a segurança do sistema,&#8221;<br />
echo -e &#8220;recomendamos dar uma olhada em http://www.howtoforge.com/postfix_amavisd_antispam&#8221;\\n</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shellscript.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shellscript.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shellscript.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shellscript.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/shellscript.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/shellscript.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shellscript.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shellscript.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shellscript.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shellscript.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shellscript.wordpress.com&amp;blog=418885&amp;post=3&amp;subd=shellscript&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://shellscript.wordpress.com/2006/09/16/atualiza-o-clamav-anti-virus-para-versao-mais-recente-e-instala-o-f-prot-anti-virus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1010c78bece0e9a1706cc403a0079073?s=96&#38;d=identicon" medium="image">
			<media:title type="html">clubedebian</media:title>
		</media:content>
	</item>
	</channel>
</rss>
