Escolar Documentos
Profissional Documentos
Cultura Documentos
Page 1 of 6
P
I
C
O
Instalando o Postfix:
Configurando o Postfix:
Crie 4 arquivos dentro do diretrio /etc/postfix/ com o seguinte contedo:
# mysql_virtual_alias_maps.cf
# ----------------------------user = postfix
password = xxxxx
dbname = postfix
table = alias
select_field = goto
where_field = address
hosts = localhost
# mysql_virtual_mailbox_maps.cf
# -----------------------------user = postfix
password = xxxxx
http://slackware.sites.uol.com.br/slackware/htdocs/instpostfix.htm
14/03/2011
Page 2 of 6
dbname = postfix
table = mailbox
select_field = maildir
where_field = username
hosts = localhost
# mysql_transport_maps.cf
# -------------------------user = postfix
password = xxxxx
hosts = localhost
dbname = postfix
table = domain
select_field = transport
where_field = domain
# mysql_virtual_mailbox_limit_maps.cf
# -----------------------------------user = postfix
password = xxxxx
dbname = postfix
table = mailbox
select_field = quota
where_field = username
hosts = localhost
http://slackware.sites.uol.com.br/slackware/htdocs/instpostfix.htm
14/03/2011
Page 3 of 6
virtual_mailbox_limit_inbox = no
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_extended = yes
virtual_create_maildirsize = yes
virtual_mailbox_limit = 100000000
virtual_maildir_limit_message = "Sorry, the user's maildir has overdrawn his diskspace quota, please try again later."
virtual_overquota_bounce = yes
#====== SASL ================
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
OBS: Essa a configurao bsica desse arquivo, fique vontade para incluir novas implementaes.
Agora hora de testar se o Postfix esta se comunicando com o MySQL.
# newaliases
# postfix start
Precisamos criar um domnio e um usurio para teste. Vamos fazer primeiramente na "mo", fazendo passo a passo para voc
visualizar todo o procedimento de criao de um usurio virtual.
Logue-se como ROOT no MySQL:
# mysql -D postfix -pxxxxx
Criando o Dominio VIRTUAL e LOCAL:
Criando o Usurio:
ATENO: No esquea de escolher uma senha em 'xxxxx'
http://slackware.sites.uol.com.br/slackware/htdocs/instpostfix.htm
14/03/2011
Page 4 of 6
Criando Alias:
mkdir -p /mbox/dominio1.com.br/jeffi
maildirmake /mbox/dominio1.com.br/jeffi/Maildir
chown -R virtual:virtual /mbox/
chmod -R 770 /mbox/
***************************************LOG DO POSTFIX******************************************************
# cat /var/log/maillog
May 25 18:47:19 postfix postfix/pickup[3083]: 945296526: uid=0 from=<root>
May 25 18:47:19 postfix postfix/cleanup[3111]: 945296526: message-id=<0_3119_1211752039_1@postfix>
May 25 18:47:19 postfix postfix/qmgr[3085]: 945296526: from=<root@local.com.br>, size=376, nrcpt=1 (queue active)
May 25 18:47:19 postfix postfix/local[3117]: 945296526: to=<jeffi@local.com.br>, relay=local, delay=0.03,
delays=0.02/0/0/0.01, dsn=2.0.0, status=sent (delivered to maildir)
# ls /home/jeffi/Maildir/new/
1211752196.V302I3b306M538830.postfix
Opa, acho que foi.
# cat /home/jeffi/Maildir/new/1226265992.V802I81c3M693603.postfix
Return-Path: <root@local.com.br>
X-Original-To: jeffi@local.com.br
Delivered-To: jeffi@local.com.br
Received: by postfix.com.br (Postfix, from userid 0)
id 3C6926526; Sun, 25 May 2008 18:41:36 -0300 (BRT)
MIME-Version: 1.0
To: jeffi@local.com.br
Subject: TESTE do POSTFIX
Message-ID: <0_3142_1211752191_1@postfix>
Content-ID: <0_3142_1211752191_2@postfix>
Content-type: text/plain
Date: Sun, 25 May 2008 18:41:36 -0300 (BRT)
From: root@local.com.br
Funcionou...
***************************************LOG DO POSTFIX******************************************************
# cat /var/log/maillog
May 25 18:48:00 postfix postfix/pickup[3083]: 6B15A6526: uid=0 from=<root>
May 25 18:48:00 postfix postfix/cleanup[3111]: 6B15A6526: message-id=<0_3125_1211752080_1@postfix>
May 25 18:48:00 postfix postfix/qmgr[3085]: 6B15A6526: from=<root@local.com.br>, size=379, nrcpt=1 (queue active)
May 25 18:48:00 postfix postfix/virtual[3134]: 6B15A6526: to=<jeffi@dominio1.com.br>, relay=virtual, delay=0.1,
delays=0.06/0.02/0/0.02, dsn=2.0.0, status=sent (delivered to maildir)
http://slackware.sites.uol.com.br/slackware/htdocs/instpostfix.htm
14/03/2011
Page 5 of 6
# ls /mbox/dominio1.com.br/jeffi/Maildir/new
1211752191.V302I334aeM316775.postfix,S\=473
Opa, acho que foi tambm:
# cat /mbox/dominio1.com.br/jeffi/Maildir/new/1211752191.V302I334aeM316775.postfix,S\=473
Return-Path: <root@local.com.br>
X-Original-To: jeffi@dominio1.com.br
Delivered-To: jeffi@dominio1.com.br
Received: by postfix.com.br (Postfix, from userid 0)
id 3C6926526; Sun, 25 May 2008 18:49:51 -0300 (BRT)
MIME-Version: 1.0
To: jeffi@dominio1.com.br
Subject: TESTE do POSTFIX
Message-ID: <0_3142_1211752191_1@postfix>
Content-ID: <0_3142_1211752191_2@postfix>
Content-type: text/plain
Date: Sun, 25 May 2008 18:49:51 -0300 (BRT)
From: root@local.com.br
Funcionou...
, foi!!!!! :-)
Teste de Autenticao do IMAP para conta Local:
# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA
IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2008 Double Precision, Inc. See COPYING for distribution
information.
0 login jeffi xxxxxx
0 OK LOGIN Ok.
0 select inbox
* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
* 1 EXISTS
* 1 RECENT
* OK [UIDVALIDITY 1210698687] Ok
* OK [MYRIGHTS "acdilrsw"] ACL
0 OK [READ-WRITE] Ok
0 logout
* BYE Courier-IMAP server shutting down
0 OK LOGOUT completed
Connection closed by foreign host.
http://slackware.sites.uol.com.br/slackware/htdocs/instpostfix.htm
14/03/2011
Page 6 of 6
Beleza, funcionou!!!
Beleza, funcionou!!!
DICA: Em caso de erro de autenticao, sempre d uma olhada nos logs do MySQL e veja se foi feito e como foi feito o SELECT do
courier. Isso pode ser til para identificar erros no arquivo de configurao do courier.
Um outro problema pode ser no MySQL: ou o servio no esta funcionando ou o usurio no tem permisso de acesso ao banco de
dados.
< ANTERIOR
http://slackware.sites.uol.com.br/slackware/htdocs/instpostfix.htm
PRXIMO >
14/03/2011