c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen#!/bin/sh
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
5897c88bde1d9df7db22561bcb7658664fc1e2f3Timo Sirainendirector_count=10
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho "Add to /etc/hosts:"
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
b9c9b81ba90865a523b45633b32096fd89e75548Timo Sirainencurpath=`pwd`
b9c9b81ba90865a523b45633b32096fd89e75548Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenhosts=""
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainendirs=""
c7ef509503bb102a5e43b7188f7df1f171448142Timo Siraineni=0
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenwhile [ $i != $director_count ]; do
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen i=`expr $i + 1`
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen dirs="$dirs 127.0.1.$i"
15ab2452b0220a115f4351ad9d7fd5ec70ae7966Timo Sirainen echo "127.0.1.$i director"
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen cat > dovecot-director$i.conf <<EOF
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenlisten = 127.0.1.$i
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenbase_dir = /var/run/dovecot$i
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen!include dovecot-director-common.conf.inc
c7ef509503bb102a5e43b7188f7df1f171448142Timo SirainenEOF
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainendone
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainencat > dovecot-director-common.conf.inc <<EOF
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenlog_path = /var/log/dovecot.log
5897c88bde1d9df7db22561bcb7658664fc1e2f3Timo Siraineninfo_log_path = /var/log/dovecot-info.log
5897c88bde1d9df7db22561bcb7658664fc1e2f3Timo Sirainenlog_timestamp = "%b %d %H:%M:%S.%{usecs} "
5897c88bde1d9df7db22561bcb7658664fc1e2f3Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainendirector_servers =$dirs
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainendirector_mail_servers = 127.0.0.1-127.0.0.255
c9b3bbfb605ca19fbd39d083984241b2419e9fe1Timo Sirainendirector_user_expire = 15s
15ab2452b0220a115f4351ad9d7fd5ec70ae7966Timo Sirainendisable_plaintext_auth = no
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenssl = no
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenservice director {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen executable = director -D -t 9091
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen user = root
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen unix_listener login/director {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen mode = 0666
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen }
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen fifo_listener login/proxy-notify {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen mode = 0666
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen }
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen inet_listener {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen port = 9090
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen }
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen}
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenservice imap-login {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen executable = imap-login -D director
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen service_count = 0
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen}
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenpassdb {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen driver = static
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen args = proxy=y nopassword=y port=14300
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen}
c7ef509503bb102a5e43b7188f7df1f171448142Timo SirainenEOF
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainencat > dovecot-test.conf <<EOF
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenprotocols = imap
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenssl = no
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenlog_path = /var/log/dovecot.log
c7ef509503bb102a5e43b7188f7df1f171448142Timo Siraineninfo_log_path = /var/log/dovecot-access.log
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenservice imap-login {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen inet_listener imap {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen port = 0
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen }
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen}
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenservice director-test {
b9c9b81ba90865a523b45633b32096fd89e75548Timo Sirainen executable = $curpath/director-test /var/run/dovecot1/director-admin
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen process_limit = 1
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen inet_listener {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen port = 14300
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen }
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen inet_listener {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen port = 9091
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen }
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen}
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenpassdb {
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen driver = static
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen args = nopassword=y
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen}
c7ef509503bb102a5e43b7188f7df1f171448142Timo SirainenEOF
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainen
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho "Start up dovecot instances:"
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainenecho 'for conf in dovecot*.conf; do dovecot -c $conf; done'
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho "Start testing:"
c7ef509503bb102a5e43b7188f7df1f171448142Timo Sirainenecho
c9b3bbfb605ca19fbd39d083984241b2419e9fe1Timo Sirainenecho "imaptest host=director user=test%d.%d - select=0 no_tracking clients=1000"