[Dovecot] Problem with running two dovecot instances on the same server

2012-07-25 Thread Alexandr Sabitov

Hello All,

Have anyone met the problem I am struggling with at the moment ?
The problem is when I run two instances of dovecot 2.1.8 which are one 
for proxy-director and another one is a regular one on the same server 
then I have big amount of strange entries in the /var/log/mail.err:


Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value 
for director_mail_servers setting
Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: 
service(director): command startup failed, throttling for 60 secs

Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value 
for director_mail_servers setting
Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: 
service(director): command startup failed, throttling for 60 secs


That's for sure  set->director_mail_servers variable in main_preinit of 
./src/director/main.c
But after dumping it it turns out that ppid of the process which failed 
to use main_preinit function is a "regular" dovecot not the proxy one.
When main_preinit is used by dovecot-proxy then 
set->director_mail_servers = ip address of a mail server and it is all good
but if  main_preinit is used by dovecot then set->director_mail_servers 
= empty and I get fatal errors in logs.


So here is a question: How come that "non-proxy" dovecot requests 
director_mail_servers variable and writes fatal error in the logs if it 
doesn't find it ?



Thank you very much for any assistance!

Please find my configs:

DOVECOT:

root@dovecot-test-1:~/software/dovecot/dovecot-2.1.8# 
/usr/local/dovecot/sbin/dovecot -n

# 2.1.8: /usr/local/dovecot/etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.5
auth_mechanisms = plain digest-md5 cram-md5 apop
auth_verbose = yes
base_dir = /var/run/dovecot/
default_internal_user = webmail
disable_plaintext_auth = no
doveadm_password = secret
listen = 192.168.0.42
mail_fsync = always
mail_location = maildir:~/
mail_nfs_index = yes
mail_nfs_storage = yes
mail_plugins = " quota fts fts_solr"
mmap_disable = yes
passdb {
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
plugin {
  fts = solr
  fts_solr = break-imap-search url=http://localhost:8080/solr/
  quota = maildir:User quota
}
service doveadm {
  inet_listener {
port = 8282
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
}
service imap {
  executable = imap
}
service lmtp {
  inet_listener lmtp {
port = 24
  }
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service pop3 {
  executable = pop3
}
ssl_cert = root@dovecot-test-1:~/software/dovecot/dovecot-2.1.8# 
/usr/local/dovecot/sbin/dovecot -c 
/usr/local/dovecot/etc/dovecot/dovecot-proxy.conf -n

# 2.1.8: /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.5
auth_verbose = yes
base_dir = /var/run/dovecot-proxy
default_internal_user = webmail
director_mail_servers = 192.168.0.42
director_servers = 192.168.0.41
disable_plaintext_auth = no
doveadm_password = secret
doveadm_proxy_port = 8282
instance_name = dovecot-proxy
listen = 192.168.0.41
login_greeting = Dovecot Proxy ready.
mail_location = maildir:~/
passdb {
  args = proxy=y  nopassword=y
  driver = static
}
service auth-worker {
  user = webmail
}
service auth {
  client_limit = 2400
}
service director {
  fifo_listener login/proxy-notify {
mode = 0666
  }
  inet_listener {
port = 8181
  }
  unix_listener director-userdb {
mode = 0600
  }
  unix_listener login/director {
mode = 0666
  }
}
service doveadm {
  inet_listener {
port = 8282
  }
}
service imap-login {
  executable = imap-login director
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
}
service imap {
  service_count = 0
}
service lmtp {
  inet_listener lmtp {
port = 24
  }
}
service pop3-login {
  executable = pop3-login director
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service pop3 {
  service_count = 0
}
ssl_cert = 

Re: [Dovecot] Problem with running two dovecot instances on the same server

2012-07-26 Thread Alexandr Sabitov

On 27/07/12 10:00, Daniel Parthey wrote:

Alexandr Sabitov wrote:

The problem is when I run two instances of dovecot 2.1.8 which are
one for proxy-director and another one is a regular one on the same
server then I have big amount of strange entries in the
/var/log/mail.err:

Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for 
director_mail_servers setting
Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): 
command startup failed, throttling for 60 secs
Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for 
director_mail_servers setting
Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: service(director): 
command startup failed, throttling for 60 secs

Does behaviour change when you are using more than a single
IP address on director_mail_servers variable?

Can you elaborate a bit more how the IP addresses are used
and on which hosts which IP is UP and running on which interface?


That's for sure set->director_mail_servers variable in main_preinit of 
./src/director/main.c
But after dumping it it turns out that ppid of the process which
failed to use main_preinit function is a "regular" dovecot not the
proxy one.
When main_preinit is used by dovecot-proxy then
set->director_mail_servers = ip address of a mail server and it is
all good
but if  main_preinit is used by dovecot then
set->director_mail_servers = empty and I get fatal errors in logs.

So here is a question: How come that "non-proxy" dovecot requests
director_mail_servers variable and writes fatal error in the logs if
it doesn't find it ?

Maybe your director is not using the dovecot-proxy.conf?
Maybe a conflict between the sockets of the two instances?

Please show the output of the following commands:

# ps -ef|grep bin/dovecot|grep -v grep
# doveadm instance list

Regards
Daniel

Hi Daniel and All,

Sure, here is an output of the commands:

root@dovecot-test-1:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep
root  8214 1  0 Jul26 ?00:00:04 
/usr/local/dovecot/sbin/dovecot -c 
/usr/local/dovecot/etc/dovecot/dovecot-proxy.conf
root  8224 1  0 Jul26 ?00:00:07 
/usr/local/dovecot/sbin/dovecot


root@dovecot-test-1:/home/asabitov# /usr/local/dovecot/bin/doveadm 
instance list

path name  last used   running
/var/run/dovecot dovecot   2012-07-26 23:29:41 yes
/var/run/dovecot-proxydovecot-proxy 2012-07-26 23:20:00 yes


And the situation changes for the better when I use two separate 
binaries installed in different folders, so for example this is another 
server where I do NOT have

those fatal errors in the logs:

root@dovecot-test-2:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep
root 31859 1  0 Jul25 ?00:00:10 
/usr/local/dovecot/sbin/dovecot
root 31871 1  0 Jul25 ?00:00:03 
/usr/local/dovecot-proxy/sbin/dovecot


Thank you for your reply anyway.

--

Regards,
Alexandr Sabitov
Systems Administrator
Netregistry



Re: [Dovecot] Problem with running two dovecot instances on the same server

2012-07-26 Thread Alexandr Sabitov

On 27/07/12 10:00, Daniel Parthey wrote:

Alexandr Sabitov wrote:

The problem is when I run two instances of dovecot 2.1.8 which are
one for proxy-director and another one is a regular one on the same
server then I have big amount of strange entries in the
/var/log/mail.err:

Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for 
director_mail_servers setting
Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): 
command startup failed, throttling for 60 secs
Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for 
director_mail_servers setting
Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: service(director): 
command startup failed, throttling for 60 secs

Does behaviour change when you are using more than a single
IP address on director_mail_servers variable?

Can you elaborate a bit more how the IP addresses are used
and on which hosts which IP is UP and running on which interface?


That's for sure set->director_mail_servers variable in main_preinit of 
./src/director/main.c
But after dumping it it turns out that ppid of the process which
failed to use main_preinit function is a "regular" dovecot not the
proxy one.
When main_preinit is used by dovecot-proxy then
set->director_mail_servers = ip address of a mail server and it is
all good
but if  main_preinit is used by dovecot then
set->director_mail_servers = empty and I get fatal errors in logs.

So here is a question: How come that "non-proxy" dovecot requests
director_mail_servers variable and writes fatal error in the logs if
it doesn't find it ?

Maybe your director is not using the dovecot-proxy.conf?
Maybe a conflict between the sockets of the two instances?

Please show the output of the following commands:

# ps -ef|grep bin/dovecot|grep -v grep
# doveadm instance list

Regards
Daniel

Hi Daniel and All,

Sure, here is an output of the commands:

root@dovecot-test-1:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep
root  8214 1  0 Jul26 ?00:00:04 
/usr/local/dovecot/sbin/dovecot -c 
/usr/local/dovecot/etc/dovecot/dovecot-proxy.conf
root  8224 1  0 Jul26 ?00:00:07 
/usr/local/dovecot/sbin/dovecot


root@dovecot-test-1:/home/asabitov# /usr/local/dovecot/bin/doveadm 
instance list

path name  last used   running
/var/run/dovecot dovecot   2012-07-26 23:29:41 yes
/var/run/dovecot-proxydovecot-proxy 2012-07-26 23:20:00 yes


And the situation changes for the better when I use two separate 
binaries installed in different folders, so for example this is another 
server where I do NOT have

those fatal errors in the logs:

root@dovecot-test-2:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep
root 31859 1  0 Jul25 ?00:00:10 
/usr/local/dovecot/sbin/dovecot
root 31871 1  0 Jul25 ?00:00:03 
/usr/local/dovecot-proxy/sbin/dovecot


Thank you for your reply anyway.

--

Regards,
Alexandr Sabitov
Systems Administrator
Netregistry



Re: [Dovecot] Problem with running two dovecot instances on the same server

2012-07-30 Thread Alexandr Sabitov

On 29/07/12 02:49, Timo Sirainen wrote:

On 26.7.2012, at 5.27, Alexandr Sabitov wrote:

Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for 
director_mail_servers setting
Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): 
command startup failed, throttling for 60 secs

Director process gets started for the backend installation where it of course 
isn't configured. My guess: doveadm (from some cronjob?) is attempting to 
connect to /var/run/dovecot/director-admin instead of 
/var/run/dovecot-proxy/director-admin.



Hi Timo,

Thanks for reply.

That's right:  strace shows that director process is a child of 
non-proxy dovecot (pid 7089) which is should not be happening. And I 
don't have any cronjob running.


Might we need just update dovecot wiki that if someone runs dovecot and 
dovecot-proxy then they have to be installed in different folders as
separate binaries otherwise one instance cross over another somehow 
magically. :)


7089  epoll_wait(51, {}, 56, 25070) = 0
7089  epoll_ctl(51, EPOLL_CTL_ADD, 38, 
{EPOLLIN|EPOLLPRI|EPOLLERR|EPOLLHUP, {u32=15790944, u64=15790944}}) = 0
7089  epoll_wait(51, {{EPOLLIN, {u32=15790944, u64=15790944}}}, 56, 
43627051) = 1
7089  clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x7f56462d19d0) = 7169
7089  epoll_ctl(51, EPOLL_CTL_DEL, 38, {0, {u32=15790944, 
u64=15790944}}) = 0

7089  epoll_wait(51,  
7169  dup2(83, 2)   = 2
7169  close(6)  = 0
7169  dup2(38, 7)   = 7
7169  dup2(10, 3)   = 3
7169  dup2(129, 5)  = 5
7169  dup2(95, 6)   = 6
7169  setrlimit(RLIMIT_DATA, {rlim_cur=262144*1024, 
rlim_max=262144*1024}) = 0

7169  setrlimit(RLIMIT_AS, {rlim_cur=262144*1024, rlim_max=262144*1024}) = 0
7169  execve("/usr/local/dovecot/libexec/dovecot/director", 
["dovecot/director"], [/* 15 vars */]) = 0

7169  brk(0)= 0xff6000
7169  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)


root@dovecot-test-1:/home/asabitov# lsof /var/run/dovecot/director-admin
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
dovecot 7089 root   38u  unix 0x88007e8e1200  0t0 48243 
/var/run/dovecot/director-admin
root@dovecot-test-1:/home/asabitov# lsof 
/var/run/dovecot-proxy/director-admin

COMMAND   PIDUSER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
dovecot  7102root   39u  unix 0x88007e9da300  0t0 48469 
/var/run/dovecot-proxy/director-admin
director 7178 webmail8u  unix 0x88007e9da300  0t0 48469 
/var/run/dovecot-proxy/director-admin


#ps auxf
root  7089  0.0  0.0  17332  1092 ?Ss   Jul27   0:02 
/usr/local/dovecot/sbin/dovecot
webmail   7091  0.0  0.0  12808  1100 ?SJul27   0:00  \_ 
dovecot/anvil
root  7092  0.0  0.0  13056  1324 ?SJul27   0:01  \_ 
dovecot/log
root  3572  0.0  0.1  14256  2220 ?SJul29   0:01  \_ 
dovecot/config
webmail  16207  0.0  0.2  71684  4252 ?S09:11   0:00  \_ 
dovecot/imap
root  7102  0.0  0.0  17204  1072 ?Ss   Jul27   0:01 
/usr/local/dovecot/sbin/dovecot -c 
/usr/local/dovecot/etc/dovecot/dovecot-proxy.conf
webmail   7104  0.0  0.0  12808  1084 ?SJul27   0:00  \_ 
dovecot-proxy/anvil
root  7105  0.0  0.0  12936  1244 ?SJul27   0:00  \_ 
dovecot-proxy/log
webmail   7178  0.0  0.0  12964  1328 ?SJul27   0:00  \_ 
dovecot-proxy/director
dovenull 16202  0.0  0.1  23500  2916 ?S09:11   0:00  \_ 
dovecot-proxy/imap-login director
root 16203  0.0  0.1  14604  2544 ?S09:11   0:00  \_ 
dovecot-proxy/config
webmail  16208  0.0  0.0  12804  1028 ?S09:11   0:00  \_ 
dovecot-proxy/ipc
root  7108  0.0  0.3  48240  6412 ?Ss   Jul27   0:01 perl 
/usr/local/dovecot/bin/poolmon


--

Regards,
Alexandr Sabitov
Systems Administrator
Netregistry



[Dovecot] Director and forwarding LDAP user as Master user

2012-12-19 Thread Alexandr Sabitov
Hello guys,

Would you be able to help me with this little issue. I bet someone has the same 
config so if you can copy-paste it I will very appreciate it.
So main idea is to enable Dovecot director to authenticate a LDAP user with 
plain or encrypted password and  send the user  to back-end Dovecot server 
after the authentication.
According to Wiki it is only possible if we use the master user to communicate 
to the back-end server.

On the back-end Dovecot server it is working fine, I can log in as normal 
user/user_password or as user*masteruser/master_password. The back-end config 
is:

auth_master_user_separator = *
passdb {
  driver = passwd-file
  args = /usr/local/dovecot/etc/dovecot/passwd.masterusers
  master = yes
  pass = yes
}

passdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}

userdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}

Now  front-end:  how to get director forward the user to the back-end after 
authentication on the director? With my director config the user stays on the 
director all the time:

passdb {
  driver = static
  args = proxy=y master=masteruser pass=master_password destuser=%u*masteruser
}

passdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}

userdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}

The only way to forward the user is to setup nopassword=y in args of static 
passdb but in that case the user will be authenticated on the backend but not 
on the director...
What do I missing ? Please help me

Best Regards,
Alexandr Sabitov


Re: [Dovecot] Director and forwarding LDAP user as Master user

2013-01-07 Thread Alexandr Sabitov
Hi Timo,

Unfortunately adding pass=yes to dovecot director did not work for me but I 
found another way to enable what I need. Can you please confirm if it is 
alright.
This is working for me:

Task: Get LDAP users authenticate at Director with encrypted password such as 
cram-md5 and pass them to back-end Dovecot mail-server as a Master user.

Dovecot Director: 192.168.100.95
Dovecot: 192.168.100.96

Dovecot: 2.1.10 

dovecot-proxy.conf (NO NEED FOR STATIC PASSDB):
...
passdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}
userdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}
service pop3-login {
  executable = pop3-login director
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
...

dovecot.conf:
...
auth_master_user_separator = *
passdb {
  driver = passwd-file
  args = /usr/local/dovecot/etc/dovecot/passwd.masterusers
  master = yes
  pass = yes
}
passdb {
  driver = static
}
userdb {
  driver = ldap
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
}
...

dovecot-ldap.conf.ext:
...
user_attrs = homeDirectory=home, uidNumber=uid, gidNumber=gid
user_filter = (&(objectClass=nrPOPAccount)(uid=%u))
pass_attrs = uid=user, userPassword=password, =proxy=y, 
=destuser=%u*masteruser, =pass=mastpass
pass_filter = (&(objectClass=nrPOPAccount)(uid=%u))
...

Then telnet to the director with normail username/passwords and see where user 
stops at:
dovecot-shared-1:/usr/local/dovecot/etc/dovecot#  
/usr/local/dovecot/bin/doveadm who -a /var/run/dovecot-proxy/anvil 
username # proto (pids) (ips) 
HE DIDNT STOP ON DIRECTOR
dovecot-shared-1:/usr/local/dovecot/etc/dovecot#  
/usr/local/dovecot/bin/doveadm who -a /var/run/dovecot/anvil 
username # proto (pids)  (ips)  
   
migration.t...@network.id.au 1 pop3  (16226) (192.168.100.96)
HE WENT THROUGH DIRECTOR AND NOW IS AT MAILSERVER

Double-check:
dovecot-shared-1:/usr/local/dovecot/etc/dovecot#  
/usr/local/dovecot/bin/doveadm director status -a 
/var/run/dovecot-proxy/director-admin 
mail server ip vhostsusers
192.168.100.961001

Double-check in logs:
Jan 08 04:35:11 auth: Debug: client in: AUTH1   PLAIN   service=pop3
session=xTmneL/SGwAKAQeolip=192.168.100.95
  rip=10.1.7.168  lport=110   rport=39451 resp=
Jan 08 04:35:11 auth: Debug: 
ldap(migration.t...@network.id.au,10.1.7.168,): pass search: 
base=ou=email, dc=netr
egistry, dc=net scope=subtree 
filter=(&(objectClass=nrPOPAccount)(uid=migration.t...@network.id.au)) 
fields=uid,userPassword
Jan 08 04:35:11 auth: Debug: 
ldap(migration.t...@network.id.au,10.1.7.168,): result: 
uid=migration.test@network.
id.au userPassword=
Jan 08 04:35:11 auth: Debug: client passdb out: OK  1   
user=migration.t...@network.id.au   proxy   destuser=migration
.t...@network.id.au*masteruserpass=
Jan 08 04:35:11 pop3-login: Info: proxy(migration.t...@network.id.au): started 
proxying to 192.168.100.96:110/migration.test@netwo
rk.id.au*masteruser: user=, method=PLAIN, 
rip=10.1.7.168, lip=192.168.100.95, session=

Thundbird setup with encrypted password works good.
  
Looks like all is working good and I do not have the auth_bind=yes.

Timo, please confirm if it is OK setup. 

Best Regards,
Alexandr Sabitov

From: Timo Sirainen [t...@iki.fi]
Sent: Friday, January 04, 2013 2:53 PM
To: Alexandr Sabitov
Cc: dovecot@dovecot.org
Subject: Re: [Dovecot] Director and forwarding LDAP user as Master user

On 20.12.2012, at 4.11, Alexandr Sabitov  
wrote:

> Hello guys,
>
> Would you be able to help me with this little issue. I bet someone has the 
> same config so if you can copy-paste it I will very appreciate it.
> So main idea is to enable Dovecot director to authenticate a LDAP user with 
> plain or encrypted password and  send the user  to back-end Dovecot server 
> after the authentication.
> According to Wiki it is only possible if we use the master user to 
> communicate to the back-end server.

If you use auth_bind=yes this doesn't work. If you don't, this should work:

> On the back-end Dovecot server it is working fine, I can log in as normal 
> user/user_password or as user*masteruser/master_password. The back-end config 
> is:
>
> auth_master_user_separator = *
> passdb {
>  driver = passwd-file
>  args = /usr/local/dovecot/etc/dovecot/passwd.masterusers
>  master = yes
>  pass = yes
> }
>
> passdb {
>  driver = ldap
>  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
> }
>
> userdb {
>  driver = ldap
>  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
> }

The above looks ok. "pass = yes" is the im

[Dovecot] Benchmarking: Dovecot vs Courier. Courier wins as POP3 server

2013-01-16 Thread Alexandr Sabitov
Hi All,

I have compared Dovecot performance to Courier and it appears that as a POP3 
server Dovecot is slower in 2 times but as an IMAP server it is faster in 1.5 
times. The same node (16CPUs), testing time is 30 min, please see results and 
dovecot configs attached.
Benchmark software is MStone used by Sendmail Inc so is is quite reliable.

I do not see anything else to tweak in Dovecot to increase POP3 performance. 
Can we all have some tips to improve it please ?

This is how my Dovecot set up:
(LDAP user) -> Dovecot Director -> (Master user) -> Dovecot

Dovecot Director:
dovecot-shared-4:~# /usr/local/dovecot/bin/doveconf -n -c 
/usr/local/dovecot/etc/dovecot/dovecot-proxy.conf
# 2.1.12: /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.6
auth_debug = yes
auth_mechanisms = plain login cram-md5 ntlm
auth_verbose = yes
base_dir = /var/run/dovecot-proxy
default_internal_user = webmail
director_mail_servers = 192.168.100.102
director_servers = 192.168.100.101
disable_plaintext_auth = no
doveadm_password = blah
doveadm_proxy_port = 9292
instance_name = dovecot-proxy
listen = 192.168.100.101
log_path = /var/log/dovecot-proxy.log
login_greeting = Dovecot Proxy ready.
mail_location = maildir:~/
passdb {
  args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
service auth-worker {
  user = webmail
}
service auth {
  client_limit = 2400
}
service director {
  fifo_listener login/proxy-notify {
mode = 0666
  }
  inet_listener {
port = 9191
  }
  unix_listener director-userdb {
mode = 0600
  }
  unix_listener login/director {
mode = 0666
  }
}
service doveadm {
  inet_listener {
port = 9292
  }
}
service imap-login {
  executable = imap-login director
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
}
service imap {
  service_count = 0
}
service lmtp {
  inet_listener lmtp {
port = 24
  }
}
service pop3-login {
  executable = pop3-login director
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service pop3 {
  service_count = 0
}
ssl_cert =  MStone Results 20130116.1333 
NR Courier POP3 Test
Some sort of testing...

Test duration: 30 minutes.  Rampup: 20 seconds.  Reported duration 30.0min
Number of reporting clients: 1 of 1

POP3  TryError   BytesR   BytesW
 Time TMin TMax TStd
POP3:blocks 27715
POP3:total 2494320   1237641991  2232351
0.0070.0011.1820.018
POP3:connect27715000
0.0020.0011.0010.013
POP3:banner 277150   4988700
0.0070.0020.4250.015
POP3:login  277150   443440   388010
0.0130.0041.1820.035
POP3:command554300  1025455  1012915
0.0020.0010.2100.003
POP3:submit 0000
0.0000.0000.0000.000
POP3:retrieve   831420   1235286216   665136
0.0130.0050.6500.019
POP3:logout 277150   388010   166290
0.0020.0010.2100.003
POP3:idle   0000
0.0000.0000.0000.000

POP3  Try/minError/min   BytesR/sec   BytesW/sec
POP3:blocks/m  15.397
POP3:total/m 8314.4000.000   687578 1240
POP3:connect/m923.8330.00000
POP3:banner/m 923.8330.000  2770
POP3:login/m  923.8330.000  246  215
POP3:command/m   1847.6670.000  569  562
POP3:submit/m   0.0000.00000
POP3:retrieve/m  2771.4000.000   686270  369
POP3:logout/m 923.8330.000  215   92
POP3:idle/m 0.0000.00000

 MStone Results 20130116.1439 
NR Courier IMAP Test
Some sort of testing...

Test duration: 30 minutes.  Rampup: 20 seconds.  Reported duration 30.0min
Number of reporting clients: 1 of 1

IMAP4 TryError   BytesR   BytesW
 Time TMin TMax TStd
IMAP4:blocks12377
IMAP4:total1856470  9740526  1900461
0.0100.0013.8190.021
IMAP4:connect   12

[Dovecot] dovecot.index is missing

2013-01-28 Thread Alexandr Sabitov
Dear All,

I have noticed that dovecot.index is not generated straight away if you have 
just a few emails in the mailbox. Instead of that dovecot.index.log is modified 
and accessed by clients.

Only if the number of email reaches some level then it creates dovecot.index in 
user mailboxes.

Can somebody please tell me when (in my understanding of the process) the index 
log file drops all data into the mail index file. What does trigger that ?
Sorry I couldn't find any info on that in the wiki.

Best Regards,
Alexandr Sabitov


Re: [Dovecot] dovecot.index is missing

2013-01-29 Thread Alexandr Sabitov
Timo and Stan,

thank you very much for the explanation :)
Wish you a good day !

Regards,
Alexandr Sabitov

From: dovecot-boun...@dovecot.org [dovecot-boun...@dovecot.org] on behalf of 
Timo Sirainen [t...@iki.fi]
Sent: Wednesday, January 30, 2013 3:02 AM
To: dovecot@dovecot.org
Subject: Re: [Dovecot] dovecot.index is missing

On Tue, 2013-01-29 at 03:37 -0600, Stan Hoeppner wrote:
> On 1/29/2013 1:37 AM, Alexandr Sabitov wrote:
> > Dear All,
> >
> > I have noticed that dovecot.index is not generated straight away if you 
> > have just a few emails in the mailbox. Instead of that dovecot.index.log is 
> > modified and accessed by clients.
> >
> > Only if the number of email reaches some level then it creates 
> > dovecot.index in user mailboxes.
> >
> > Can somebody please tell me when (in my understanding of the process) the 
> > index log file drops all data into the mail index file. What does trigger 
> > that ?
> > Sorry I couldn't find any info on that in the wiki.
>
> Dovecot is behaving here as designed.   You haven't found the technical
> answer because there is no configurable variable for this behavior--it's
> hard coded.  Thus it is not documented.
>
> The layman's explanation is this:  up to a certain amount of mail it is
> more expensive to create the index than to simply read the mail.  Beyond
> that point indexing has benefit.  To understand how that decision is
> made requires reading the source, and understanding it.

The index still exists. It's just that for new mailboxes the
dovecot.index.log file contains everything that is necessary to create a
dovecot.index file, and Dovecot just hasn't gotten around to actually
creating it. If a mailbox shrinks enough, the dovecot.index file could
in theory be deleted as well (and maybe in future Dovecot version it
will).

So dovecot.index is just a snapshot that gets updated every once in a
while. http://wiki2.dovecot.org/IndexFiles and
http://wiki2.dovecot.org/Design/Indexes has some more details, although
they don't seem to talk about this exact thing.




[Dovecot] Exposing masteruser info to cllients via lmtp-proxy connections

2013-03-03 Thread Alexandr Sabitov
Hello,

Please somebody suggest me how to remove the "*masteruser" appendix from the 
dovecot director database while using masteruser authentication.

My situation is:
- all users get authenticated in LDAP on the dovecot-director frontend
- then they are forwarded to dovecot backend as username*masteruser ( this is a 
way how to proxy users with encrypted passwords). To enable it a added an extra 
field in LDAP-dovecot configuration: destuser=%u*masteruser

This works OK, but problems are:
- I have lmtp-proxy on the dovecot frontend and I have to use the same  
"%u*masteruser" field in lmtp passdb because the director thinks that 
m...@mail.com and m...@mail.com*masteruser are different users and would send 
lmtp-proxy connections to other dovecot backend.
Here is a problem: "Delivery-To" and "Received" fields in any email contains 
"*masteruser" ! I need to remove any mentions about "masteruser" authentication 
from client emails.

Also another little problem:
- If I run "doveadm status" tool then to get user's data I need to specify user 
as "username*masteruser"

Thank you in advance.

Alexandr Sabitov
Netregistry





[Dovecot] Dovecot 2.1 Panic

2013-11-26 Thread Alexandr Sabitov
Hi,

Dovecot 2.1.12 sends panic message when it tries to authenticate some users. 
Apparently because  they use different authentication mechanisms on different 
email clients at the same time. For example, in debug logs this user uses 
CRAM-MD5, NTLM and PLAIN in account settings of his email clients.
All passwords are stored in plain text (base64) in LDAP.

Please advise me what I can tweak to fix this  issue ?


Nov 27 06:38:36 dovecot-1 auth: Error: 
ldap(g...@in.com.au,201.45.21.151,): Multiple password values 
not supported
Nov 27 06:38:36 dovecot-1 auth: Panic: file passdb-ldap.c: line 95 
(ldap_lookup_finish): assertion failed: (password == NULL || scheme != NULL)
Nov 27 06:38:36 dovecot-1 auth: Error: 
ldap(g...@in.com.au,201.45.21.151,): Multiple password values 
not supported
Nov 27 06:38:36 dovecot-1 auth: Error: Raw backtrace: 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(+0x485ca) [0x7f90ed51b5ca] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(+0x48616) [0x7f90ed51b616] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f90ed4f] -> 
dovecot-proxy/auth() [0x42967c] -> dovecot-proxy/auth() [0x428da1] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x36) 
[0x7f90ed5277a6] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x9f) 
[0x7f90ed5287df] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(io_loop_run+0x28) 
[0x7f90ed527748] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x7f90ed513123] -> dovecot-proxy/auth(main+0x376) [0x41bd26] -> 
/lib/libc.so.6(__libc_start_main+0xfd) [0x7f90ec2d8c8d] -> dovecot-proxy/auth() 
[0x40d0f9]
Nov 27 06:38:36 dovecot-1 auth: Error: Raw backtrace: 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(+0x485ca) [0x7f90ed51b5ca] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(+0x48616) [0x7f90ed51b616] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f90ed4f] -> 
dovecot-proxy/auth() [0x42967c] -> dovecot-proxy/auth() [0x428da1] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x36) 
[0x7f90ed5277a6] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x9f) 
[0x7f90ed5287df] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(io_loop_run+0x28) 
[0x7f90ed527748] -> 
/usr/local/dovecot/lib/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x7f90ed513123] -> dovecot-
proxy/auth(main+0x376) [0x41bd26] -> /lib/libc.so.6(__libc_start_main+0xfd) 
[0x7f90ec2d8c8d] -> dovecot-proxy/auth() [0x40d0f9]
Nov 27 06:38:36 dovecot-1 director: Error: Auth server disconnected unexpectedly
Nov 27 06:38:36 dovecot-1 auth: Fatal: master: service(auth): child 26841 
killed with signal 6 (core dumps disabled)


This is LDAP configuration on one of director servers where clients are 
authenticated.

uris =  ldap://ldap-node-2.mynetwork.net, ldap://ldap-node-3.mynetwork.net
debug_level = 0
base = ou=email, dc=netregistry, dc=net

user_attrs = homeDirectory=home, uidNumber=uid, gidNumber=gid, 
mailQuotaSize=quota_rule=*:storage=%$
user_filter = (&(objectClass=nrPOPAccount)(uid=%u))
pass_attrs = uid=user, userPassword=password, =proxy=y, =destuser=%u, 
=pass=Secret456
pass_filter = (&(objectClass=nrPOPAccount)(uid=%u))

default_pass_scheme = PLAIN


Regards,
Alexandr Sabitov
System Administrator