hi all and eric

thanks very much for you help especially you eric, i was able to do a
successful migration from courier to dovecot.

i changed over from courier to dovecot a few weeks ago.

i am very satisfied with the same. With courier my webmail was causing
quite a bit of load on my server which reduced dramatically after i
changed over to dovecot. my clients are very very happy

here is the report on the same for those using qmail toaster on a centos
machine.

all comments are welcome

my machine

dual core dual xeon, 2.33 ghz processors with 4 gb ram
centos 5

i am using only the IMAP section of dovecot and not the pop3 part

i first tested out the installation on a identical trial machine before i
installed this on my production server

here are the steps

These steps are such that you can install and check out dovecot without
having to remove your existing courier imap server of qmailtoaster ie a
totally worry-free installation. If something wrong happens you can always
go back to courier imap.

to be absolutely safe i decided that i will install dovecot but will not
run it on port 143 and port 993  initially till my tests were complete. i
chose a random port for testing purpose example imap - 11143 for normal
imap imaps - 11993 for secure imap. Once my tests were complete i moved to
the standard ports port 143 and port 993 later on as you will see below


installation steps

1) you will need a test email id and password for squirrelmail using
courier imap
login to webmail and create a few folders under inbox / sent / drafts
other than the default folders via webmail. this is required for testing

2) download the dovecot rpm
cd /usr/src/qtms-install
wget http://dl.atrpms.net/all/dovecot-1.2.11-3_108.src.rpm

Install these rpms (i got an error during installation process that these
are required)
yum install gettext-devel
yum install pam-devel
yum install libcap-devel
yum install postgresql-devel

3) rpm -i dovecot-1.2.11-3_108.src.rpm
cd /usr/src/redhat/SPECS
nano dovecot.spec

4) now you need to edit the dovecot.spec
search for line
--disable-static \
below that enter
--with-vpopmail \

5) build the rpm
rpmbuild -ba --target=i686 dovecot.spec

6) rpmbuild -ba --target=i686 dovecot.spec
now the build was successful

7) cd /usr/src/redhat/RPMS/i686
rpm -Uvh /usr/src/redhat/RPMS/i686/dovecot-1.2.11-3_108.i686.rpm

8) editing the dovecot.conf file
cd /etc
first backup the original file
cp -p dovecot.conf to dovecot.conf.bak

please see the dovecot.conf file below use this as you feel. this works
for me

#######################################
## Dovecot configuration file

# Base directory where to store runtime data.
base_dir = /var/run/dovecot/

# Protocols we want to be serving: imap imaps pop3 pop3s
# If you only want to use dovecot-auth, you can set this to "none".
protocols = imap imaps

##
## Logging
##
log_path = /backup1/qmaillog/dovecot.log

##
## SSL settings
##
#ssl_disable = no
ssl_cert_file = /var/qmail/control/servercert.pem
ssl_key_file = /var/qmail/control/servercert.pem
ssl_cipher_list = ALL:!LOW
verbose_ssl = yes


##### Change the ports below to 143 and 993 after testing
##### Make sure that these are open in your firewall for remote testing

protocol imap {
listen = *:11143
ssl_listen = *:11993
        }

## Login processes
##
#login_dir = /usr/local/var/run/dovecot/login
login_user = dovecot
login_process_per_connection = no
login_processes_count = 3
login_process_size = 128
login_max_processes_count = 512
login_greeting = Ready
#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c

##
## Mailbox locations and namespaces
##
mail_location = maildir:~/Maildir
namespace private {

    separator = .
    prefix = INBOX.
    inbox = yes

}

##
## Mail processes
##
verbose_proctitle = yes
first_valid_uid = 89
last_valid_uid = 89

# Maximum number of running mail processes. When this limit is reached, #
new users aren't allowed to log in.
max_mail_processes = 200

# Set max. process size in megabytes. Most of the memory goes to mmap()ing
# files, so it shouldn't harm much even if this limit is set pretty high.
mail_process_size = 256


## Maildir-specific settings

## Authentication processes

disable_plaintext_auth = no
auth default {
    mechanisms = plain login digest-md5 cram-md5
    passdb vpopmail {
        args = webmail=127.0.0.1
    }
    userdb vpopmail {
    }
    user = vpopmail
    count = 1
    ssl_require_client_cert = no
    }

#########################################


9) now start dovecot
service dovecot start

10) edit your squirrelmail config file so that in the server settings you
put port 11143 and dovecot as imap server

11) you should be able to login on the port 11143
But you will note that the folders created in step 1 above is not seen.
this is because the courier imap subscribe folders are not yet converted.

10) compose a few emails and send out the same using webmail.


now that you have enabled dovecot successfully you can take the steps
necessary for changing over to use the imap of the dovecot and stop the
imap of courier

11) to disable courier execute the commands below
when you stop and restart qmail.
imap and imapssl service of courier will not be started

touch /var/qmail/supervise/imap4/down
touch /var/qmail/supervise/imap4/log/down
touch /var/qmail/supervise/imap4-ssl/down
touch /var/qmail/supervise/imap4-ssl/log/down

chown vpopmail.vchkpw /var/qmail/supervise/imap4/down
chown vpopmail.vchkpw  /var/qmail/supervise/imap4/log/down
chown vpopmail.vchkpw  /var/qmail/supervise/imap4-ssl/down
chown vpopmail.vchkpw  /var/qmail/supervise/imap4-ssl/log/down


12) convert your courier imap files to dovecot files
(more information on http://wiki.dovecot.org/Migration/Courier)

for this download
http://www.dovecot.org/tools/courier-dovecot-migrate.pl

this will check your migration. conversion WILL NOT TAKE PLACE
perl courier-dovecot-migrate.pl --to-dovecot --recursive --overwrite
/home/vpopmail/domains > result.txt

this will carry out CONVERSION
perl courier-dovecot-migrate.pl --to-dovecot --recursive --overwrite
--convert /home/vpopmail/domains


13) change your /etc/dovecot.conf ports
11143 to 143 and 11993 to 993
(see above dovecot.conf file)

14) Stop and restart qmail
qmailctl stop
qmailctl start

15) dovecot
service dovecot start

16) telnet 127.0.0.1 143
you should get answer like this
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE
STARTTLS AUTH=PLAIN AUTH=LOGIN AUTH=DIGEST-MD5 AUTH=CRAM-MD5] Ready
similarly telnet your server ip from external locations outside your
server on port 143 and 993

note that the last word is "Ready" since that is what i have mentioned in
the dovecot.conf file above -- login_greeting = Ready which shows that
dovecot is ready and listenting on port 143

17) edit your webmail ie squirrelmail details to use 127.0.0.1, port 143
login and check. Now you will be able view the folders created in step 1
above and give a few final checks.

your imap and imaps with dovecot is now ready for use


rajesh





---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group 
(www.vickersconsulting.com)
    Vickers Consulting Group offers Qmailtoaster support and installations.
      If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
     Please visit qmailtoaster.com for the latest news, updates, and packages.
     
      To unsubscribe, e-mail: [email protected]
     For additional commands, e-mail: [email protected]


Reply via email to