<?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/"
	>

<channel>
	<title>Thiago Melo &#187; Bash</title>
	<atom:link href="http://thiago.oxente.org/category/programacao/bash/feed" rel="self" type="application/rss+xml" />
	<link>http://thiago.oxente.org</link>
	<description>Linux, Programação, Redes e Jogos.</description>
	<lastBuildDate>Thu, 04 Feb 2010 18:03:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Logparser, script para colorir o log do Spamdyke</title>
		<link>http://thiago.oxente.org/2009/08/11/logparser-script-para-colorir-o-log-do-spamdyke</link>
		<comments>http://thiago.oxente.org/2009/08/11/logparser-script-para-colorir-o-log-do-spamdyke#comments</comments>
		<pubDate>Tue, 11 Aug 2009 19:10:50 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programação]]></category>

		<guid isPermaLink="false">http://thiago.oxente.org/?p=181</guid>
		<description><![CDATA[Outro dia eu estava analisando os logs do Spamdyke, e me fiquei bastante confuso para acompanhar os dados pelo "tail -f", pois era muita informação na tela, que só o Neo Matrix conseguiria ler. Buscando no google, achei um shellscript que fazia um parser de um log e mostrava um resultado colorido de forma que [...]]]></description>
			<content:encoded><![CDATA[<p>Outro dia eu estava analisando os logs do <strong>Spamdyke</strong>, e me fiquei bastante confuso para acompanhar os dados pelo "tail -f", pois era muita informação na tela, que só o Neo Matrix conseguiria ler. Buscando no google, achei um <strong>shellscript</strong> que fazia um parser de um log e mostrava um resultado colorido de forma que facilitava a visualização. Peguei esse código e fiz umas modificações e adaptei ele para o <strong>SpamDyke</strong>.<br />
Não sei se ele de forma genérica funciona para todo mundo, no caso no meu <strong>Spamdyke</strong> está gerando log no <strong>syslog</strong> no nivel de mail, no caso no <strong>mailog</strong>, e sem nenhuma modificação nas configurações padrões, segue a screenshot abaixo.<br />
<a href="http://thiago.oxente.org/wp-content/uploads/2009/08/fundo4.png"><img class="aligncenter size-medium wp-image-182" title="fundo4" src="http://thiago.oxente.org/wp-content/uploads/2009/08/fundo4-300x187.png" alt="fundo4" width="300" height="187" /></a><br />
*Nota que o "spray" vermelho eu coloquei para ocultar os domínios do meu servidor.</p>
<p>Segue o código abaixo</p>
<p><span id="more-181"></span></p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!/bin/sh</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">RED=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[0;31m"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">GREEN=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[0;32m"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">YELLOW=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[1;33m"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">BLUE=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[0;34m"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VIOLET=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[0;35m"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">CYAN=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[0;36m"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">WHITE=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\\</span>033[1;37m"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">NORMAL=<span style="color:#CC0000;">"<span style="color:#000099; font-weight:bold;">\0</span>33[0m"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">comando=<span style="color:#CC0000;">"tail -f /var/log/maillog | grep spamdyke | colorize"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">colorize<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">while read LINE; do</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(TIMEOUT|DENIED_IP_IN_CC_RDNS|DENIED_BLACKLIST_NAME|DENIED_OTHER|DENIED_RBL_MATCH|DENIED_RDNS_MISSING|DENIED_RDNS_RESOLVE|DENIED_GRAYLISTED|DENIED_SENDER_NO_MX)<span style="color:#000099; font-weight:bold;">\ </span>from:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>to:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>origin_ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>origin_rdns:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>auth:<span style="color:#000099; font-weight:bold;">\ </span>(.*)(<span style="color:#000099; font-weight:bold;">\ </span>.*)?"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${NORMAL}${RED}${BASH_REMATCH[6]}${NORMAL} ${WHITE}${BASH_REMATCH[7]}${NORMAL} to: ${VIOLET}${BASH_REMATCH[8]}${NORMAL} from: ${VIOLET}${BASH_REMATCH[9]}${NORMAL} origin_ip: ${CYAN}${BASH_REMATCH[10]}${NORMAL} origin_rdns: ${CYAN}${BASH_REMATCH[11]}${NORMAL} auth: ${WHITE}${BASH_REMATCH[12]}${NORMAL} ${NORMAL}${BASH_REMATCH[13]}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(ALLOWED)<span style="color:#000099; font-weight:bold;">\ </span>from:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>to:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>origin_ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>origin_rdns:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>auth:<span style="color:#000099; font-weight:bold;">\ </span>(.*)(<span style="color:#000099; font-weight:bold;">\ </span>.*)?"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${NORMAL}${GREEN}${BASH_REMATCH[6]}${NORMAL} ${WHITE}${BASH_REMATCH[7]}${NORMAL} to: ${VIOLET}${BASH_REMATCH[8]}${NORMAL} from: ${VIOLET}${BASH_REMATCH[9]}${NORMAL} origin_ip: ${CYAN}${BASH_REMATCH[10]}${NORMAL} origin_rdns: ${CYAN}${BASH_REMATCH[11]}${NORMAL} auth: ${WHITE}${BASH_REMATCH[12]}${NORMAL} ${NORMAL}${BASH_REMATCH[13]}${NORMAL}"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_RBL_MATCH<span style="color:#000099; font-weight:bold;">\ </span>ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>rbl:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_RBL_MATCH${NORMAL} ip: ${CYAN}${BASH_REMATCH[6]}${NORMAL} rbl: ${WHITE}${BASH_REMATCH[7]}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_RDNS_MISSING<span style="color:#000099; font-weight:bold;">\ </span>ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_RDNS_MISSING${NORMAL} ip: ${CYAN}${BASH_REMATCH[6]}${NORMAL}"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_EARLYTALKER<span style="color:#000099; font-weight:bold;">\ </span>delay:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_EARLYTALKER${NORMAL} delay: ${WHITE}${BASH_REMATCH[6]}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_RECIPIENT_WHITELIST<span style="color:#000099; font-weight:bold;">\ </span>recipient:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>file:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\(</span>(.*)<span style="color:#000099; font-weight:bold;">\)</span>"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_RECIPIENT_WHITELIST${NORMAL} recipient: ${VIOLET}${BASH_REMATCH[6]}${NORMAL} file: ${WHITE}${BASH_REMATCH[7]}${NORMAL}(${YELLOW}${BASH_REMATCH[8]}${NORMAL})"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(FILTER_BLACKLIST_NAME|FILTER_WHITELIST_NAME)<span style="color:#000099; font-weight:bold;">\ </span>ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>rdns:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>file:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\(</span>(.*)<span style="color:#000099; font-weight:bold;">\)</span>"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}${BASH_REMATCH[6]}${NORMAL} ip: ${VIOLET}${BASH_REMATCH[7]}${NORMAL} rdns: ${CYAN}${BASH_REMATCH[8]}${NORMAL} file: ${WHITE}${BASH_REMATCH[9]}${NORMAL}(${YELLOW}${BASH_REMATCH[10]}${NORMAL})"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_WHITELIST_IP<span style="color:#000099; font-weight:bold;">\ </span>ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>file:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\(</span>(.*)<span style="color:#000099; font-weight:bold;">\)</span>"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_WHITELIST_IP${NORMAL} ip: ${VIOLET}${BASH_REMATCH[6]}${NORMAL} file: ${WHITE}${BASH_REMATCH[7]}${NORMAL}(${YELLOW}${BASH_REMATCH[8]}${NORMAL})"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_SENDER_NO_MX<span style="color:#000099; font-weight:bold;">\ </span>domain:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_SENDER_NO_MX${NORMAL} domain: ${VIOLET}${BASH_REMATCH[6]}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_GRAYLISTED<span style="color:#000099; font-weight:bold;">\ </span>sender:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>recipient:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>path:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_GRAYLISTED${NORMAL} sender: ${VIOLET}${BASH_REMATCH[6]}${NORMAL} recipient: ${VIOLET}${BASH_REMATCH[7]}${NORMAL} path: ${WHITE}${BASH_REMATCH[8]}${NORMAL}"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>FILTER_OTHER:<span style="color:#000099; font-weight:bold;">\ </span>response:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}FILTER_OTHER:${NORMAL} response: ${WHITE}${BASH_REMATCH[6]}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>DENIED_BLACKLIST_NAME:<span style="color:#000099; font-weight:bold;">\ </span>response:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${RED}DENIED_BLACKLIST_NAME:${NORMAL} response: ${WHITE}${BASH_REMATCH[6]}${NORMAL}"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(FILTER_RDNS_RESOLVE|FILTER_IP_IN_CC_RDNS)<span style="color:#000099; font-weight:bold;">\ </span>ip:<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>rdns:<span style="color:#000099; font-weight:bold;">\ </span>(.*)"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${YELLOW}${BASH_REMATCH[6]}${NORMAL} ip: ${VIOLET}${BASH_REMATCH[7]}${NORMAL} rdns: ${WHITE}${BASH_REMATCH[8]}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">elif <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span> $LINE =~ <span style="color:#CC0000;">"(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>(.*)<span style="color:#000099; font-weight:bold;">\ </span>ERROR"</span> <span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>; then</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${NORMAL}${BASH_REMATCH[1]} ${BASH_REMATCH[2]} ${BASH_REMATCH[3]}: ${RED}ERROR${NORMAL} sender: ${VIOLET}${BASH_REMATCH[6]}${NORMAL} recipient: ${VIOLET}${BASH_REMATCH[7]}${NORMAL} path: ${WHITE}${BASH_REMATCH[8]}${NORMAL}"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">else</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">echo -e <span style="color:#CC0000;">"${CYAN}FIXME${NORMAL} ${YELLOW}${LINE}${NORMAL}"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fi</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">done</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">eval $comando </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2009/08/11/logparser-script-para-colorir-o-log-do-spamdyke/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrando o servidor de E-mail</title>
		<link>http://thiago.oxente.org/2009/02/17/migrando-o-servidor-de-e-mail</link>
		<comments>http://thiago.oxente.org/2009/02/17/migrando-o-servidor-de-e-mail#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:29:13 +0000</pubDate>
		<dc:creator>Thiago Melo</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[Redes]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[courier]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[dspam]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[imapsync]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[vpopmail]]></category>
		<category><![CDATA[webmail]]></category>

		<guid isPermaLink="false">http://thiago.oxente.org/?p=113</guid>
		<description><![CDATA[Em Janeiro eu tive uma missão aqui no trabalho, que era de migrar uma velha estrutura de e-mail para uma nova e mais segura.  Antes foi retratar como foram as migrações passadas e de quantas estruturas passei até chegar nessa ultima que provavelmente foi a reta final para mim como administrador do sistema de e-mail [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-114" title="email" src="http://thiago.oxente.org/wp-content/uploads/2009/02/email.jpg" alt="email" width="123" height="123" />Em Janeiro eu tive uma missão aqui no trabalho, que era de migrar uma velha estrutura de e-mail para uma nova e mais segura.  Antes foi retratar como foram as migrações passadas e de quantas estruturas passei até chegar nessa ultima que provavelmente foi a reta final para mim como administrador do sistema de e-mail da empresa.</p>
<p>Quando eu fui contratado em 2005 eu encontrei um cenário não muito animador, que era:<br />
- Dois servidores COMPAQ ML370 G1 (P3 + 256Mb Ram cada)<br />
- Um desktop montado (Celeron + 128Mb Ram)<br />
Nessa estrutura rodava hospedagem de sites (Apache+PHP+Mysql) e servidor de e-mail (Postfix+Cyrus+Horde), só que a estrutura era muito bagunçada, foi feita por um funcionário que já havia saido da empresa a muito tempo e era alvo de constantes invasões e ataques.<br />
Para mudar esse cenário eu então peguei o equipamento que tinha, e refiz toda a estrutura, e um dos ML370 eu coloquei a parte de hospedagem web (APACHE+PHP+MYSQL) usando bastante restrição no php.ini principalmente a diretiva open_basedir para restringir cada virtualhost em seu diretório, e outros paramentos que eliminou de vez as invasões.</p>
<p>No cenário de E-mail eu resolvi radicalizar e mudar quase tudo, de Postfix eu mudei para a combinação de Qmail+Vpopmail e o Cyrus foi mudado para o Courier. No final das contas eu consegui migrar todas as contas do Postfix para o Qmail usando alguns scripts que encontrei na internet, somente as mensagens que não migrei, pois a estrutura antiga não tinha sistema de quota e a nova eu coloquei quota, com isso não dava para migrar as mensagens pois todo mundo iria ficar "overquota", mesmo assim foi dado um prazo para cada usuário fazer backup das mensagens.</p>
<p>[Vou dividir o post pois o texto é grande]</p>
<p><span id="more-113"></span><br />
Este novo cenário de e-mail permaneceu por muito tempo, estavel e sem problemas graves, porem foi apresentado um novo projeto para o cenário de e-mail aqui na empresa, na qual eu não faço parte, foi-se então adotado o <a href="http://www.expressolivre.org" target="_blank">Expresso Livre</a>, que trata-se de uma combinação do (<a href="http://www.egroupware.org/" target="_blank">E-groupware</a> + Postfix + Cyrus + Ldap), é um software livre brasileiro, e está sendo adotado por muitas empresas do setor publico e privado.</p>
<p>Eu estava com alguns planos e ideias de melhorar a estrutura que eu tinha criado quando cheguei aqui, porem com esse novo projeto aprovado eu desisti e larguei meu "filho", só mantendo as atualizações em dia, e dando suporte enquanto o sistema migrava para o Expresso.</p>
<p>Nesse meio tempo minha estrutura estava sobrecarregada, e com isso eu ganhei um servidor novo, um HP ML350 G4, com processador Xeon 2GHZ e 2GB de RAM, isso serviu bastante e deixou o sistema mais leve, porém ainda não era a estrutura ideal, ter apenas uma maquina "bombril" com mil e uma utilidades não é o certo. Essa maquina recebia e enviava e-mails, verificava as mensagens com antivírus e antispam, hospedava o webmail e guardava as mensagens em disco. O certo seria dividir essas tarefas em servidores diferentes, porem todo hardware novo que chegava era destinado a estrutura do expresso, que já estava funcionando com 1 domínio de 500 contas, contra 98 domínios com na media de 600 contas cada na minha estrutura.</p>
<p>O Projeto do Expresso estava muito lento, a migração demorava seculos para por um domínio, cada domínio passava por uma burocracia enorme, pois o expresso tinha um grande problema, primeiro a nova politica de que os e-mails deveriam ser nome.sobrenome@dominio e outra que o Expresso não suporta nomes iguais, como por exemplo joao.silva@dominio.com e joao.silva@outrodominio.com para ele joao.silva é uma pessoa só e isso estava gerando muita confusão, pois entre as milhares de contas de e-mails existentes o que mais vai ter é colisão de nome.<br />
Na minha estrutura como eu uso Vpopmail, joao.silva@dominio.com é diferente de  joao.silva@outrodominio.com, assim eu poderia ter quantas pessoas com o mesmo nome pois o login no vpopmail conta com todo o endereço e não apenas o que vem antes da arroba (@).</p>
<p>Em um dia negro minha estrutura deu um problema grave no HD, as fitas de backup já não suportavam o tamanho do backup que era de 60gigas e as fitas so tinham 40gb, foi um dia péssimo, eu passei uma semana inteira tentando recuperar os dados, e ainda bem que no final das contas tudo voltou ao normal, porem nesse dia eu pedi para meu chefe um investimento na estrutura antiga, já que o expresso não ia para frente. Com isso eu ganhei duas HP DL360 G5 com XEON quadcore e 4GB Ram, e ainda mais ligada ao nosso cluster podendo usar a Library para backup.</p>
<p>Com esse equipamento eu resolvi então montar uma estrutura dividida e mais organizada. Meu projeto então foi:<br />
- Em uma DL360 ficaria o MTA, com Qmail + Clamav + DSPAM unicamente com a função de receber e enviar e-mail, filtrar e etc.<br />
- Em uma DL360 ficaria os e-mails com Vpopmail e dessa vez eu não optei em usar o Courier e sim o <a href="http://www.dovecot.org/" target="_blank">Dovecot</a> no lugar dele.<br />
- Em uma maquina virtual no cluster ficaria o webmail.</p>
<p>A estrutura seria mais ou menos assim:<br />
<strong>[INTERNET] &lt;===e-mail===&gt; [MTA COM FILTROS] &lt;===e-mail===&gt; [MAILSTORAGE] &lt;===e-mail===&gt; [USUARIO]</strong></p>
<p><strong>1. MTA</strong><br />
O MTA é o servidor que vai receber as mensagens pela internet, e ele também vai enviar as mensagens enviadas pelo usuário da rede, pelo o que eu notei na estrutura antiga em horário de pico o processo do qmail-smtpd fica mais lento, por causa dos filtros e com isso ele deixava a maquina toda mais lenta, comprometendo o IMAP e o APACHE (Webmail) mas isso era devido a filtragem de Spam que consumia bastante memoria (eu usava Spamassassin).<br />
No MTA eu coloquei o Qmail (netqmail) com todos os patchs, e coloquei o Simscan no lugar do qmail-scanner.pl para gerenciar a filtragem de e-mail, o Simscan é compatível com o clamav e com o DSPAM e eu escolhi ambos para a filtragem de Virus e Spam. E nela eu coloquei as regras de smtproute, para que o MTA enviasse as mensagens dos meus domínios para meu outro servidor que eu chamo de MAILSTORAGE.</p>
<p><strong>Programas utilizados:</strong><br />
clamav-0.94.2 =&gt; antivírus<br />
daemontools-0.76 =&gt; supervisor do qmail<br />
dspam-3.8.0 = &gt; antispam<br />
mod_auth_imap2 = &gt; autenticação do apache via imap ou pop<br />
netqmail-1.06 =&gt; qmail atualizado com patchs<br />
simscan-1.4.0 =&gt; scanner para qmail<br />
ucspi-tcp-0.88 =&gt; tcptools para o qmail</p>
<p><strong>2. MAILSTORAGE</strong><br />
Este servidor é no caso o mais importante, ele vai guardas as mensagens dos usuários e ser acessado via IMAP ou POP usando SSL ou não, mas para que ele possa receber mensagens ele precisa também ser um MTA. Porem o MTA deve ser mais simples e rápido, ele já vai receber as mensagens filtradas e so tem o papel de gravar no disco o que receber. Com isso nessa maquina eu também uso o Qmail, porem sem filtros apenas com os patchs, esse qmail recebe os e-mails do qmail do MTA através do smtproute.</p>
<p>Esta estrutura usa o vpopmail para guardar os e-mails, eu costumo usar o Vpopmail pela sua estrutura de diretórios, ele usa Maildir, e diferencia um usuário do outro através do domínio, impedindo de existir conflito entre dois usuários de mesmo nome. Outra mudança que teve foi o servidor de IMAP/POP. Na estrutura antiga eu usava o Courier-IMAP. Eu tive muitos problemas com ele, principalmente de contas travando, loop infinitos, e eu fiquei sem poder atualizar o courier pois eles tiraram o suporte a Vpopmail, com isso eu fui tentar o Cyrus, mas no meio do caminho encontrei o Dovecot, e depois de ler bastante a respeito resolvi testar, e vi que o Dovecot é 10x melhor que o Courier.</p>
<p><strong>Programas utilizados:<br />
</strong>autorespond-2.0.2 =&gt; Progama usado pelo qmail para auto resposta de mensagens<strong><br />
</strong>daemontools-0.76 = &gt; Supervisor do qmail<br />
dovecot-1.1.7 =&gt; Servidor IMAP/POP3<br />
ezmlm-idx-5.1.2 =&gt; Programa de lista de e-mails<br />
imapsync-1.267 =&gt; Programa usado para a migração, sincronizar as contas<br />
maildrop-2.0.4 = &gt; Usado pelo qmail para entregar as mensagens<br />
netqmail-1.06 =&gt; MTA atualizado com os patchs + Patch Checkuser.<br />
qmailadmin-1.2.12 =&gt; Gerencia das contas<br />
ucspi-tcp-0.88 =&gt; Tcptools usado pelo qmail<br />
vpopmail-5.4.25 =&gt; Suporte a dominios virtuais ao qmail.<strong></strong></p>
<p><strong>3. WEBMAIL<br />
</strong>O webmail foi colocado em uma maquina virtual, no nosso cluster VMware. Nela roda apenas o apache+php+mysql e o Horde Groupware (Webmail Edition). Sendo uma maquina virtual separada a performance do webmail melhorou 100%, o webmail se conecta com o MAILSTORAGE para autenticar e ler as mensagens dos usuários e com o MTA para enviar mensagens.</p>
<p>Todas as três maquinas incluindo a virtual usam <a href="http://slackware.com/" target="_blank">Slackware </a>12.2 como sistema operacional.</p>
<p><strong>4. A MIGRAÇÃO</strong><br />
O processo de migração foi feito nas seguintes etapas:</p>
<ul>
<li> Instalações dos sistemas operacionais e programas nos novos servidores</li>
<li> Backup do banco de dados do vpopmail</li>
<li> Criação dos scriptsde migração</li>
<li> Criar os domínios no novo servidor</li>
<li> Criar as novas contas no novo servidor usando uma senha padrão</li>
<li> Atualizar a quota dos usuários criados no novo servidor</li>
<li> Salvar a senha dos usuários no servidor antigo, para que sejam atualizadas no novo servidor</li>
<li> Mudar a senha dos usuários no servidor antigo para uma senha padrão de forma que o possa se fazer o login na conta e migrar as mensagens.</li>
<li> Limpar o lixo das contas como mensagens excluídas e spam para facilitar a migração, usando o "comando_do_demonio" (Um script que criei que verificar o lixo nas contas e apaga, mensagens excluídas e spam).</li>
<li> Migrar as mensagens para o novo servidor usando o ImapSync</li>
<li> Atualizar as senhas no novo servidor usando as senhas salvas no servidor antigo.</li>
<li> Alterar o servidor de login nas configurações do webmail para que o webmail conecte no novo servidor.</li>
<li> Efetuar testes de login</li>
<li> Configurar o Backup do novo servidor</li>
<li> Alterar os IPS do servidor antigo com o novo.</li>
</ul>
<p><strong>5. CONCLUSÃO</strong><br />
A migração foi um sucesso, e agora eu tenho 3 servidores para a estrutura, onde posso parar e trabalhar com cada um sem interferir no outro, posso para o webmail sem parar o acesso pop/imap3, posso parar o MTA mas os usuários podem ainda acessar as mensagens, e por ai vai. A performance melhorou 100%, e agora tenho backup em fitas de 800GB com mais segurança para os dados.<br />
O DSPAM ainda não funciona muito bem, pois tem um esquema de treinar ele, e ainda estou coletando os spams reportado pelos usuários para treina-lo.<br />
Enquanto o Expresso não anda pra frente minha estrutura nova agora pode aguentar por muito tempo.</p>
<p>Se você tiver algum interesse nas configurações que usei na estrutura, parametros de compilação ou scripts de migração, comenta ai que eu envio.</p>
]]></content:encoded>
			<wfw:commentRss>http://thiago.oxente.org/2009/02/17/migrando-o-servidor-de-e-mail/feed</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>
