Postfix com Courier (Maildir)

Pacotes

  • courier-authdaemon
  • courier-authlib
  • courier-base
  • courier-imap
  • courier-pop
root@debian:~# aptitude install <pacotes>

Criar diretórios para a administração baseada na Web ? <Não>

Ajustes no Postfix

Aqui precisamos configurar o Postfix para aceitar o modelo Maildir.

root@debian:~# vi /etc/postfix/main.cf

[...]
home_mailbox = Maildir/
#mail_spool_directory = /var/mail

mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir/
[...]

Ajustes na PAM

Precisamos ajustar a PAM para autenticar no sistema. Primeiro renomeamos os arquivos originais.

root@debian:~# mv /etc/pam.d/pop3 /etc/pam.d/pop3.bkp
root@debian:~# mv /etc/pam.d/imap /etc/pam.d/imap.bkp

Em seguida, crie os arquivos a seguir com os respectivos conteúdos.

root@debian:~# vi /etc/pam.d/pop3

@include common-auth
@include common-account
@include common-password
@include common-session
root@debian:~# vi /etc/pam.d/imap

@include common-auth
@include common-account
@include common-password
@include common-session
root@debian:~# vi /etc/pam.d/smtp

@include common-auth
@include common-account
@include common-password
@include common-session

Reiniciando os serviços

Por fim, reinicie os serviços.

root@debian:~# /etc/init.d/courier-authdaemon stop
root@debian:~# /etc/init.d/courier-authdaemon start

root@debian:~# /etc/init.d/courier-pop stop
root@debian:~# /etc/init.d/courier-pop start

root@debian:~# /etc/init.d/courier-imap stop
root@debian:~# /etc/init.d/courier-imap start

Criando o Maildir

Precisamos também criar o Maildir (Caixa Postal) do usuário.

root@debian:~# maildirmake ~usuario/Maildir
root@debian:~# maildirmake ~usuario/Maildir/.Enviadas
root@debian:~# maildirmake ~usuario/Maildir/.Rascunho
root@debian:~# maildirmake ~usuario/Maildir/.Lixeira
root@debian:~# maildirmake ~usuario/Maildir/.Spam
root@debian:~# maildirmake -q 104857600S ~usuario/Maildir
root@debian:~# chown -R usuario.grupo ~usuario

Testando a porta POP

root@debian:~# telnet localhost 110

Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
+OK Hello there.
user usuario
+OK Password required.
pass senha
+OK logged in.
quit
+OK Bye-bye.
Connection closed by foreign host.

Testando a porta IMAP

root@debian:~# telnet localhost 143

Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.
a login usuario senha
a OK LOGIN Ok.
a logout
* BYE Courier-IMAP server shutting down
a OK LOGOUT completed
Connection closed by foreign host.



Voltar

linux/artigos/smtp-postfix-courier-maildir.txt · Última modificação: 13/01/2015 10:44 (edição externa)