#! /usr/bin/bash -w
#
# mark edwards – 2008-01-10
#
#
# script to get dovecot working, from start to finish
#
# assumptions:
# 1) the gnu ‘compiler collection’ libraries and utilities are indeed installed
# 2) the IMAP server is NOT installed
# 3) you have your own dedicated IP number
# 4) you created a user mail account
# 5) you have created a ‘dovecot’ mail account
#
#
MAINUSERNAME=‘yourloginname’;## your main login name of the account
MAILNAME=‘myuser’; ## a predefined user you want to give
- access to
MAILPASSWD=‘mypass’; ## user password
DOVECOT_VERSION=‘1.0.10’; ## this version
PATH=$PATH:/usr/local/sbin ; #
mkdir dovecot;
cd dovecot; # # first, grab dovecot: #
wget http://www.dovecot.org/releases/1.0/dovecot-${DOVECOT_VERSION}.tar.gz ; # # unpack it, unzip iet, etc, etc: #
gzip
cd ./dovecot-${DOVECOT_VERSION} ; # #
./configure ; # #
make && make install ; # # # grab the default configuration file, tweak it, and put it # in the directory #
sed -e “
48 s/#disable_plaintext_auth = yes/disable_plaintext_auth = no/;
88 s/#ssl_disable = no/ssl_disable = yes/;
135 s/#login_chroot = yes/login_chroot = no/;
141 s/#login_user = dovecot/login_user = dovecot/;
776 s/#passdb passwd-file {/passdb passwd-file {/;
778 s?#args = /etc/dovecot.deny?args = /etc/passwd.dovecot?;
780 s/^ #}/ }/;
788 s/passdb pam {/#passwd pam {/;
821 s/^ }/ #}/;
952 s/user = root/user = ${MAINUSERNAME}/;
“ \
< ./dovecot-example.conf \
> /usr/local/etc/dovecot.conf ; # # # create the /etc/passwd.covecot file: #
echo ${MAILNAME} ‘:’ $(/etc/local/sbin/dovecotpw -p ${MAILPASSWD} ) \ | sed -e ‘s/\s//’ \
> /etc/passwd.dovecot ; # # # start dovecot! #
dovecot; ## # # # make sure its running #
ps -ef | grep dovecot ; # #
- to test: # telnet localhost 143 # 1 login username password #
- telnet 208.131.130.227 143 # 1 login username password # # make uninstall ; ## to remove it!