O Dovecot é um Agente de Entrega de Correio, escrito tendo em mente a segurança em primeiro lugar. Ele suporta os principais formatos de caixas postais: mbox ou Maildir. Essa seção explica como configurá-lo como um servidor imap ou pop3.
Para instalar o dovecot, rode o seguinte comando em um prompt de comando:
sudo apt-get install dovecot-common dovecot-imapd dovecot-pop3d
Para configurar o dovecot, você pode editar o arquivo /etc/dovecot/dovecot.conf
. Você pode escolher o protocolo que você usa. Ele pode ser pop3, pop3s (pop3 seguro), imap e imaps (imap seguro). Uma descrição desses protocolos está além do escopo desse guia. Para maiores informações, consulte os artigos da wikipedia em POP3 e IMAP.
IMAPS and POP3S are more secure that the simple IMAP and
POP3 because they use SSL encryption to connect. Once you
have chosen the protocol, amend the following line in the file
/etc/dovecot/dovecot.conf
:
protocols = pop3 pop3s imap imaps
It enables the protocols when dovecot is started. Next, add the following line in the pop3 section of the file /etc/dovecot/dovecot.conf
:
pop3_uidl_format = %08Xu%08Xv
Next, choose the mailbox you use. Dovecot supports maildir and mbox formats. These are the most commonly used mailbox formats. They both have their own benefits and they are discussed on the dovecot website.
Após escolhido o seu tipo de caixa de e-mail, edite o arquivo /etc/dovecot/dovecot.conf
e modifique a seguinte linha:
mail_location = maildir:~/Maildir # (for maildir) or mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)
![]() |
|
Você deverá configurar seu Agente de Transporte de Email (Mail Transport Agent - MTA) para transferir os e-mails de entrada para esse tipo de caixa de e-mail se ele estiver diferente do que você configurou. |
Depois de ter configurado o dovecot, inicie o servidor dovecot para testar sua instalação:
sudo /etc/init.d/dovecot start
se você tiver habilitado o imap, ou pop3, você pode também tentar abrir uma conexão com os comandos telnet localhost pop3 ou telnet localhost imap2. Se você ver algo como o seguinte, a instalação foi feita com sucesso:
bhuvan@rainbow:~$ telnet localhost pop3 Trying 127.0.0.1... Connected to localhost.localdomain. Escape character is '^]'. +OK Dovecot ready.
To configure dovecot to use SSL, you can edit the file
/etc/dovecot/dovecot.conf
and amend
following lines:
ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key ssl_disable = no disable_plaintext_auth = no
You can get the SSL certificate from a Certificate Issuing
Authority or you can create self signed SSL certificate. Please
refer to “Criando um certificado Auto-Assinado”
for details about how to create self signed SSL certificate. Once
you create the certificate, you will have a key file and a
certificate file. Please copy them to the location pointed
in the /etc/dovecot/dovecot.conf
configuration file.