Monday, 27 May 2013

How to Install And Deploy IMAP Server

Background

Dovecot is the an imap and pop mail server.

Prerequisite

Installed Postfix MTA/MDA

Objectives

  • Install and deploy Dovecot imap server on Centos 6.4.
  • Configure dovecot such that users will access their email using their system account username and password.
  • Configure an email account in Evolution MUA.

Environment

  • Centos 6.4
  • SELinux is turned on

Procedure

  1. Install dovecot

    #yum install dovecot
  2. Find and read the documentation

    #rpm -qd dovecot
  3. Configure dovecot to authenticate users against their system account username and password.

    #vi /etc/pam.d/dovecot

    Example

    #%PAM-1.0
    auth required pam_unix.so
    account required pam_unix.so
  4. Configure dovecot to accept request from MUA like Evolution and iPhone

    #vi /etc/dovecot/dovecot.conf

    protocols = imap pop3 lmtp
    listen = *, ::
    login_trusted_networks = 192.168.1.0/24,192.168.0.0/24
    mail_location = maildir:~/Maildir
  5. Start dovecot services

    #service dovecot restart
  6. Find the ports that Dovecot is listening on.

    #netstat -tulnp | grep dovecot && grep imap /etc/services
  7. Turn on dovecot automatically

    #chkconfig --level 3 dovecot on
  8. Let imap packets through the firewall

    #iptables -I INPUT 2 -p tcp --dport 143 -m state --state NEW -j ACCEPT
    #service iptables save
  9. Create and activate a user account

    #useradd jarvis
    #passwd jarvis
  10. Check that Maildir is created relative to user's home path

    #ls -ld /home/jarvis/Maildir
  11. Install Evolution MUA

    #yum install evolution
  12. Configure an email account in Evolution using the wizard.

No comments:

Post a Comment