Monday, September 01, 2014

Goodbye UW IMAP! Hello Dovecot! Oracle Solaris 11 setup guide for Dovecot

After many years of being faithful to UW IMAP it was time to move on. The move was required since UW IMAP was no longer being supported and I was having problems using it with latest version of Horde Webmail, so I decided to install Dovecot on our Oracle Solaris 11 systems.

I was surprised how easy the installation went to get Dovecot working on Solaris 11, which was pleasing.

References:
  • Welcome to the Dovecot Wiki
    • http://wiki2.dovecot.org/
  • IMAP server with dovecot
    • http://karellen.blogspot.co.uk/2011/12/imap-server-with-dovecot.html
  • Solaris 10 に Dovecot 2.1 をインストールする方法
    • http://blog.torigoya.net/2012/07/01/solaris10-dovecot

Setup:
# cd /usr/local/src
# gzip -dc /tmp/dovecot-2.2.13.tar.gz | tar xf -
# cd dovecot-2.2.13
  • I am using Solaris Studio, but it works with GCC (# pkg install developer/gcc-45  developer/build/make)
# export PATH=/usr/bin:/usr/sbin:/usr/local/solarisstudio12.3/bin:/usr/local/dovecot2.2.13/bin
# ./configure --prefix=/usr/local/dovecot2.2.13
  •  Couple of local users need to be created which Dovecot uses internally
# groupadd -g 65536 dovecot
# groupadd -g 65537 dovenull
# useradd -u 65536 -S files -s /bin/false -d /dev/null  -g dovecot dovecot
# useradd -u 65537 -S files -s /bin/false -d /dev/null  -g dovenull dovenull
  • Installation and create configuration files
# make
# make install
# cp doc/example-config/dovecot.conf /usr/local/dovecot2.2.13/etc/dovecot
# cp -r doc/example-config/conf.d /usr/local/dovecot2.2.13/etc/dovecot

# cd /usr/local
# ln -s  dovecot2.2.13  dovecot
  • The following settings are changes I have made from default:
  • dovecot.conf
protocols = imap
listen = 193.x.x.x
base_dir = /var/run/dovecot
login_greeting = Dovecot at dcs.bbk.ac.uk
  • 10-logging.conf (Optional: If you want lots of debuuging!)
auth_debug = yes
auth_debug_passwords = yes
mail_debug = yes
verbose_ssl = yes
  • 10-auth.conf (If you want to ENABLE plaintext authentications)
 disable_plaintext_auth = no
  • 10-ssl.conf (Enable SSL and specify certificate location. Not covered here)
ssl = yes
ssl_cert = </etc/mail/certs/imapsd.pem
ssl_key = </etc/mail/certs/sendmail.key
  • 10-mail.conf (may be required: Grant access to these supplementary groups, Valid UID range and make sure I use /var/mail/username)
mail_location = mbox:~/mail:INBOX=/var/mail/%u:INDEX=/var/share/dovecot/index/%1n/%n
mail_access_groups = mail
first_valid_uid =201
namespace compat1 {
  separator = /
  prefix = Mail/
  hidden = yes
  list = no
  alias_for =
}
namespace compat2 {
  separator = /
  prefix = mail/
  hidden = yes
  list = no
  alias_for =
}
  • Location of the index files used by Dovecot. Best to keep these away from user areas and on a local disk)
# zfs create rpool/VARSHARE/dovecot
# zfs set canmount=noauto rpool/VARSHARE/dovecot
# zfs set quota=20G  rpool/VARSHARE/dovecot
# mkdir -p /var/share/dovecot/index

# chmod 755 /var/share/dovecot
# chown dovecot:dovecot /var/share/dovecot
# chmod 777 /var/share/dovecot/index
# chown dovecot:dovecot /var/share/dovecot/index
  • Start Dovecot and fingers crossed!
  • You need to increase the number of Open Files (may be not the best way of doing this!)
# ulimit -S -n 1024
# cd /usr/local/dovecot2.2.13/sbin
# ./dovecot -n

# ./dovecot

No comments:

Post a Comment