Dovecot 서버

Dovecot 은 보안 우선을 염두에 두고 쓰여진 Mail Delivery Agent 입니다. 이것은 mbox 와 Maildir 같은 주요 메일박스 형식을 지원 합니다. 이 영역은 imap 또는 pop3 서버로서 Dovecot을 어떻게 설정하는 지를 설명 합니다.

설치

dovecot 설치하기 위하여, 명령 프롬프트에서 다음 명령을 실행 합니다:

sudo apt-get install dovecot-common dovecot-imapd dovecot-pop3d

설정

dovecot을 설정하기 위하여, /etc/dovecot/dovecot.conf 파일을 편집할 수 있습니다. 여러분이 사용하고자 하는 프로토콜을 선택할 수 있고, 그것은 pop3, pop3s (pop3 secure), imap 그리고 imaps (imap secure)이 될 수 있습니다. 이 프로토콜에 대한 설명은 이 안내서의 범위 밖 입니다. 더 많은 정보는, wikipedia의 다음 글을, POP3IMAP, 참고 하십시오.

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.

여러분의 메일박스 종류를 선택한 후, /etc/dovecot/dovecot.conf 파일을 편집하기 위하여 열고 다음 줄을 변경 합니다:

mail_location = maildir:~/Maildir # (for maildir)
or
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u # (for mbox)
[참고]

만약 이전에 설정한 것과 메일박스 형식이 다르다면 여러분은 이 형식으로 수신된 메일을 전달하기 위해 Mail Transport Agent (MTA)를 설정해야 합니다.

dovecot을 설정하고 난 후, 설정을 확인하기 위해 dovecot 대몬을 실행시킵니다:

          
            sudo /etc/init.d/dovecot start
          
        

만약 imap이나 pop3를 활성화 시켜 두었다면 telnet localhost pop3 혹은 telnet localhost imap2 명령을 사용하여 로그인을 시도해 볼 수도 있습니다. 만약 다음과 같은 내용이 보인다면, 설치가 성공적으로 이루어진 것입니다:

bhuvan@rainbow:~$ telnet localhost pop3
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK Dovecot ready.

Dovecot SSL 설정

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 “자가-사인 인증서 만들기” 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.

이메일 서버를 위한 방화벽 설정

다른 컴퓨터에서 메일 서버를 접근하려면, 필요한 포트로 서버로의 접속을 허용하도록 방화벽을 반드시 설정해야만 합니다.

  • IMAP - 143

  • IMAPS - 993

  • POP3 - 110

  • POP3S - 995