Dovecot-EE repository for Debian 8 (Jessie/stable)

2015-07-17 Thread Bernhard Schmidt
Hi,

are there plans to support Debian 8 (alias stable, alias jessie) in the
dovecot-ee repository? Currently there are only squeeze and wheezy
repos. The wheezy repo is uninstallable due to an unsatisfyable
dependency on libicu48. 

Of course you can install libicu48 from Wheezy on a Jessie system, but
this will break security updates and might not be the best idea for a
library like that.

Bernhard


Re: quota_full_tempfail = yes broken with lmtp_rcpt_check_quota (was: Re: lmtp_rcpt_check_quota not working)

2015-07-17 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

*bump* this is still an issue with Dovecot 2.2.18.2 from the dovecot-ee
repository

> With 2.2.15 from dovecot-ee it is different. The quota is now checked at
> RCPT stage
>
> # 2.2.15.8 (912dd04d7a14+): /etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.6 (4b9b9a88ac9b)
> # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.8 
>
>  -> MAIL FROM:
><-  250 2.1.0 OK
>  -> RCPT TO:
><** 552 5.2.2  Quota exceeded (mailbox for user is full)
>
> But as you can see, the setting for quota_full_tempfail is now ignored.
> It should be deferring the message, not rejecting it. When I disable
> lmtp_rcpt_check_quota it behaves like 2.2.13.
>
> Summary:
> - In 2.2.9 and 2.2.13 lmtp_rcpt_check_quota is ignored
> - In 2.2.15 lmtp_rcpt_check_quota works, but quota_full_tempfail is
>   ignored at the RCPT TO stage. It still works at the DATA stage, so
>   disabling lmtp_rcpt_check_quota is a workaround falling back to 2.2.13
>   behaviour
>
> Bernhard
>


[Dovecot] Parallel auth

2011-07-21 Thread Bernhard Schmidt
Hello,

we run a Dovecot 2.0.13 instance purely as SASL backend for Postfix,
authenticating against a local passwd-file and our central LDAP
database.

# dovecot -n
# 2.0.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32.36-0.5-default x86_64 SUSE Linux Enterprise Server 11
# (x86_64)
auth_mechanisms = plain login
auth_verbose = yes
passdb {
  args = /etc/dovecot/dovecot-passwd
  driver = passwd-file
}
passdb {
  args = /etc/dovecot/dovecot-ldap-simauth.conf.ext
  driver = ldap
}
protocols = none
service auth {
  unix_listener /var/spool/postfix-postout/private/auth {
group = postfix
mode = 0660
user = postfix
  }
}
ssl = no

There is only a single user in the passwd-file for monitoring. We
monitor authentication delays for both this local user and one user from
LDAP.

Due to a firmware bug, our six-figures NAS causes extremely high LDAP
delays (in the range of 20-60 seconds, instead of the usual 50ms) once
an hour. The weird thing is, I also see these delays in the graph for
the local user. Which got me thinking

* are authentication requests handled serially by dovecot/auth?
* any way to solve this situation for the local user (not to be blocked
  by the delayed LDAP query)?
* any way to solve this situation for LDAP users? We could possibly do
  some loadbalancing if the auth-daemon opened several LDAP connections

Thanks,
Bernhard



[Dovecot] dovecot 1.1rc1 deliver linker error without mbox

2008-03-02 Thread Bernhard Schmidt
Hi,

compiling dovecot-1.1rc1 with the option --with-storages=maildir,raw
raises the following error:

cc -std=gnu99 -g -Wall -O2 -Wall -W -Wmissing-prototypes
-Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2
-Wbad-function-cast -Wstrict-aliasing=2 -o deliver auth-client.o
deliver.o duplicate.o mail-send.o smtp-client.o ../lib/mountpoint.o
-Wl,--export-dynamic  ../lib-storage/register/libstorage-register.a
./lib-storage/list/libstorage_list.a
./../src/lib-storage/index/maildir/libstorage_maildir.a
./../src/lib-storage/index/raw/libstorage_raw.a
./../src/lib-storage/index/libstorage_index.a
./../src/lib-storage/libstorage.a ../../src/lib-index/libindex.a
./lib-imap/libimap.a ../lib-mail/libmail.a ../lib-dict/libdict.a
./lib-charset/libcharset.a ../lib/liblib.a -ldl
deliver.o: In function `create_raw_stream':
/home/berni/software/dovecot/dovecot-1.1.rc1/src/deliver/deliver.c:559:
undefined reference to `mbox_from_parse'
collect2: ld returned 1 exit status
make[4]: *** [deliver] Error 1
make[4]: Leaving directory
`/home/berni/software/dovecot/dovecot-1.1.rc1/src/deliver'

With mbox included it compiles fine. This was not the case until at
least beta13.

Regards,
Bernhard



[Dovecot] IPv6-enabled dovecot-1.1rc* does not accept IPv4-connections

2008-03-08 Thread Bernhard Schmidt
Hi,

I'm having a really really strange problem. After upgrading from
1.1.beta13 to 1.1.rc2 (happened with rc1 as well IIRC) I can't connect
to the services using IPv4 anymore. dovecot happily binds to the IPv6
wildcard socket which should accept IPv4 connections as well.

[EMAIL PROTECTED]:~# netstat -lnp --tcp | grep dovecot
tcp6   0  0 :::993  :::*LISTEN 
30758/dovecot
tcp6   0  0 :::995  :::*LISTEN 
30758/dovecot
tcp6   0  0 :::110  :::*LISTEN 
30758/dovecot
tcp6   0  0 :::143  :::*LISTEN 
30758/dovecot
[EMAIL PROTECTED]:~# telnet ::1 110
Trying ::1...
Connected to ::1.
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.
[EMAIL PROTECTED]:~# telnet 127.0.0.1 110
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
[EMAIL PROTECTED]:~# /sbin/stop dovecot
dovecot (stop) running, process 30758
dovecot (stop) pre-stop, (main) process 30758
dovecot (stop) stopping, process 30758
dovecot (stop) killed, process 30758
dovecot (stop) post-stop
dovecot (stop) waiting

# downgrading
[EMAIL PROTECTED]:~# dpkg -i dovecot_1.1.beta13-1_amd64.deb
dpkg - warning: downgrading dovecot from 1.1.rc2-1 to 1.1.beta13-1.
(Reading database ... 20504 files and directories currently installed.)
Preparing to replace dovecot 1.1.rc2-1 (using dovecot_1.1.beta13-1_amd64.deb) 
...
Unpacking replacement dovecot ...
Setting up dovecot (1.1.beta13-1) ...
Installing new version of config file /etc/dovecot/dovecot-sql-example.conf ...
Installing new version of config file /etc/dovecot/dovecot-ldap-example.conf ...
Installing new version of config file /etc/dovecot/dovecot-example.conf ...
[EMAIL PROTECTED]:~# /sbin/start dovecot
dovecot (start) waiting
dovecot (start) starting
dovecot (start) pre-start, process 30816
dovecot (start) spawned, process 30818
dovecot (start) post-start, (main) process 30818
dovecot (start) running, process 30818
[EMAIL PROTECTED]:~# netstat -lnp --tcp | grep dovecot
tcp6   0  0 :::993  :::*LISTEN 
30818/dovecot
tcp6   0  0 :::995  :::*LISTEN 
30818/dovecot
tcp6   0  0 :::110  :::*LISTEN 
30818/dovecot
tcp6   0  0 :::143  :::*LISTEN 
30818/dovecot
[EMAIL PROTECTED]:~# telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.

I built the packages myself, both (beta13 and rc2) with the options

--without-passwd --without-passwd-file --without-shadow --without-pam
--without-gssapi --without-vpopmail --with-ldap --without-checkpassword
--without-nss --with-deliver --with-ioloop=epoll
--with-storages=maildir,raw --sysconfdir=/etc/dovecot

Anyone having an idea?

Thanks,
Bernhard



Re: [Dovecot] IPv6-enabled dovecot-1.1rc* does not accept IPv4-connections

2008-03-08 Thread Bernhard Schmidt
Timo Sirainen <[EMAIL PROTECTED]> wrote:

>> I'm having a really really strange problem. After upgrading from
>> 1.1.beta13 to 1.1.rc2 (happened with rc1 as well IIRC) I can't connect
>> to the services using IPv4 anymore. dovecot happily binds to the IPv6
>> wildcard socket which should accept IPv4 connections as well.
> Dovecot no longer binds to both IPv6 and IPv4 using the same socket to  
> avoid those stupid :::1.2.3.4 mapped addresses. Use:
>
> listen = [::], *

Yes, found that two minutes after my post. Was about to formally recall
my report, but now I'm hitting another issue:

Mar  8 13:02:57 vs02 deliver((null)): User request from dovecot-auth
timed out
Mar  8 13:02:57 vs02 postfix/pipe[30987]: 560043830E:
to=<[EMAIL PROTECTED]>, orig_to=<[EMAIL PROTECTED]>,
relay=dovecot, delay=152, delays=4.4/87/0/60, dsn=4.3.0, status=deferred
(temporary failure)

I guess I missed something else, that used to work with beta13 as well.
Any hints?

Regards,
Bernhard



Re: [Dovecot] IPv6-enabled dovecot-1.1rc* does not accept IPv4-connections

2008-03-08 Thread Bernhard Schmidt

Timo Sirainen wrote:


Mar  8 13:02:57 vs02 deliver((null)): User request from dovecot-auth
timed out

Oh, that's a new bug. This should fix it:
http://hg.dovecot.org/dovecot-1.1/rev/631fd6f25e41


Works, thanks a lot.

Regards,
Bernhard


[Dovecot] Weird Dovecot 1.1.6 + pop3s certificate issues

2009-02-13 Thread Bernhard Schmidt
Hello everyone,

I've been asked by a colleague to have a look at some extremely weird
dovecot SSL issue they are seeing on one of the student mailservers.

They are running dovecot 1.1.6 (yes, I know, a bit old ...) on SLES 10.2
x86_64 with imap(+starttls), imaps, pop3(+starttls) and pop3s enabled.
Every couple of weeks the pop3s and pop3+starttls part bail out out.
Clients can't connect, when you try openssl s_client you get this:

15960:error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block
type is not 01:rsa_pk1.c:100:
15960:error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check
failed:rsa_eay.c:699:
15960:error:1408D07B:SSL routines:SSL3_GET_KEY_EXCHANGE:bad
signature:s3_clnt.c:1414:

server logs don't show much except for various SSL_accept() errors,
including

TLS handshaking: SSL_accept() failed: error:1408F455:SSL
routines:SSL3_GET_RECORD:decryption failed or bad record mac
TLS handshaking: SSL_accept() syscall failed: Connection reset by peer
TLS handshaking: SSL_accept() failed: error:1409441B:SSL
routines:SSL3_READ_BYTES:tlsv1 alert decrypt error

imaps and imap+starttls work fine during the whole time (and always
have), although they are much more used.

Restarting dovecot fixes the issue for a couple of weeks. Does anyone
have an idea where to start debugging? As far as I understand the whole
SSL_accept() thing is a giant blackbox for Dovecot, but how comes it
only affects POP3? dovecot -n (paths and addresses altered, not sure how
much I can reveal without getting shot):

# 1.1.6: /mnt//usr/local/etc/dovecot.conf
# OS: Linux 2.6.16.60-0.25-smp x86_64 SUSE Linux Enterprise Server 10
# (x86_64)
protocols: imap imaps pop3 pop3s
listen(default): [ipv6]:143, ipv4:143
listen(imap): [ipv6]:143, ipv4:143
listen(pop3): [ipv6]:110, ipv4:110
ssl_listen(default): [ipv6]:993, ipv4:993
ssl_listen(imap): [ipv6]:993, ipv4:993
ssl_listen(pop3): [ipv6]:995, ipv4:995
disable_plaintext_auth: no
login_dir: /usr/local/var/run/dovecot/login
login_executable(default):
/mnt//usr/local/libexec/dovecot/imap-login
login_executable(imap):
/mnt//usr/local/libexec/dovecot/imap-login
login_executable(pop3):
/mnt//usr/local/libexec/dovecot/pop3-login
login_process_per_connection: no
login_max_connections: 128
max_mail_processes: 2500
mail_uid: campus
mail_gid: lmu
mail_location: maildir:~/Maildir:INDEX=/home/something/indexes/%-1.1n/%n
mmap_disable: yes
mail_nfs_index: yes
mail_executable(default): /mnt//usr/local/libexec/dovecot/imap
mail_executable(imap): /mnt//usr/local/libexec/dovecot/imap
mail_executable(pop3): /mnt//usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /mnt//usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /mnt//usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /mnt//usr/local/lib/dovecot/pop3
pop3_uidl_format(default): %08Xu%08Xv
pop3_uidl_format(imap): %08Xu%08Xv
pop3_uidl_format(pop3): %08Xv%08Xu
namespace:
  type: private
  separator: .
  prefix: INBOX.
  inbox: yes
  list: yes
  subscriptions: yes
auth default:
  worker_max_request_count: 500
  passdb:
driver: ldap
args: /mnt//usr/local/etc/dovecot-ldap.conf
  userdb:
driver: prefetch
  userdb:
driver: ldap
args: /mnt//usr/local/etc/dovecot-ldap.conf
  socket:
type: listen
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: campus
  group: lmu
plugin:
  quota: maildir
  quota_rule: Trash:ignore
  quota_rule2: *:storage=512M

Anyone having an idea?

bernhard



[Dovecot] Segfault in Sieve 1.2

2009-04-05 Thread Bernhard Schmidt
Hello,

two days ago I've upgraded to 1.2rc2 and the new sieve implementation
(version 0.1.4). Today I got the first mail that got stuck in the
postfix queue because deliver was dying with a segfault.

The mail is spam, thus I don't have any issues sharing it:
http://users.birkenwald.de/~berni/temp/deliver-segfault.mail

It happens with this small sieve script (my normal one is larger, but
this is the part that triggers the segfault):
http://users.birkenwald.de/~berni/temp/deliver-segfault.sieve

Note that I've been running this script unaltered for months, first with
Dovecot 1.1 and CMUSieve and now with various versions of Dovecot 1.2
and the new sieve implementation for about three weeks, this is the
first mail that got stuck.

I got a coredump, but without debugging symbols it doesn't tell that
much. If you can't reproduce it I'll compile it with debugging symbols
and try again.

(gdb) bt full
#0  0x7fa0f87ecbd7 in strstr () from /lib/libc.so.6
No symbol table info available.
#1  0x7fa0f8341933 in ?? () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#2  0x7fa0f83377a3 in sieve_address_match () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#3  0x7fa0f833ba7b in ?? () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#4  0x7fa0f8332537 in sieve_interpreter_continue () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#5  0x7fa0f8332728 in sieve_interpreter_run () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#6  0x7fa0f833f8ca in ?? () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#7  0x7fa0f833fb3d in sieve_execute () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#8  0x7fa0f8326f9d in ?? () from
/usr/lib/dovecot/lda/lib90_sieve_plugin.so
No symbol table info available.
#9  0x0041a5ad in main ()
No symbol table info available.

Platform is Debian Lenny amd64.

Regards,
Bernhard



[Dovecot] Multiple use of the same LDAP attribute

2009-04-08 Thread Bernhard Schmidt
Hi,

we've found a weird bug (?) in Dovecot 1.1.11. 

Since day and age we've been running dovecot for our student mailserver,
getting the location of the mailbox from a LDAP directory. We allow
login and LDA with both full mail address and an internal username,
so the mailbox directory is based on a LDAP attribute

user_attrs =

xxxMailbox=mail=maildir:/home/mailstore/%U$/Maildir:INDEX=/home/mailstore/indexes/%1U$/%U$,
uidNumber=vmail, gidNumber=vmail,
xxxMailQuota=quota_rule2=*:storage=%$B

this worked just fine until we introduced sieve, which made us realize
we did not have the home directory set at all.

The obvious and easy fix (we thought) was to set the home directory
based on the xxxMailbox variable as well:

user_attrs =

xxxMailbox=mail=maildir:/home/mailstore/%U$/Maildir:INDEX=/home/mailstore/indexes/%1U$/%U$,
uidNumber=vmail, gidNumber=vmail,
xxxMailQuota=quota_rule2=*:storage=%$B, 
xxxMailbox=home=/home/mailstore/%U$

unfortunately, after this trivial change hell froze over, because
suddenly the mail variable was not set at all anymore, and since we had
set

mail_location =

maildir:/home/mailstore/%Uu/Maildir:INDEX=/home/mailstore/indexes/%1Un/%Un

(based on username) it was suddenly delivered into the wrong folder
(based on the supplied username, not on the LDAP attribute).

Debug from after the change:
Apr  8 13:53:39 lxmhs23 dovecot: auth(default): ldap(usern...@xxx.de): user 
search: base= scope=onelevel filter= 
fields=xxxMailbox,uidNumber,gidNumber,xxxMailQuota,xxxMailbox 
Apr  8 13:53:39 lxmhs23 dovecot: auth(default): ldap(usern...@xxx.de): result: 
xxxMailQuota(quota_rule2=*:storage=%$B)=*:storage=1073741824B 
xxxMailbox(home=/home/mailstore/%U$)=/home/mailstore/1636D8B1D7916DEA/
[...]
Apr  8 13:53:39 lxmhs23 deliver(usern...@xxx.de): maildir: 
data=/home/mailstore/usern...@xxx.de/Maildir:INDEX=/home/mailstore/indexes/U/USERNAME

As you can see the mail variable wasn't set by LDAP at all.

We did some more tests and found a workaround, when using another LDAP 
(mwnid) attribute that contains the same information it works just fine

user_attrs =

xxxMailbox=mail=maildir:/home/mailstore/%U$/Maildir:INDEX=/home/mailstore/indexes/%1U$/%U$,
uidNumber=vmail, gidNumber=vmail,
xxxMailQuota=quota_rule2=*:storage=%$B, mwnid=home=/home/mailstore/%U$

Apr  8 14:18:06 lxmhs23 dovecot: auth(default): ldap(usern...@xxx.de): user 
search: base= scope=onelevel filter= 
fields=xxxMailbox,uidNumber,gidNumber,xxxMailQuota,mwnid
Apr  8 14:18:06 lxmhs23 dovecot: auth(default): ldap(usern...@xxx.de): result: 
xxxMailQuota(quota_rule2=*:storage=%$B)=*:storage=1073741824B 
xxxMailbox(mail=maildir:/home/mailstore/%U$/Maildir:INDEX=/home/mailstore/indexes/%1U$/%U$)=maildir:/home/mailstore/1636D8B1D7916DEA//Maildir:INDEX=/home/mailstore/indexes/1/1636D8B1D7916DEA/
 mwnid(home=/home/mailstore/%U$)=/home/mailstore/1636D8B1D7916DEA
Apr  8 14:18:06 lxmhs23 deliver(usern...@xxx.de): maildir: 
data=/home/mailstore/1636D8B1D7916DEA//Maildir:INDEX=/home/mailstore/indexes/1/1636D8B1D7916DEA/

So, it looks like there is an issue using the same LDAP attribute
(xxxMailbox in this case) twice in variable expansion.

Is this a known issue? Of course there are several viable workarounds
(base mail location on home directory, use the second attribute), but
this problem was pretty surprising.

Bernhard



Re: [Dovecot] Multiple use of the same LDAP attribute

2009-04-08 Thread Bernhard Schmidt
Charles Marcus  wrote:

>> we've found a weird bug (?) in Dovecot 1.1.11. 
> dovecot -n output is usually desired when asking for help, especially
> when it is a likely config issue...

I don't think it's a config issue, but here we go:

lxmhs23: # dovecot -n  
# 1.1.11: /mnt/mail2/usr/etc/dovecot.conf 
# OS: Linux 2.6.5-7.308-bigsmp i686 SUSE LINUX Enterprise Server 9
# (i586) nfs  
listen: :143  
ssl_listen: :993  
disable_plaintext_auth: no 
login_dir: /usr/local/var/run/dovecot/login
login_executable: /mnt/mail2/usr/libexec/dovecot/imap-login   
login_process_per_connection: no
login_max_connections: 128
max_mail_processes: 2500
mail_uid: vmail
mail_gid: vmail
mail_location:
maildir:/home/mailstore/%Uu/Maildir:INDEX=/home/mailstore/indexes/%1Un/%Un
mmap_disable: yes
mail_nfs_index: yes
mail_plugins: quota imap_quota
namespace:
  type: private
  separator: .
  prefix: INBOX.
  inbox: yes
  list: yes
  subscriptions: yes
auth default:
  username_format: %Lu
  worker_max_count: 500
  passdb:
driver: ldap
args: /mnt/mail2/usr/etc/dovecot-ldap.conf
  userdb:
driver: ldap
args: /mnt/mail2/usr/etc/dovecot-ldap.conf
  userdb:
driver: prefetch
  socket:
type: listen
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: vmail
  group: vmail
plugin:
  quota: maildir
  quota_rule: Trash:ignore
  quota_rule2: *:storage=256M
  quota_warning: storage=95%% /mnt/mail2/bin/quota-warning-95.sh
  quota_warning2: storage=85%% /mnt/mail2/bin/quota-warning-85.sh

Bernhard



Re: [Dovecot] Multiple use of the same LDAP attribute

2009-04-08 Thread Bernhard Schmidt
On Wed, Apr 08, 2009 at 12:41:17PM -0400, Timo Sirainen wrote:

> > So, it looks like there is an issue using the same LDAP attribute
> > (xxxMailbox in this case) twice in variable expansion.
> > Is this a known issue? 
> Yes. I was planning on rewriting LDAP configuration and getting it fixed
> at the same time, but looks like it didn't happen yet for v1.2.

Okay, thanks for the clarification.

> > Of course there are several viable workarounds
> > (base mail location on home directory, 
> This is what I would have suggested. Seems like a cleaner solution in
> any case.

Come to think of it, any hint how I can implement the existing scheme?

user_attrs =

xxxMailbox=mail=maildir:/home/mailstore/%U$/Maildir:INDEX=/home/mailstore/indexes/%1U$/%U$,
xxxMailbox=home=/home/mailstore/%U$

the maildir location is easy (mail=maildir:~/Maildir), but the index is
hard, as I don't have the userid in any variable.

The only thing I can come up with atm is

user_attrs = 
xxxMailbox=home=/home/mailstore/%U$,

xxxMailbox=mail=maildir:~/Maildir:INDEX=/home/mailstore/indexes/%16.1h/%16.99h

but I'm willing to bet that this is going to break at some point, the
latest point being when someone changes the mailstore path and forgets
to update the offset :-\

What happens when the width is larger than the length of the string
anyway?

Bernhard



Re: [Dovecot] Multiple use of the same LDAP attribute

2009-04-08 Thread Bernhard Schmidt
Daniel L. Miller  wrote:

> I'll admit I don't understand what you're trying to do with the above 
> parameters, but let me share what I'm using and see if it helps.  I 
> happen to be using a pure virtual configuration, with my mail users 
> logging in using their full email address as a username.  So all I need 
> to store in LDAP is the email address and the password.

This is the difference, here they can login either with their full email
address (also aliases) or with their internal userid (which is 16 char
hex). The home directory is derived from the latter, but since they can
also login with the mailaddress I can't use anything from the supplied
username to set the directory/mail location.

Bernhard



Re: [Dovecot] 2.0.7 (0757f4f5b882): LMTP Server refuses queued mail

2010-11-28 Thread Bernhard Schmidt
Thomas Leuxner  wrote:

> Narrowing down the issue a bit. With the code that was present on Nov
> 22, those Newsletter mails worked (needless to say config wasn't
> changed):

Same here, but I can limit the window some more. 8adacd9c03b2 from Nov
18th was fine and it was busted with 0bc3751c6657 on Nov 23rd. So it
seems the problem has been introduced somewhere between f5bec4e94b55 and
0bc3751c6657.

Bernhard



Re: [Dovecot] listen = ipv4, ipv6

2011-05-03 Thread Bernhard Schmidt
Leo Baltus  wrote:

Hello Leo,

> We want dovecot to listen on a specific ip4 & ipv6 addresses like so:
>
> listen = 145.58.1.1, [2a02:458:1::1]
>
> But on startup it tells me:
>
> Fatal: service(managesieve-login) Can't resolve address [2a02:458:1::1]: Name 
> or service not known

Try without the [].

listen = 83.170.6.69, 2001:1b10:1000::110:1:1

works just perfect for me.

Bernhard



[Dovecot] Dovecot 2.0+LMTP: Legal MAIL FROM rejected?

2011-06-08 Thread Bernhard Schmidt
Hi,

I run Dovecot 2.0.13 fed by Postfix over LMTP. Today it rejected one
mail Postfix and Amavis accepted, generating a bounce. It was just a
spammail, but I think the sender address is legal according to RFC5321
and should be accepted. I don't like generating bounces, email should be
either rejected by postfix/pre-queue-amavis or delivered.

Jun  6 12:32:47 mail postfix/qmgr[840]: 991FC240DB: from=, size=8427, nrcpt=1 (queue active)
Jun  6 12:32:47 mail amavis[27046]: (27046-06) FWD via SMTP: <"admin 
 -> ,BODY=7BIT 250 2.0.0 Ok, id=27046-06, 
from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 991FC240DB
Jun  6 12:32:47 mail postfix/lmtp[4710]: 991FC240DB: 
to=, orig_to=, 
relay=pop3.domain.com[::1]:24, delay=0.24, delays=0.09/0.11/0.03/0.01, 
dsn=5.5.4, status=bounced (host pop3.domain.com[::1] said: 501 5.5.4 Invalid 
parameters (in reply to MAIL FROM command))

It looks like dovecot/lmtp does not accept an address with quoted
localpart that contains a space

mail from:<"admin admin"@kl38000.com>
501 5.5.4 Invalid parameters
mail from:<"adminadmin"@kl38000.com>
250 2.1.0 OK
mail from:<"admin
250 2.1.0 OK

Bernhard



[Dovecot] LDAP timeout

2011-06-27 Thread Bernhard Schmidt
Hi,

we recently hit an issue where one (of the three configured) LDAP
servers dropped an index on an attribute due to a misconfiguration,
which caused all/most queries for passdb to take a very long time
(several 10s of seconds). 

The other servers would have been fine, but it seems like Dovecot does
either not set a timelimit on the query or uses a very high one. I could
not find any place to control that either.

Is there any knob to tune the LDAP timeout?

Bernhard



Re: [Dovecot] LDAP timeout

2011-06-29 Thread Bernhard Schmidt

Hi,


Fallbacking to another LDAP server is done by OpenLDAP internally. So
what would be needed is either a) OpenLDAP to itself figure out that
queries are running too slowly and see if another server is faster, or
b) Dovecot figure that out itself and force OpenLDAP to switch to
another server.

I don't know if either of them is possible with OpenLDAP API as it is. I
doubt it.


You can set a timelimit for a search, but I'm not exactly sure what 
happens when you specified multiple servers. Maybe the query gets 
restarted on the next server, maybe it fails. Still doing that (with 
logging) would be better than hanging there for several minutes.


If it completely aborts the query, a workaround would be to use more 
than one ldap passdb with one server each, no?


Bernhard


[Dovecot] auth timeout state=2, bad?

2012-10-22 Thread Bernhard Schmidt
Hello,

we run Dovecot 2.1.7 as SASL backend for our Postfix SMTP-AUTH farm and
see this error message occasionally

Oct 22 16:15:32 lxmhs52 dovecot: auth: PLAIN(?,xx.xx.xx.xx): Request
0.21 timeouted after 150 secs, state=2

Since it is mostly the same IP repeating I'm assuming it's a client
issue. Is that correct? What could cause this? Can we safely ignore it?

Thanks,
Bernhard



[Dovecot] LDAP congestion

2012-11-06 Thread Bernhard Schmidt
Hello,

I've been asked to have a look at a misbehaving mail server of some
colleagues today where almost all logins where failing or excessively
delayed, while the LDAP database itself was pretty fast.

They run Dovecot 1.2.11 (yes, I know, stoneage) against an LDAP server
run by a 3rd party, auth_bind=yes (required). The problem is that this
third party LDAP server delays bindResponse 3 seconds when the password
is wrong. A user wanted to login every 2-3 seconds this morning with the
wrong password, which effectively killed the system because the LDAP
connection was mostly stalled waiting for the auth timeout.

>From a previous discussion with Timo I know that bindRequests cannot be
parallelized in LDAP, so the problem does not come completely
unexpected. Other than removing the failure delay in the LDAP server, is
there anything one can do? If there is any change in newer Dovecot
versions about that please tell me so I can encourage them to upgrade,
but I haven't seen anything in the changelog.

Any way to get several LDAP workers/connections for passdb in parallel?

Thanks,
Bernhard



[Dovecot] Dovecot 2.0b3 IDLE not advertised

2010-02-26 Thread Bernhard Schmidt
Hi,

I'm not sure whether the client or the server is at fault (probably the
client), but it's clearly a regression for me.

I'm using the LCG Profimail (http://lonelycatgames.com/?app=profimail)
application for my Symbian smartphone which has quite decent IMAP 
capabilities. Amongst others it can do IMAP IDLE (which has to be
statically enabled in the server settings, so it's not used based on the
server capabilities).

After upgrading from 1.2.10 to 2.0b3 it does not connect anymore. It
throws the error message "This server doesn't support IMAP IDLE
connection" in my face, even before it tries to authenticate

Feb 27 00:46:45 mail dovecot: imap-login: Disconnected (no auth
attempts): rip=93.104.73.132, lip=83.170.x.xx, TLS: Disconnected

The main difference seems to be that 1.2 advertises IDLE in capabilities
before authentication, but 2.0 does not:

1.2:
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS 
AUTH=PLAIN] Dovecot ready.
o CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT 
THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE 
UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC
* ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH QUOTA STARTTLS AUTH=PLAIN
o OK Capability completed.

2.0:
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS 
AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
o CAPABILITY
* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS 
AUTH=PLAIN AUTH=LOGIN
o OK Capability completed.
o LOGIN user password
* CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT 
SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN 
NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1
* CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS 
QUOTA
o OK Logged in

I know there is the imap_capability setting which might help here, but
that looks like a very big hammer.

Bernhard



Re: [Dovecot] Dovecot 2.0b3 IDLE not advertised

2010-02-27 Thread Bernhard Schmidt

Hi,


Do you think there's any chance of getting Profimail fixed by
reporting this as a bug for them? Other new servers besides Dovecot
behave in a similar way.


I'll try. They are pretty active in development, but god knows how they
handle support queries. I've raised the issue with their support, I'll
keep you updated.

Best Regards,
Bernhard


Re: [Dovecot] Dovecot 2.0.beta3: Child killed with signal 11

2010-02-28 Thread Bernhard Schmidt
Timo Sirainen  wrote:

> On Sun, 2010-02-28 at 16:09 +0100, Thomas Leuxner wrote:
>> Feb 28 16:07:00 spectre dovecot: master: service(lmtp): child 17322 kille=
> d with signal 11 (core dumps disabled)
> Could you get gdb backtrace? http://dovecot.org/bugreport.html

For the record, I see those too. I use Stephan Bosch's Debian packages.
The issue has not been there with 2:2.0.beta3-0~auto+4
(hg 10807:ba19f3c077a8), but has appeared with 2:2.0.beta3-0~auto+6 (hg
10815:1a888e13bf7f). 

#0  0x7f525ef3dc93 in epoll_wait () from /lib/libc.so.6
No symbol table info available.
#1  0x7f525f85e07a in io_loop_handler_run (ioloop=0x18495d0)
at ioloop-epoll.c:175
ctx = 0x18497e0
event = 
list = 
io = 
tv = {tv_sec = 2147483, tv_usec = 0}
t_id = 2
msecs = 2147483647
ret = 1
i = 
call = 
#2  0x7f525f85d268 in io_loop_run (ioloop=0x18495d0) at ioloop.c:350
No locals.
#3  0x7f525f84d9d3 in master_service_run (service=0x18494b0, 
callback=0x1849850) at master-service.c:478
No locals.


I also see a signal 11 in pop3 on disconnect, backtrace:

(gdb) bt full
#0  hash_table_destroy (_table=0x6ec7f0) at hash.c:110
table = 0x0
#1  0x7f82b770b9d4 in settings_parser_deinit (_ctx=)
at settings-parser.c:231
ctx = 0x6ec7c8
#2  0x7f82b7727681 in master_service_settings_cache_deinit (
_cache=) at master-service-settings-cache.c:93
cache = 0x6ddaf8
entry = 0x0
next = 0x0


And managesieve segfaults immediately at TCP connect, but I have not
managed to get a backtrace yet (it always says "core not dumped"
regardless of ulimit -c setting. I also added -D to the executable, but
no core file yet)

Feb 28 17:18:07 mail dovecot: master: service(managesieve-login): child
1168 killed with signal 11 (core not dumped)

Bernhard



[Dovecot] Dovecot 2.0.beta3 managesieve sig11 (was: Re: Dovecot 2.0.beta3: Child killed with signal 11)

2010-02-28 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

> And managesieve segfaults immediately at TCP connect, but I have not
> managed to get a backtrace yet (it always says "core not dumped"
> regardless of ulimit -c setting. I also added -D to the executable, but
> no core file yet)
>
> Feb 28 17:18:07 mail dovecot: master: service(managesieve-login): child
> 1168 killed with signal 11 (core not dumped)

(gdb) bt
#0  setting_copy (type=SET_STR, src=0x0, dest=0x24f6620, pool=0x24f4d20)
at settings-parser.c:1237
#1  0x7f47bc2e860a in settings_dup (info=, 
set=, pool=0x24f4d20) at settings-parser.c:1285
#2  0x7f47bc54d196 in login_settings_read (pool=0x24f4d20, 
local_ip=, remote_ip=, 
local_host=, other_settings_r=)
at login-settings.c:219
#3  0x7f47bc54d7b6 in client_connected_finish (conn=0x7fff7b6bc270)
at main.c:112
#4  0x7f47bc3008fd in master_service_listen (l=0x24d0188)
at master-service.c:712
#5  0x7f47bc3110e5 in io_loop_handler_run (ioloop=)
at ioloop-epoll.c:208

Bernhard



Re: [Dovecot] Dovecot 2.0.beta3 managesieve sig11

2010-02-28 Thread Bernhard Schmidt

On 28.02.2010 20:24, Timo Sirainen wrote:

On Sun, 2010-02-28 at 18:34 +, Bernhard Schmidt wrote:


And managesieve segfaults immediately at TCP connect, but I have not
managed to get a backtrace yet (it always says "core not dumped"
regardless of ulimit -c setting. I also added -D to the executable, but
no core file yet)

Feb 28 17:18:07 mail dovecot: master: service(managesieve-login): child
1168 killed with signal 11 (core not dumped)


Attached patch probably helps?


It does indeed, thank you very much.

The Thunderbird Sieve plugin is dead-slow with the new version on TLS 
connection setup (and doesn't work at all when you don't disable a Cyrus 
TLS workaround in it), but that needs more debugging.


Bernhard


Re: [Dovecot] Dovecot 2.0.beta3: Child killed with signal 11

2010-02-28 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

>> On Sun, 2010-02-28 at 16:09 +0100, Thomas Leuxner wrote:
>>> Feb 28 16:07:00 spectre dovecot: master: service(lmtp): child 17322 kille=
>> d with signal 11 (core dumps disabled)
>> Could you get gdb backtrace? http://dovecot.org/bugreport.html
>
> For the record, I see those too. I use Stephan Bosch's Debian packages.
> The issue has not been there with 2:2.0.beta3-0~auto+4
> (hg 10807:ba19f3c077a8), but has appeared with 2:2.0.beta3-0~auto+6 (hg
> 10815:1a888e13bf7f). 
>
> #0  0x7f525ef3dc93 in epoll_wait () from /lib/libc.so.6
> No symbol table info available.
> #1  0x7f525f85e07a in io_loop_handler_run (ioloop=0x18495d0)
> at ioloop-epoll.c:175
> ctx = 0x18497e0
> event = 
> list = 
> io = 
> tv = {tv_sec = 2147483, tv_usec = 0}
> t_id = 2
> msecs = 2147483647
> ret = 1
> i = 
> call = 
> #2  0x7f525f85d268 in io_loop_run (ioloop=0x18495d0) at ioloop.c:350
> No locals.
> #3  0x7f525f84d9d3 in master_service_run (service=0x18494b0, 
> callback=0x1849850) at master-service.c:478
> No locals.

Although the backtrace does not look like it, this problem also seems to
be fixed by 10817:a5b4cbf46b9b . At least that's the only change between
2:2.0.beta3-0~auto+7 (broken) and 2:2.0.beta3-0~auto+8 (good).

Bernhard



Re: [Dovecot] Dovecot 2.0b3 IDLE not advertised

2010-03-01 Thread Bernhard Schmidt
Ed W  wrote:

> Suggest drop them a line in the first instance? (You could check that 
> the COMPRESS stuff made it into the released build also since Timo 
> kindly added support for that to 2.0)

Lonelycat Games has sent me a fixed build and promised to have it
incorporated into the next version. Absolutely awesome.

Bernhard



Re: [Dovecot] Dovecot 2.0beta3: Latest HG crashed upon LMTP Delivery

2010-03-08 Thread Bernhard Schmidt
Thomas Leuxner  wrote:

> Simple LMTP handshake crashes it:

Same here. I'm pretty sure it has been introduced with one of these two
changes:

dovecot (2:2.0.beta3-0~auto+24) unstable; urgency=low

  * New revision (10855:681e1c702899) in dovecot Mercurial repository:
- zlib: Several fixes to zlib/bzlib istreams.
- Simplified up istream-limit implementation.

 -- Stephan Bosch   Mon, 08 Mar 2010 15:13:34
+0200

(+23 worked fine, crashes since installing +24).

Unfortunately Stephan has already deleted the +23 .debs from his server
so I can't verify with the old version.

Bernhard



Re: [Dovecot] Dovecot 2.0beta3: Latest HG crashed upon LMTP Delivery

2010-03-08 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

>> Simple LMTP handshake crashes it:
> Same here. I'm pretty sure it has been introduced with one of these two
> changes:

Affects dovecot-lda as well:

mail.svr02.mucip.net:/var/run/dovecot# sudo -u vmail gdb
/usr/lib/dovecot/dovecot-lda 
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/lib/dovecot/dovecot-lda...Reading symbols from
/usr/lib/debug/usr/lib/dovecot/dovecot-lda...done.
(no debugging symbols found)...done.
(gdb) set args -d berni
(gdb) run
Starting program: /usr/lib/dovecot/dovecot-lda -d berni
[Thread debugging using libthread_db enabled]
Executing new program: /usr/bin/doveconf
[Thread debugging using libthread_db enabled]
Executing new program: /usr/lib/dovecot/dovecot-lda
[Thread debugging using libthread_db enabled]
asjk

Program received signal SIGSEGV, Segmentation fault.
0x778d21c0 in message_parse_header_next (ctx=0x6427b0,
hdr_r=)
at message-header-parser.c:196
196 message-header-parser.c: Datei oder Verzeichnis nicht gefunden.
in message-header-parser.c
(gdb) bt full
#0  0x778d21c0 in message_parse_header_next (ctx=0x6427b0,
hdr_r=)
at message-header-parser.c:196
msg = 0x64c3d9 ""
i = 23591
size = 18446744073709464054
startpos = 0
colon_pos = 520
parse_size = 18446744073709464053
ret = 
continues = 
no_newline = 
crlf_newline = 
__PRETTY_FUNCTION__ = "message_parse_header_next"
#1  0x778d3a97 in parse_next_header (ctx=0x64c588,
block_r=0x7fffcca0) at message-parser.c:480
part = 0x646f10
hdr = 
size = 
ret = 
__PRETTY_FUNCTION__ = "parse_next_header"
#2  0x778d3149 in message_parser_parse_next_block (ctx=0x64c588,
block_r=0x7fffcca0)
at message-parser.c:768
ret = 23591
eof = false
full = false
__PRETTY_FUNCTION__ = "message_parser_parse_next_block"
#3  0x778d334b in message_parser_parse_header (ctx=0x64c588,
hdr_size=0x646860, 
callback=0x77b83a90 ,
context=0x646648) at message-parser.c:807
block = {part = 0x646f10, hdr = 0x6427b0, data = 0x77b83a90
"\351\063\341\373\377ff.\017\037\204", 
  size = 0}
ret = 
__PRETTY_FUNCTION__ = "message_parser_parse_header"

I'm now on +27 (10867:c56358283605), still crashing.

Bernhard



[Dovecot] 2.0beta3 10876:370ee9717a6c broke listen on literal IPv6 address

2010-03-09 Thread Bernhard Schmidt
Hi,

apparently the following change in dovecot hg

  * New revision (10876:370ee9717a6c) in dovecot Mercurial repository:
- config: Forgot to add header file.

broke 

listen = 83.170.6.69, 2001:1b10:1000::110:1:1

mail.svr02.mucip.net:~# dovecot -F -c /etc/dovecot/dovecot.conf 
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29:
listen=..:port has been replaced by service { inet_listener { port } }
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf:
duplicate listener: 1:

Is this even possible? That doesn't make sense to me, but Stephan's +29
works fine for me, +30 (with just that change according to changelog)
doesn't.

Bernhard



Re: [Dovecot] Dovecot 2.0beta3: Latest HG crashed upon LMTP Delivery

2010-03-09 Thread Bernhard Schmidt
Thomas Leuxner  wrote:

>> Yeah, it's this one. I'll probably revert it soon. I did it mostly while
>> trying to fix istream-zlib bugs, but hopefully zlib won't break when
>> that change is reverted :) Started my stress test again..
> Just tested and does not appear to be fixed by changeset 10875
> 1473de6ba383. Still crashes.

I'm a bit confused.

My local build of Stephan Bosch's +28 package (containing everything up to
10869) plus 10875:1473de6ba383 is fine. Stephan's +29 package which
supposedly contains everything up to 10875 is broken (crash in
LMTP/deliver). At the same time +29 is fine regarding the IPv6 listen
address (although my prime suspects, "config: Added support for reading
v1.2 config files." and "master: Don't complain about duplicate
inet_listeners with port=0 (they're ignored)." are supposedly included),
while +30 breaks.

Stephan, could you check whether your changelog vs. content is in sync?

Bernhard



Re: [Dovecot] 2.0beta3 10876:370ee9717a6c broke listen on literal IPv6 address

2010-03-10 Thread Bernhard Schmidt

On 09.03.2010 18:42, Timo Sirainen wrote:

On 9.3.2010, at 14.47, Bernhard Schmidt wrote:


  * New revision (10876:370ee9717a6c) in dovecot Mercurial repository:
- config: Forgot to add header file.

mail.svr02.mucip.net:~# dovecot -F -c /etc/dovecot/dovecot.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29:
listen=..:port has been replaced by service { inet_listener { port } }
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf:
duplicate listener: 1:


Doesn't look like :-(

mail.svr02.mucip.net:~# dovecot -F -c /etc/dovecot/dovecot.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29: 
listen=..:port has been replaced by service { inet_listener { port } }
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: 
duplicate listener: 1:


This was/is 10886:f49bb060d83d

Bernhard


[Dovecot] Dovecot 2.0beta3 LMTP hanging when delivering into a non-existing mailbox

2010-03-12 Thread Bernhard Schmidt
Hi,

another LMTP problem. When a sieve userscript tries to fileinto a
nonexisting mailbox the LMTP process hangs.

Mar 12 12:55:28 mail dovecot: lmtp(1328, be...@vmail.mail.mucip.net):
kPpuOKArmkswBQAA/GZUZg: sieve:
msgid=<201003111751.o2bhptbx069...@squid-cache.org>: failed to store
into mailbox 'squidbugs': Mailbox doesn't exist: squidbugs

after that I cannot get a LMTP connection anymore (TCP connect works,
but I don't see a server banner) until I send SIGKILL to the running
lmtp process. SIGTERM is not enough.

strace looks like this:
gettimeofday({1268394998, 961094}, NULL) = 0
stat("/var/cache/dovecot/b/berni/.squidbugs", 0x7fff202e5040) = -1
ENOENT (No such file or directory)
stat("/var/mail/vmail/b/berni/.squidbugs", 0x7fff202e5000) = -1 ENOENT
(No such file or directory)
stat("/var/mail/vmail/b/berni", {st_mode=S_IFDIR|0700, st_size=4096,
...}) = 0
stat("/var/mail/vmail/b/berni/.squidbugs", 0x7fff202e5000) = -1 ENOENT
(No such file or directory)
stat("/var/mail/vmail/b/berni", {st_mode=S_IFDIR|0700, st_size=4096,
...}) = 0
stat("/var/mail/vmail/b/berni/.squidbugs/tmp", 0x7fff202e5070) = -1
ENOENT (No such file or directory)
stat("/var/mail/vmail/b/berni/.squidbugs", 0x7fff202e5120) = -1 ENOENT
(No such file or directory)
write(2, "\1\0041337 llrFJeUrmks5BQAA/GZUZg: s"..., 166) = 166
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({86400, 0},   

I'm on 10869:bf978f2de0fd.

Bernhard



Re: [Dovecot] 2.0beta3 10876:370ee9717a6c broke listen on literal IPv6 address

2010-03-14 Thread Bernhard Schmidt
Timo Sirainen  wrote:

>> mail.svr02.mucip.net:~# dovecot -F -c /etc/dovecot/dovecot.conf 
>> doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29:
>> listen=..:port has been replaced by service { inet_listener { port } }
>> doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf:
>> duplicate listener: 1:
> Should be fixed now.

Still there in 10906:841af633f8d0

Bernhard



Re: [Dovecot] Dovecot 2.0beta3 LMTP hanging when delivering into a non-existing mailbox

2010-03-16 Thread Bernhard Schmidt
Timo Sirainen  wrote:

Hi Timo,

>> another LMTP problem. When a sieve userscript tries to fileinto a
>> nonexisting mailbox the LMTP process hangs.
>> I'm on 10869:bf978f2de0fd.
> It was fixed by the next changeset:
> http://hg.dovecot.org/dovecot-2.0/rev/6d260794f278

Ah right, did not use that before because of the IPv6 listening problem.
Thanks.

bernhard



Re: [Dovecot] 2.0beta3 10876:370ee9717a6c broke listen on literal IPv6 address

2010-03-19 Thread Bernhard Schmidt
Timo Sirainen  wrote:

> On Wed, 2010-03-10 at 18:01 +0100, Bernhard Schmidt wrote:
>> mail.svr02.mucip.net:~# dovecot -F -c /etc/dovecot/dovecot.conf
>> doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:29:=20
>> listen=3D..:port has been replaced by service { inet_listener { port } }
>> doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf:=20
>> duplicate listener: 1:
> OK, now it really should be fixed.

Confirmed.

Bernhard



[Dovecot] 2.0 beta: LMTP + Sieve fileinto broken

2010-03-20 Thread Bernhard Schmidt
Hoi,

somewhere between Hg revisions 10945 and 10962 filing into a subfolder
using sieve Scripts (like fileinto "fwd.sixxs" here) broke

Mar 20 18:14:24 mail dovecot: lmtp(27326, be...@vmail.mail.mucip.net):
ojJwL3ACpUu+agAA/GZUZg:
msgid=: save failed to
fwd.sixxs: Mailbox doesn't exist: fwd.sixxs

Used to work fine before.

Bernhard



Re: [Dovecot] 2.0 beta: LMTP + Sieve fileinto broken

2010-03-20 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

> somewhere between Hg revisions 10945 and 10962 filing into a subfolder
> using sieve Scripts (like fileinto "fwd.sixxs" here) broke

Disregard, stupid me broke his lmtp.conf on upgrade.

Bernhard



Re: [Dovecot] 2.0 beta: LMTP + Sieve fileinto broken

2010-03-20 Thread Bernhard Schmidt
Thomas Leuxner  wrote:

>> somewhere between Hg revisions 10945 and 10962 filing into a subfolder
>> using sieve Scripts (like fileinto "fwd.sixxs" here) broke
> Hmmm. Works for me with 10962 but there's quite a bunch of changes =
> inbetween...

I'm a bit confused as well.  I accidentally dropped "mail_plugins =
sieve quota" from lmtp.conf on upgrade. Since I don't have a global
mail_plugins setting yet it would have disabled Sieve completely.
However, the first few deliveries showed this "does not exist" error,
but then all of the sudden everything was delivered into INBOX without
any hint of sieve at all. Maybe an old leftover process from before the
upgrade.

After reenabling mail_plugins it works fine again.

Bernhard



[Dovecot] 2.0.beta3 imapd running hot

2010-03-20 Thread Bernhard Schmidt
Hi,

since a couple of weeks I occasionally have an imapd going crazy on me,
using up 100% CPU. Current revision is 10962

29865 vmail 20   0 47820 3296 1708 R 99.7  0.9 131:07.85 imap

vmail29865 86.1  0.8  47820  3296 ?RMar20 131:20
dovecot/imap [berni 2001:a60:f001:1:219:66ff:fe8b:a6e IDLE

strace -p  shows a repeating pattern of

epoll_wait(8, {{EPOLLOUT, {u32=36560672, u64=36560672}}}, 5, 4872) = 1
gettimeofday({1269133967, 495298}, NULL) = 0
gettimeofday({1269133967, 495333}, NULL) = 0
gettimeofday({1269133967, 495370}, NULL) = 0

with the last argument of epoll_wait (4872) slowly decrementing and then
wrapping around to ~30k.

Attaching gdb shows the following backtrace:

(gdb) bt full
#0  array_idx_i (ioloop=0x22bd5f0) at array.h:189
No locals.
#1  io_loop_handler_run (ioloop=0x22bd5f0) at ioloop-epoll.c:188
ctx = 0x22bd800
event = 
list = 
io = 
tv = {tv_sec = 26, tv_usec = 307176}
t_id = 2
msecs = 26308
ret = 1
i = 
call = 
#2  0x7f8f682bc8e8 in io_loop_run (ioloop=0x22bd5f0) at ioloop.c:350
No locals.
#3  0x7f8f682acd63 in master_service_run (service=0x22bd4c0,
callback=0x6590) at master-service.c:486
No locals.
#4  0x00418551 in main (argc=1, argv=0x22bd3a0) at main.c:313
set_roots = {0x41b840, 0x0}
service_flags = 
storage_service_flags = MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT
postlogin_socket_path = 0x0
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x7fffed1ff9ad in gettimeofday ()
(gdb) bt full
#0  0x7fffed1ff9ad in gettimeofday ()
No symbol table info available.
#1  0x7f8f6795f02a in gettimeofday () from /lib/libc.so.6
No symbol table info available.
#2  0x7f8f682bcb39 in io_loop_handle_timeouts_real
(ioloop=0x22bd5f0) at ioloop.c:291
item = 
tv = {tv_sec = 0, tv_usec = 36427248}
tv_call = {tv_sec = 0, tv_usec = 140737170938560}
t_id = 
#3  io_loop_handle_timeouts (ioloop=0x22bd5f0) at ioloop.c:339
_data_stack_cur_id = 0
#4  0x7f8f682bd70e in io_loop_handler_run (ioloop=0x22bd5f0) at
ioloop-epoll.c:180
ctx = 0x22bd800
event = 
list = 
io = 
tv = {tv_sec = 28, tv_usec = 267997}
t_id = 2
msecs = 28268
ret = 1
i = 
call = 
#5  0x7f8f682bc8e8 in io_loop_run (ioloop=0x22bd5f0) at ioloop.c:350
No locals.
#6  0x7f8f682acd63 in master_service_run (service=0x22bd4c0,
callback=0) at master-service.c:486
No locals.
#7  0x00418551 in main (argc=1, argv=0x22bd3a0) at main.c:313
set_roots = {0x41b840, 0x0}
service_flags = 
storage_service_flags = MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT
postlogin_socket_path = 0x0

doveconf -n:

mail.svr02.mucip.net:~# doveconf -n
# 2.0.beta3: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.33 x86_64 Debian squeeze/sid 
auth_mechanisms = plain login
disable_plaintext_auth = no
listen = 83.170.6.69, 2001:1b10:1000::110:1:1
mail_gid = 5000
mail_location = maildir:%h/:INDEX=/var/cache/dovecot/%1n/%n
mail_uid = 5000
maildir_stat_dirs = yes
maildir_very_dirty_syncs = yes
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
plugin {
  quota = dict:user::file:%h/dovecot-quota
  quota_rule = *:storage=500M
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmas...@birkenwald.de
protocols = imap pop3 lmtp managesieve
quota_full_tempfail = yes
service auth {
  unix_listener /var/spool/postfix-mailout/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = vmail
mode = 0660
  }
}
service imap-login {
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
}
service lmtp {
  inet_listener {
port = 24
  }
}
service managesieve-login {
  inet_listener sieve_deprecated {
port = 2000
  }
  process_min_avail = 1
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
ssl_cert = 

Re: [Dovecot] 2.0.beta3 imapd running hot

2010-03-22 Thread Bernhard Schmidt

On 21.03.2010 15:17, Timo Sirainen wrote:

Hi,


strace -p  shows a repeating pattern of

epoll_wait(8, {{EPOLLOUT, {u32=36560672, u64=36560672}}}, 5, 4872) = 1
gettimeofday({1269133967, 495298}, NULL) = 0
gettimeofday({1269133967, 495333}, NULL) = 0
gettimeofday({1269133967, 495370}, NULL) = 0


So nothing else? It looks like some function is being called over and
over again that "you can write more data to client", but the function
then does nothing.


No, nothing else (I could see).


Attaching gdb shows the following backtrace:

It would be helpful to find out what the I/O function is that is being
called. For example:


I'll try to get your debug output.

I'm pretty sure it's related to the imap_zlib plugin, I haven't had one 
single problem since I disabled it. I'll reenable and go tracing.


Bernhard


Re: [Dovecot] 2.0.beta3 imapd running hot

2010-03-28 Thread Bernhard Schmidt

On 21.03.2010 15:17, Timo Sirainen wrote:

Hi Timo,


It would be helpful to find out what the I/O function is that is being
called. For example:

b ioloop-epoll.c:208
p *io
cont
p *io
cont
..etc..

What is the *io output? If it's client_output() or something else as
generic.. Use "step" to get into the function then then:

p *client
p *client.output_lock
p client.command_queue[0]
p client.command_queue[1]
p client.command_queue[2]


(gdb) bt
#0  stream_send_io (fstream=0x179a570) at ostream-file.c:464
#1  0x7fbaa9a69775 in io_loop_handler_run (ioloop=out>) at ioloop-epoll.c:208

#2  0x7fbaa9a688f8 in io_loop_run (ioloop=0x177e5f0) at ioloop.c:350
#3  0x7fbaa9a58d63 in master_service_run (service=0x177e4c0, 
callback=0) at master-service.c:486

#4  0x004186c1 in main (argc=1, argv=0x177e3a0) at main.c:323
(gdb) b ioloop-epoll.c:208
Breakpoint 1 at 0x7fbaa9a69767: file ioloop-epoll.c, line 208.
(gdb) p *io
No symbol "io" in current context.
(gdb) cont
Continuing.

Breakpoint 1, io_loop_handler_run (ioloop=) at 
ioloop-epoll.c:208

208 ioloop-epoll.c: Datei oder Verzeichnis nicht gefunden.
in ioloop-epoll.c
(gdb) p *io
$1 = {io = {condition = IO_WRITE, callback = 0x7fbaa9a715c0 
, context = 0x179a570, ioloop = 0x177e5f0},

  prev = 0x182a460, next = 0x177f350, refcount = 1, fd = 10}
(gdb)

(gdb) cont
Continuing.

Breakpoint 1, io_loop_handler_run (ioloop=) at 
ioloop-epoll.c:208

208 in ioloop-epoll.c
(gdb) p *io
$2 = {io = {condition = IO_WRITE, callback = 0x7fbaa9a715c0 
, context = 0x179a570, ioloop = 0x177e5f0},

  prev = 0x182a460, next = 0x177f350, refcount = 1, fd = 10}
(gdb) step
207 in ioloop-epoll.c
(gdb) p *client
No symbol "client" in current context.

I am pretty sure it is related to imap_zlib ... at least this did not 
happen when I disabled the plugin.


I'm on revision 10993 at the moment.

Bernhard


[Dovecot] zlib delivery in 2.0beta6

2010-06-13 Thread Bernhard Schmidt
Hi,

I just wanted to test the zlib plugin in Dovecot 2.0 and have a problem.
Delivery via LMTP works fine and the mail is saved compressed.

-rw--- 1 vmail vmail 1012 13. Jun 12:51
1276426292.M93539P15363.mail.svr02.mucip.net,S=2799,W=2850:2,
# file 1276426292.M93539P15363.mail.svr02.mucip.net,S=2799,W=2850:2,
1276426292.M93539P15363.mail.svr02.mucip.net,S=2799,W=2850:2,: gzip
compressed data, from Unix
# zcat 1276426292.M93539P15363.mail.svr02.mucip.net,S=2799,W=2850:2, |
wc
 51 2772799

But a client (both Thunderbird and Mutt) cannot access the mail.

Jun 13 12:53:55 mail dovecot: imap-login: Login: user=,
method=PLAIN, rip=2001:a60:f001:1:219:66ff:fe8b:a6e,
lip=2001:1b10:1000::110:1:1, mpid=15416, TLS
Jun 13 12:53:55 mail dovecot: imap(bernilrz): Error: FETCH [] for
mailbox unsorted UID 33930 got too little data: 1018 vs 2850
Jun 13 12:53:55 mail dovecot: imap(bernilrz): Error: Maildir filename
has wrong W value:
/var/mail/vmail/b/bernilrz/.unsorted/cur/1276426292.M93539P15363.mail.svr02.mucip.net,S=2799,W=2850
Jun 13 12:53:55 mail dovecot: imap(bernilrz): Error: Corrupted index
cache file /var/cache/dovecot/b/bernilrz/.unsorted/dovecot.index.cache:
Broken virtual size for mail UID 33930
Jun 13 12:53:55 mail dovecot: imap(bernilrz): Disconnected: FETCH failed
bytes=124/1952

I figured the cache might just be corrupt and I deleted all cachefiles,
but the issue keeps reappearing.

Has anyone done this before?

Config:
# 2.0.beta6 (7a02b84ad7f5): /etc/dovecot/dovecot.conf
# OS: Linux 2.6.33.4 x86_64 Debian squeeze/sid 
default_login_user = dovecot
disable_plaintext_auth = no
listen = 83.170.6.69, 2001:1b10:1000::110:1:1
mail_gid = vmail
mail_location = maildir:%h/:INDEX=/var/cache/dovecot/%1n/%n
mail_uid = vmail
maildir_stat_dirs = yes
maildir_very_dirty_syncs = yes
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
plugin {
  quota = dict:user::file:%h/dovecot-quota
  quota_rule = *:storage=500M
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
  zlib_save = gz
  zlib_save_level = 6
}
postmaster_address = postmas...@birkenwald.de
protocols = imap pop3 lmtp managesieve
quota_full_tempfail = yes
service auth {
  unix_listener /var/spool/postfix-mailout/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
  }
  unix_listener auth-userdb {
group = vmail
mode = 0660
  }
}
service lmtp {
  inet_listener {
port = 24
  }
}
service managesieve-login {
  inet_listener sieve_deprecated {
port = 2000
  }
  process_min_avail = 1
}
ssl_cert = 

[Dovecot] AUTH PLAIN error with Thunderbird and Dovecot 1.2

2009-07-05 Thread Bernhard Schmidt
Hi,

a few days ago I started to get some complaints about authentication
delays from Thunderbird POP3 users. After some debugging it turned out
that the problem was introduced somewhere between 1.2rc3 and 1.2rc7
(1.2.0 is still affected).

A session with Thunderbird 2.0.0.22 against 1.2rc3 looks like this:

<<< +OK Dovecot ready.
>>> CAPA
<<< +OK
<<< CAPA
<<< TOP
<<< UIDL
<<< RESP-CODES
<<< PIPELINING
<<< STLS
<<< USER
<<< SASL PLAIN LOGIN
<<< .
>>> AUTH PLAIN
<<< + 
>>> 
<<< +OK Logged in.

and with 1.2.0 (same client, same config, just replaced the server
binaries)

<<< +OK Dovecot ready.
>>> CAPA
<<< +OK
<<< CAPA
<<< TOP
<<< UIDL
<<< RESP-CODES
<<< PIPELINING
<<< STLS
<<< USER
<<< SASL PLAIN LOGIN
<<< .
>>> AUTH PLAIN
[ 2 seconds delay ]
<<< -ERR Authentication failed.
>>> AUTH LOGIN
[ 5 seconds delay ]
<<< + 
>>> 
<<< + 
>>> 
<<< +OK Logged in.

In the log I see

mail dovecot: auth(default): plain(?,77.2.39.xx): invalid input

Does anyone have an idea? 

# dovecot -n
# 1.2.0: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.28.2 x86_64 Debian squeeze/sid ext4
protocols: imap imaps pop3 pop3s managesieve
listen: *, [::]
ssl_cert_file: /etc/ssl/private/pop3.mucip.net.crt
ssl_key_file: /etc/ssl/private/pop3.mucip.net.key
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/dovecot/pop3-login
login_executable(managesieve):
/usr/lib/dovecot/dovecot/managesieve-login
login_process_per_connection: no
verbose_proctitle: yes
mail_uid: 5000
mail_gid: 5000
mail_location:
maildir:/var/mail/vmail/%1u/%u:INDEX=/var/cache/dovecot/%1u/%u
maildir_stat_dirs: yes
mail_executable(default): /usr/lib/dovecot/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/dovecot/managesieve
mail_plugins(default): quota imap_quota fts fts_squat
mail_plugins(imap): quota imap_quota fts fts_squat
mail_plugins(pop3): 
mail_plugins(managesieve): 
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/managesieve
imap_idle_notify_interval(default): 900
imap_idle_notify_interval(imap): 900
imap_idle_notify_interval(pop3): 120
imap_idle_notify_interval(managesieve): 120
auth default:
  mechanisms: plain login
  verbose: yes
  passdb:
driver: ldap
args: /etc/dovecot/dovecot-ldap.conf
  userdb:
driver: ldap
args: /etc/dovecot/dovecot-ldap.conf
  socket:
type: listen
client:
  path: /var/spool/postfix-mailout/private/auth
  mode: 432
  user: postfix
  group: postfix
master:
  path: /var/run/dovecot/auth-master
  mode: 384
  user: vmail
plugin:
  quota: maildir
  quota_rule: *:storage=500M


Thanks,
Bernhard



Re: [Dovecot] AUTH PLAIN error with Thunderbird and Dovecot 1.2

2009-07-05 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

> a few days ago I started to get some complaints about authentication
> delays from Thunderbird POP3 users. After some debugging it turned out
> that the problem was introduced somewhere between 1.2rc3 and 1.2rc7
> (1.2.0 is still affected).

Reverting 76d455a7f4da ("auth: If initial SASL reply was given but
empty, pass it to auth mechanisms.") fixes the problem for me.

Bernhard



Re: [Dovecot] init-script update for v2.0

2009-11-25 Thread Bernhard Schmidt
Pascal Volk  wrote:

>   * Added LSB-compliant info block (for insserv and friends)

[...]

> +# Required-Start:$local_fs $syslog
> +# Required-Stop: $local_fs $syslog
> +# Should-Start:  $time

I think this should be $remote_fs, as according to
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/facilname.html
and http://wiki.debian.org/LSBInitScripts /usr (where dovecot probably
is located) could be mounted from remote.

Also I guess $network is a good idea in Required-Start/Stop.

Bernhard



[Dovecot] LMTP crash with sdbox and SIS

2013-06-12 Thread Bernhard Schmidt
Debian Wheezy amd64 plus Stefan's stable-auto/dovecot2.2 repository
2:2.2.2-0~auto+57 = 16495:d447dcc6b611

Crash goes away when I disable mail_attachment_dir, happens with a
fresh home as well

# 2.2.2 (d447dcc6b611): /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.0 
disable_plaintext_auth = no
first_valid_uid = 100
mail_attachment_dir = /home/studext/attachment
mail_gid = ext
mail_location = sdbox:~/sdbox:INDEX=~/Index
mail_plugins = quota
mail_uid = studext
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope
encoded-character vacation subaddress comparator-i;ascii-numeric
relational regex imap4flags copy include variables body enotify
environment mailbox date ihave
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix = INBOX.
  separator = .
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
plugin {
  quota = dict:User quota::file:%h/Maildir/dovecot-quota
  quota_rule = INBOX.Trash:ignore
  quota_rule2 = ?:storage=512M
  sieve = ~/currently-active-script.sieve
  sieve_dir = ~/sieve
}
protocols = " imap lmtp sieve pop3"
service lmtp {
  executable = lmtp -D
  inet_listener lmtp {
port = 24
  }
}
ssl_cert = , 
status=status@entry=0) at failures.c:191
backtrace = 0x97e900 "/usr/lib/dovecot/libdovecot.so.0(+0x62dea) 
[0x7fc2712cbdea] -> /usr/lib/dovecot/libdovecot.so.0(+0x62e2e) [0x7fc2712cbe2e] 
-> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7fc27128bda5] -> 
/usr/lib/d"...
#3  0x7fc2712cbe2e in i_internal_fatal_handler (ctx=0x7fff6b38a7c0, 
format=, args=)
at failures.c:652
status = 0
#4  0x7fc27128bda5 in i_panic (format=format@entry=0x7fc2712f18c8 "file %s: 
line %d (%s): assertion failed: (%s)")
at failures.c:263
ctx = {type = LOG_TYPE_PANIC, exit_status = 0, timestamp = 0x0}
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7fff6b38a8b0, reg_save_area = 0x7fff6b38a7f0}}
#5  0x7fc2712d4734 in i_stream_read (stream=0x9c3740) at istream.c:163
_stream = 0x9c36e0
old_size = 0
ret = -1
__FUNCTION__ = "i_stream_read"
#6  0x7fc2715ca2c9 in index_attachment_save_continue (ctx=0x9b7ef0) at 
index-attachment.c:206
storage = 0x9ae590
attach = 0x9c3310
data = 
size = 1
ret = 
#7  0x7fc2715a78a8 in mail_storage_try_copy (mail=0x9a3c60, 
_ctx=0x7fff6b38a928) at mail-copy.c:80
ctx = 0x9b7ef0
pmail = 0x9a3c60
input = 0x9b57c0
#8  mail_storage_copy (ctx=ctx@entry=0x9b7ef0, mail=mail@entry=0x9a3c60) at 
mail-copy.c:101
No locals.
#9  0x7fc271576810 in sdbox_copy (_ctx=, mail=) at sdbox-copy.c:172
ctx = 
_t = 
mbox = 
__FUNCTION__ = "sdbox_copy"
#10 0x7fc2706b1320 in quota_copy (ctx=0x9b7ef0, mail=0x9a3c60) at 
quota-storage.c:220
t = 0x9b4b70
qt = 0x9b7e80
qbox = 0x9b2450
#11 0x7fc2715afadf in mailbox_copy (_ctx=_ctx@entry=0x7fff6b38aaa8, 
mail=0x9a3c60) at mail-storage.c:2116
ctx = 0x9b7ef0
t = 0x9b4b70
keywords = 0x0
pvt_flags = 0
---Type  to continue, or q  to quit---
real_mail = 
ret = 
__FUNCTION__ = "mailbox_copy"
#12 0x7fc2715afb8c in mailbox_save_using_mail 
(ctx=ctx@entry=0x7fff6b38aaa8, mail=) at mail-storage.c:2147
No locals.
#13 0x7fc27184ddde in mail_deliver_save (ctx=ctx@entry=0x7fff6b38ac10, 
mailbox=, flags=flags@entry=0, 
keywords=keywords@entry=0x0, storage_r=storage_r@entry=0x7fff6b38abe8) at 
mail-deliver.c:311
open_ctx = {user = 0x9aa470, lda_mailbox_autocreate = false, 
lda_mailbox_autosubscribe = false}
box = 0x9b1e80
trans_flags = 
t = 0x9b4b70
save_ctx = 0x0
headers_ctx = 0x0
kw = 0x0
error = MAIL_ERROR_NONE
mailbox_name = 0x40892f "INBOX"
errstr = 
guid = 0x7fc271847d98 "W\n"
changes = {pool = 0x7fc271a52788, uid_validity = 1798876136, saved_uids 
= {arr = {buffer = 0x9992d0, 
  element_size = 140473107114581}, v = 0x9992d0, v_modifiable = 
0x9992d0}, ignored_modseq_changes = 10165232, 
  changed = false, no_read_perm = false}
default_save = 
ret = 0
__FUNCTION__ = "mail_deliver_save"
#14 0x7fc27184e203 in mail_deliver (ctx=ctx@entry=0x7fff6b38ac10, 
storage_r=storage_r@entry=0x7fff6b38abe8)
at mail-deliver.c:413
ret = -1
#15 0x00406282 in client_deliver (session=0x9a8480, src_mail=0x9a3c60, 
rcpt=0x98b770, client=0x98af00) at commands.c:689
lda_set = 0x999b00
ns = 
set_parser = 
line = 
storage = 0x9ae590
sets = 
mail_error = MAIL_ERROR_NONE

Re: [Dovecot] LMTP crash with sdbox and SIS

2013-06-12 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

> Debian Wheezy amd64 plus Stefan's stable-auto/dovecot2.2 repository
> 2:2.2.2-0~auto+57 = 16495:d447dcc6b611
>
> Crash goes away when I disable mail_attachment_dir, happens with a
> fresh home as well

Log:

Jun 12 21:46:23 lxmhs69 dovecot: lmtp(20120,
ext44...@mstoretest.mail.xxx.de): Panic: file istream.c: line 163
(i_stream_read): assertion failed: (old_size == _stream->pos -
_stream->skip)
Jun 12 21:46:23 lxmhs69 dovecot: lmtp(20120,
ext44...@mstoretest.mail.xxx.de): Error: Raw backtrace:
/usr/lib/dovecot/libdovecot.so.0(+0x62dea) [0x7fc8363e9dea] ->
/usr/lib/dovecot/libdovecot.so.0(+0x62e2e) [0x7fc8363e9e2e] ->
/usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7fc8363a9da5] ->
/usr/lib/dovecot/libdovecot.so.0(i_stream_read+0x184) [0x7fc8363f2734]
->
/usr/lib/dovecot/libdovecot-storage.so.0(index_attachment_save_continue+0x29)
[0x7fc8366e82c9] ->
/usr/lib/dovecot/libdovecot-storage.so.0(mail_storage_copy+0x78)
[0x7fc8366c58a8] ->
/usr/lib/dovecot/libdovecot-storage.so.0(sdbox_copy+0x60)
[0x7fc836694810] ->
/usr/lib/dovecot/modules/lib10_quota_plugin.so(+0xb320) [0x7fc8357cf320]
-> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_copy+0x5f)
[0x7fc8366cdadf] ->
/usr/lib/dovecot/libdovecot-lda.so.0(mail_deliver_save+0x16e)
[0x7fc83696bdde] ->
/usr/lib/dovecot/libdovecot-lda.so.0(mail_deliver+0x113)
[0x7fc83696c203] -> dovecot/lmtp() [0x406282] ->
/usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x36) [0x7fc8363f9996]
-> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0xd7)
[0x7fc8363fa807] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x28)
[0x7fc8363f94d8] ->
/usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13)
[0x7fc8363af013] -> dovecot/lmtp(main+0x184) [0x404c24] ->
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fc83601bead]
-> dovecot/lmtp() [0x404ce9]

Regards,
Bernhard



Re: [Dovecot] LMTP crash with sdbox and SIS

2013-06-13 Thread Bernhard Schmidt

Am 13.06.2013 03:56, schrieb Timo Sirainen:


On Wed, 2013-06-12 at 19:51 +, Bernhard Schmidt wrote:

Debian Wheezy amd64 plus Stefan's stable-auto/dovecot2.2 repository
2:2.2.2-0~auto+57 = 16495:d447dcc6b611

Crash goes away when I disable mail_attachment_dir, happens with a
fresh home as well

..

Jun 12 21:46:23 lxmhs69 dovecot: lmtp(20120,
ext44...@mstoretest.mail.xxx.de): Panic: file istream.c: line 163
(i_stream_read): assertion failed: (old_size == _stream->pos -
_stream->skip)


Can you easily reproduce this? Does it happen with all mails? Only mails
that contain attachments? Only one specific mail? I couldn't reproduce
with a couple of tests.


I can reproduce with mails with a random attachment > 128k. I'm using 
smtp-cli to test


dd if=/dev/random of=random1M bs=1M count=1
./smtp-cli-3.2 --server   --from  --to  
--subject Test --attach=random1M


I can send you a sample.

Bernhard


[Dovecot] lmtp_rcpt_check_quota not working

2014-02-10 Thread Bernhard Schmidt
Hi,

Dovecot 2.2.9 (Debian package from backports) does not seem to respect
lmtp_rcpt_check_quota

# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.4 
deliver_log_format = from=<%e>, size=%p, message-id=<%m>, status=%$
disable_plaintext_auth = no
lmtp_rcpt_check_quota = yes
mail_debug = yes
mail_gid = mstore
mail_location = maildir:~/Maildir:INDEX=/var/cache/dovecot/index/%-1.1u/%u
mail_plugins = quota
mail_uid = mstore
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date ihave
mmap_disable = yes
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = subscribe
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix = INBOX.
  separator = .
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
plugin {
  quota = maildir
  quota_rule = ?:storage=512M
  quota_rule2 = INBOX.Trash:ignore
  quota_status_nouser = DUNNO
  quota_status_overquota = 452 4.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=85%% quota-warning 85 %u
  sieve = ~/currently-active-script.sieve
  sieve_dir = ~/sieve
}
pop3_uidl_format = %08Xv%08Xu
protocols = imap lmtp sieve pop3
quota_full_tempfail = yes
service anvil {
  client_limit = 3000
  unix_listener anvil {
group = sudo
mode = 0660
  }
}
service auth {
  client_limit = 3000
  unix_listener auth-userdb {
group = mstore
mode = 0660
user = mstore
  }
}
service imap-login {
  client_limit = 1024
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
  process_limit = 2500
  process_min_avail = 4
  service_count = 0
}
service lmtp {
  inet_listener lmtp {
address = xxx
port = 24
  }
}
service managesieve-login {
  inet_listener sieve {
port = 2000
  }
  service_count = 1
}
service managesieve {
  process_limit = 1024
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service quota-status {
  client_limit = 5
  executable = quota-status -p postfix
  inet_listener {
address = xxx
port = 12340
  }
}
service quota-warning {
  executable = script /etc/dovecot/quotawarnmsg.sh
  unix_listener quota-warning {
user = mstore
  }
  user = mstore
}
ssl_cert =  Quota exceeded (mailbox for user is
full) (in reply to end of DATA command))

I haven't seen any commits regarding to this in 2.2.10 or tip.

Regards,
Bernhard


Re: [Dovecot] lmtp_rcpt_check_quota not working

2014-02-13 Thread Bernhard Schmidt
Axel Luttgens  wrote:

Hi Axel,

> Le 11 févr. 2014 à 08:34, Bernhard Schmidt a écrit :
>
>> [...]
>> so Dovecot should reject in RCPT TO phase, but according to the logs of the 
>> upstream Postfix it does so after END-OF-DATA
>> 
>> (host xxx[2001:xxx] said: 452 4.2.2
>>  Quota exceeded (mailbox for user is
>> full) (in reply to end of DATA command))
>> [...]
>
> Hello Bernhard,
>
> Could you exercise your quota-status service with variations of:
>
>   # telnet xxx 12340
>   Trying xxx...
>   Connected to xxx.
>   Escape character is '^]'.
>   recipient=john@example.com
>   size=100
>
>   action=OK
>
>   ^]
>
> and see whether the replies are the expected one?
>
> If yes, this would point to some error in Postfix' configuration.
>
> If not, well... could be you are facing the same kind of problem I'm
> having here (never managed to have the service reply anything else
> than "OK" or "REJECT Unknown user"...)

quota-status works absolutely fine, our frontend MXes defer mails for
mailboxes over quota. But when we try to send a mail to the mailbox
nevertheless through LMTP (i.e. because it was generated on a server
that doesn't check quota-status), it is deferred in LMTP in the
END-OF-DATA phase, not in RCPT TO as expected.

Bernhard


Re: [Dovecot] lmtp_rcpt_check_quota not working

2014-05-08 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

Hi Timo,

in case you missed that...

> Hi,
>
> Dovecot 2.2.9 (Debian package from backports) does not seem to respect
> lmtp_rcpt_check_quota
>
> # 2.2.9: /etc/dovecot/dovecot.conf
> # OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.4 
> deliver_log_format = from=<%e>, size=%p, message-id=<%m>, status=%$
> disable_plaintext_auth = no
> lmtp_rcpt_check_quota = yes
> mail_debug = yes
> mail_gid = mstore
> mail_location = maildir:~/Maildir:INDEX=/var/cache/dovecot/index/%-1.1u/%u
> mail_plugins = quota
> mail_uid = mstore
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character 
> vacation subaddress comparator-i;ascii-numeric relational regex imap4flags 
> copy include variables body enotify environment mailbox date ihave
> mmap_disable = yes
> namespace inbox {
>   inbox = yes
>   location = 
>   mailbox Drafts {
> auto = subscribe
> special_use = \Drafts
>   }
>   mailbox Junk {
> auto = subscribe
> special_use = \Junk
>   }
>   mailbox Sent {
> auto = subscribe
> special_use = \Sent
>   }
>   mailbox "Sent Messages" {
> special_use = \Sent
>   }
>   mailbox Trash {
> auto = subscribe
> special_use = \Trash
>   }
>   prefix = INBOX.
>   separator = .
>   type = private
> }
> passdb {
>   args = /etc/dovecot/dovecot-ldap.conf
>   driver = ldap
> }
> plugin {
>   quota = maildir
>   quota_rule = ?:storage=512M
>   quota_rule2 = INBOX.Trash:ignore
>   quota_status_nouser = DUNNO
>   quota_status_overquota = 452 4.2.2 Mailbox is full
>   quota_status_success = DUNNO
>   quota_warning = storage=95%% quota-warning 95 %u
>   quota_warning2 = storage=85%% quota-warning 85 %u
>   sieve = ~/currently-active-script.sieve
>   sieve_dir = ~/sieve
> }
> pop3_uidl_format = %08Xv%08Xu
> protocols = imap lmtp sieve pop3
> quota_full_tempfail = yes
> service anvil {
>   client_limit = 3000
>   unix_listener anvil {
> group = sudo
> mode = 0660
>   }
> }
> service auth {
>   client_limit = 3000
>   unix_listener auth-userdb {
> group = mstore
> mode = 0660
> user = mstore
>   }
> }
> service imap-login {
>   client_limit = 1024
>   inet_listener imap {
> port = 143
>   }
>   inet_listener imaps {
> port = 993
> ssl = yes
>   }
>   process_limit = 2500
>   process_min_avail = 4
>   service_count = 0
> }
> service lmtp {
>   inet_listener lmtp {
> address = xxx
> port = 24
>   }
> }
> service managesieve-login {
>   inet_listener sieve {
> port = 2000
>   }
>   service_count = 1
> }
> service managesieve {
>   process_limit = 1024
> }
> service pop3-login {
>   inet_listener pop3 {
> port = 110
>   }
>   inet_listener pop3s {
> port = 995
> ssl = yes
>   }
> }
> service quota-status {
>   client_limit = 5
>   executable = quota-status -p postfix
>   inet_listener {
> address = xxx
> port = 12340
>   }
> }
> service quota-warning {
>   executable = script /etc/dovecot/quotawarnmsg.sh
>   unix_listener quota-warning {
> user = mstore
>   }
>   user = mstore
> }
> ssl_cert =  ssl_key =  userdb {
>   driver = prefetch
> }
> userdb {
>   args = /etc/dovecot/dovecot-ldap.conf
>   driver = ldap
> }
> verbose_proctitle = yes
> protocol imap {
>   mail_plugins = quota imap_quota imap_zlib
> }
> protocol lda {
>   mail_plugins = quota sieve
> }
> protocol lmtp {
>   mail_plugins = quota sieve
> }
>
> so Dovecot should reject in RCPT TO phase, but according to the logs of the 
> upstream Postfix it does so after END-OF-DATA
>
> (host xxx[2001:xxx] said: 452 4.2.2
> Quota exceeded (mailbox for user is
> full) (in reply to end of DATA command))
>
> I haven't seen any commits regarding to this in 2.2.10 or tip.
>
> Regards,
> Bernhard
>


OOM in Dovecot 2.2.13 imap

2014-06-23 Thread Bernhard Schmidt
Hi,

we run Dovecot 2.2.13 on Debian Wheezy with a couple thousand mailboxes.
We have two users that repeatedly trigger an OOM condition with IMAP.

Jun 23 12:53:21 lxmhs74 dovecot: imap(USER): Fatal: 
pool_system_realloc(268435456): Out of memory
Jun 23 12:53:21 lxmhs74 dovecot: imap(USER): Error: Raw backtrace: 
/usr/lib/dovecot/libdovecot.so.0(+0x6c15f) [0x7f11766cc15f] -> 
/usr/lib/dovecot/libdovecot.so.0(+0x6c1be) [0x7f11766cc1be] -> 
/usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f1176685568] -> 
/usr/lib/dovecot/libdovecot.so.0(+0x81e80) [0x7f11766e1e80] -> 
/usr/lib/dovecot/libdovecot.so.0(+0x86cda) [0x7f11766e6cda] -> 
/usr/lib/dovecot/libdovecot.so.0(+0x86f96) [0x7f11766e6f96] -> 
/usr/lib/dovecot/libdovecot.so.0(+0x87b48) [0x7f11766e7b48] -> 
/usr/lib/dovecot/libdovecot.so.0(o_stream_sendv+0xcd) [0x7f11766e60cd] -> 
/usr/lib/dovecot/libdovecot.so.0(o_stream_send+0x1a) [0x7f11766e615a] -> 
/usr/lib/dovecot/modules/lib30_imap_zlib_plugin.so(+0x5849) [0x7f1175692849] -> 
/usr/lib/dovecot/modules/lib30_imap_zlib_plugin.so(+0x5982) [0x7f1175692982] -> 
/usr/lib/dovecot/modules/lib30_imap_zlib_plugin.so(+0x5b62) [0x7f1175692b62] -> 
/usr/lib/dovecot/libdovecot.so.0(o_stream_flush+0x4d) [0x7f11766e5d6d] ->
/usr/lib/dovecot/libdovecot.so.0(+0x85e2c) [0x7f11766e5e2c] -> dovecot/imap 
[USER IP UID fetch](client_output+0xe9) [0x7f1176e8d269] -> 
/usr/lib/dovecot/libdovecot.so.0(+0x879d5) [0x7f11766e79d5] -> 
/usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x4e) [0x7f11766dcfbe] -> 
/usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xd7) 
[0x7f11766ddfb7] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x9) 
[0x7f11766dd049] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) 
[0x7f11766dd0c8] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x7f117668a7b3] -> dovecot/imap [USER IP UID fetch](main+0x2ae) 
[0x7f1176e8152e] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) 
[0x7f11762f3ead] -> dovecot/imap [USER IP UID fetch](+0xd69d) [0x7f1176e8169d]
Jun 23 12:53:21 lxmhs74 dovecot: imap(USER): Fatal: master: service(imap): 
child 33659 killed with signal 6 (core dumped)

The gdb backtrace looks like this:

gdb) bt full
#0  0x7f1176307475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x7f117630a6f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x7f11766cc155 in default_fatal_finish (type=, 
status=status@entry=83) at failures.c:193
backtrace = 0x7f11789d4088 "/usr/lib/dovecot/libdovecot.so.0(+0x6c15f) 
[0x7f11766cc15f] -> /usr/lib/dovecot/libdovecot.so.0(+0x6c1be) [0x7f11766cc1be] 
-> /usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f1176685568] -> 
/usr/lib/d"...
#3  0x7f11766cc1be in i_internal_fatal_handler (ctx=0x7fff5ffedfb0, 
format=, args=) at failures.c:657
status = 83
#4  0x7f1176685568 in i_fatal_status (status=status@entry=83, 
format=format@entry=0x7f1176702ba8 "pool_system_realloc(%lu): Out of memory") 
at failures.c:295
ctx = {type = LOG_TYPE_FATAL, exit_status = 83, timestamp = 0x0}
args = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 
0x7fff5ffee0a0, reg_save_area = 0x7fff5ffedfe0}}
#5  0x7f11766e1e80 in pool_system_realloc (pool=, mem=0x0, 
old_size=134217728, new_size=268435456) at mempool-system.c:134
__FUNCTION__ = "pool_system_realloc"
#6  0x7f11766e6cda in o_stream_grow_buffer 
(fstream=fstream@entry=0x7f11789f41c0, bytes=) at 
ostream-file.c:440
size = 268435456
new_size = 
end_size = 
#7  0x7f11766e6f96 in o_stream_add (fstream=fstream@entry=0x7f11789f41c0, 
data=0x7f11789fe549, size=12113) at ostream-file.c:501
unused = 
sent = 
i = 
#8  0x7f11766e7b48 in o_stream_file_sendv (stream=0x7f11789f41c0, 
iov=, iov_count=) at ostream-file.c:588
fstream = 0x7f11789f41c0
size = 
total_size = 
added = 
optimal_size = 
i = 
ret = 0
__FUNCTION__ = "o_stream_file_sendv"
#9  0x7f11766e60cd in o_stream_sendv (stream=0x7f11789f4250, 
iov=iov@entry=0x7fff5ffee1a0, iov_count=iov_count@entry=1) at ostream.c:239
_stream = 0x7f11789f41c0
i = 
total_size = 12113
ret = 
__FUNCTION__ = "o_stream_sendv"
#10 0x7f11766e615a in o_stream_send (stream=, 
data=, size=size@entry=12113) at ostream.c:217
iov = {iov_base = 0x7f11789fe549, iov_len = 12113}
#11 0x7f1175692849 in o_stream_zlib_send_outbuf (zstream=0x7f11789f9340) at 
ostream-zlib.c:94
ret = 
size = 12113
#12 0x7f1175692982 in o_stream_zlib_send_flush 
(zstream=zstream@entry=0x7f11789f9340, final=final@entry=true) at 
ostream-zlib.c:189
zs = 0x7f11789f9420
len = 
done = false
ret = 
flush = 
__FUNCTION__ = "o_stream_zlib_send_flush"
#13 0x7f1175692b62 in o_stream_zlib_flush (stream=0x7f11789f9340) at 
ostream-z

Re: OOM in Dovecot 2.2.13 imap

2014-06-23 Thread Bernhard Schmidt

On 23.06.2014 16:38, Steffen Kaiser wrote:


On Mon, 23 Jun 2014, Bernhard Schmidt wrote:


we run Dovecot 2.2.13 on Debian Wheezy with a couple thousand mailboxes.
We have two users that repeatedly trigger an OOM condition with IMAP.


Do those users have mailboxes extra ordinary large or is one message of
them extra ordinary large?


No, not particularly. 8000 Mails (2GB total), the largest mail is 20MB.


Jun 23 12:53:21 lxmhs74 dovecot: imap(USER): Fatal:
pool_system_realloc(268435456): Out of memory

this number likely mean 256MB, is one of your memory limits that large?
You can see all limits with dovecot -a (note the "-a" instead of "-n").
Memory limits are vsz_limit, IMHO.


No memory limits outside of dovecot. In dovecot there are the default 
settings


default_vsz_limit = 256 M
service imap {
  [...]
  vsz_limit = 18446744073709551615 B
}

Since the largest IMAP processes I can observe are at around 70MB VIRT 
(43MB RSS) I suspect vsz_limit is doing what it is supposed to do (limit 
memory consumption of a run-away process) and something went wrong in 
that mailbox. Thus the backtrace, hoping for someone to confirm.


Regards,
Bernhard


Re: OOM in Dovecot 2.2.13 imap

2014-07-03 Thread Bernhard Schmidt

Hi Timo,

thanks for your answer.


we run Dovecot 2.2.13 on Debian Wheezy with a couple thousand
mailboxes. We have two users that repeatedly trigger an OOM
condition with IMAP.

Jun 23 12:53:21 lxmhs74 dovecot: imap(USER): Fatal:
pool_system_realloc(268435456): Out of memory

..

#6  0x7f11766e6cda in o_stream_grow_buffer
(fstream=fstream@entry=0x7f11789f41c0, bytes=) at
ostream-file.c:440 size = 268435456 new_size = 
end_size = 

..

#11 0x7f1175692849 in o_stream_zlib_send_outbuf
(zstream=0x7f11789f9340) at ostream-zlib.c:94 ret =  size = 12113 #12 0x7f1175692982 in
o_stream_zlib_send_flush (zstream=zstream@entry=0x7f11789f9340,
final=final@entry=true) at ostream-zlib.c:189


This is most likely because of the IMAP COMPRESS extension, which
causes the output stream buffer to get really large. So the easiest
fix would be to just disable imap_zlib plugin and it'll probably
work. But this should get fixed properly.. I just can't figure out
how this can happen. What was the IMAP client doing that caused it?
Could you run a few more gdb commands:


#17 0x7f1176e8d269 in client_output (client=0x7f11789f4470) at
imap-client.c:1019


Assuming client_output is again in frame 17, run:

f 17 p *client.command_queue p *client.command_queue.next



#0  0x7f1176307475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) f 17
#17 0x7f1176e8d269 in client_output (client=0x7f11789f4470) at
imap-client.c:1019
1019imap-client.c: No such file or directory.
(gdb) p *client.command_queue
$1 = {prev = 0x0, next = 0x0, client = 0x7f11789f4470, pool =
0x7f11789f4c60, tag = 0x7f11789f4d60 "9", name = 0x7f11789f4d68 "UID
fetch",
  args = 0x7f11789f4d78 "3044 (UID RFC822.SIZE BODY.PEEK[])", cmd_flags
= COMMAND_FLAG_BREAKS_SEQS,
  func = 0x7f1176e83d10 , context = 0x7f11789f4da0,
module_contexts = {arr = {buffer = 0x7f11789f4d00, element_size = 8},
v = 0x7f11789f4d00, v_modifiable = 0x7f11789f4d00}, parser =
0x7f11789df950, state = CLIENT_COMMAND_STATE_WAIT_OUTPUT, sync = 0x0,
  uid = 1, cancel = 0, param_error = 0, search_save_result = 0,
search_save_result_used = 0, temp_executed = 1, tagline_sent = 0}
(gdb) p *client.command_queue.next
Cannot access memory at address 0x0

We could easily live without IMAP COMPRESS for now, but if this
backtrace confirms your suspicion we will gladly try a build with your
patches applied.

Thanks,
Bernhard


quota_full_tempfail = yes broken with lmtp_rcpt_check_quota (was: Re: lmtp_rcpt_check_quota not working)

2015-01-29 Thread Bernhard Schmidt
Bernhard Schmidt  wrote:

Hi,

> Axel Luttgens  wrote:
>
> Hi Axel,
>
>> Le 11 févr. 2014 à 08:34, Bernhard Schmidt a écrit :
>>
>>> [...]
>>> so Dovecot should reject in RCPT TO phase, but according to the logs of the 
>>> upstream Postfix it does so after END-OF-DATA
>>> 
>>> (host xxx[2001:xxx] said: 452 4.2.2
>>>  Quota exceeded (mailbox for user is
>>> full) (in reply to end of DATA command))
>>> [...]
>>
>> Hello Bernhard,
>>
>> Could you exercise your quota-status service with variations of:
>>
>>  # telnet xxx 12340
>>  Trying xxx...
>>  Connected to xxx.
>>  Escape character is '^]'.
>>  recipient=john@example.com
>>  size=100
>>
>>  action=OK
>>
>>  ^]
>>
>> and see whether the replies are the expected one?
>>
>> If yes, this would point to some error in Postfix' configuration.
>>
>> If not, well... could be you are facing the same kind of problem I'm
>> having here (never managed to have the service reply anything else
>> than "OK" or "REJECT Unknown user"...)
>
> quota-status works absolutely fine, our frontend MXes defer mails for
> mailboxes over quota. But when we try to send a mail to the mailbox
> nevertheless through LMTP (i.e. because it was generated on a server
> that doesn't check quota-status), it is deferred in LMTP in the
> END-OF-DATA phase, not in RCPT TO as expected.

To follow up here:

Dovecot 2.2.13 (from Debian testing compiled on wheezy) is still showing
the same behaviour as 2.2.9. lmtp_rcpt_check_quota is apparently
ignored, the over-quota defer happens after the DATA phase.

# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.8 
[...]
lmtp_rcpt_check_quota = yes
quota_full_tempfail = yes
protocol lmtp {
  mail_plugins = quota sieve
}

 -> MAIL FROM:
<-  250 2.1.0 OK
 -> RCPT TO:
<-  250 2.1.5 OK
 -> DATA
<-  354 OK
 -> Date: Thu, 29 Jan 2015 13:35:51 +0100
 -> To: recipi...@domain.de
 -> From: sen...@domain.de
 -> Subject: test Thu, 29 Jan 2015 13:35:51 +0100
 -> X-Mailer: swaks v20120320.0 jetmore.org/john/code/swaks/
 -> 
 -> This is a test mailing
 -> 
 -> .
<** 452 4.2.2  Quota exceeded (mailbox for user is full)

With 2.2.15 from dovecot-ee it is different. The quota is now checked at
RCPT stage

# 2.2.15.8 (912dd04d7a14+): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.6 (4b9b9a88ac9b)
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.8 

 -> MAIL FROM:
<-  250 2.1.0 OK
 -> RCPT TO:
<** 552 5.2.2  Quota exceeded (mailbox for user is full)

But as you can see, the setting for quota_full_tempfail is now ignored.
It should be deferring the message, not rejecting it. When I disable
lmtp_rcpt_check_quota it behaves like 2.2.13.

Summary:
- In 2.2.9 and 2.2.13 lmtp_rcpt_check_quota is ignored
- In 2.2.15 lmtp_rcpt_check_quota works, but quota_full_tempfail is
  ignored at the RCPT TO stage. It still works at the DATA stage, so
  disabling lmtp_rcpt_check_quota is a workaround falling back to 2.2.13
  behaviour

Bernhard


[Dovecot] dovecot-sieve-1.0 (hg) does not build

2007-05-29 Thread Bernhard Schmidt
Hi,

the dovecot-sieve plugin from the hg repository
(http://hg.dovecot.org/dovecot-sieve-1.0/) does not build against
current dovecot-1.0 repository. 

/bin/bash ../../libtool --tag=CC --mode=link gcc  -std=gnu99 -g -O2
-Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith
-Wchar-subscripts -Wformat=2 -Wbad-function-cast  -DENABLE_REGEX   -o
sievec  sievec.o map.o imparse.o libsieve.la
/usr/src/dovecot-1.0/src/lib/liblib.a 
gcc -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes
-Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2
-Wbad-function-cast -DENABLE_REGEX -o sievec sievec.o map.o imparse.o
/.libs/libsieve.a /usr/src/dovecot-1.0/src/lib/liblib.a
/.libs/libsieve.a(script.o): In function `sieve_script_parse':
/usr/src/dovecot-sieve-1.0/src/libsieve/script.c:140: undefined
reference to `yylineno'
/.libs/libsieve.a(sieve.o): In function `sieveerror':
/usr/src/dovecot-sieve-1.0/src/libsieve/sieve.y:568: undefined reference
to `yylineno'
/.libs/libsieve.a(sieve.o): In function `sieveparse':
/usr/src/dovecot-sieve-1.0/src/libsieve/sieve.c:1644: undefined
reference to `sievelex'
/.libs/libsieve.a(sieve.o): In function `sieve_parse':
/usr/src/dovecot-sieve-1.0/src/libsieve/sieve.y:551: undefined reference
to `yyrestart'
/.libs/libsieve.a(addr.o): In function `addrparse':
/usr/src/dovecot-sieve-1.0/src/libsieve/addr.c:1289: undefined reference
to `addrlex'
collect2: ld returned 1 exit status
make[3]: *** [sievec] Error 1
make[3]: Leaving directory `/usr/src/dovecot-sieve-1.0/src/libsieve'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/dovecot-sieve-1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/dovecot-sieve-1.0'
make: *** [all] Error 2

dovecot-sieve-1.0.1.tar.gz builds fine. 1.0.1 is from January 2007, the
last changes in the hg repository are three months ago, but none of them
look like they would be causing this issue. Also there is no r_1_0_1
tag.

It looks to me like 1.0.1 is something quite different to the
hg-repository, right? Does the latter compile against anything at the
moment?

Thanks,
Bernhard



Re: [Dovecot] dovecot-sieve-1.0 (hg) does not build

2007-06-04 Thread Bernhard Schmidt

Timo Sirainen schrieb:

Hi,


the dovecot-sieve plugin from the hg repository
(http://hg.dovecot.org/dovecot-sieve-1.0/) does not build against
current dovecot-1.0 repository. 

..

/.libs/libsieve.a(script.o): In function `sieve_script_parse':
/usr/src/dovecot-sieve-1.0/src/libsieve/script.c:140: undefined
reference to `yylineno'


It builds with me, so I guess the problem has something to do with the
software you're using to build it. Perhaps you're using some other lex
than flex?


Yup that's it, no flex installed, and no lex either :-(

Works fine now (after removing the whole working directory and cloning 
it again from hg, "make distclean; sh autogen.sh; ./configure; make" did 
not solve the problem), maybe ./configure should complain if flex is not 
found?


Thanks and sorry for the noise,
Bernhard


Re: [Dovecot] v1.0.2 release candidate

2007-07-12 Thread Bernhard Schmidt
Timo Sirainen <[EMAIL PROTECTED]> wrote:

> Unless someone finds something broken, I'll release v1.0.2 in a few
> days. The most important changes since v1.0.1:

I'm getting a _large_ number of UIDVALIDITY changes logging messages,
even when I have completely removed all old index files

Jul 13 00:30:18 vs02 dovecot: IMAP(bernilrz): Corrupted transaction log
file /var/indexes/b/bernilrz/.hostmaster/dovecot.index.log.2: invalid
indexid (1184278797 != 1184279418)
Jul 13 00:30:18 vs02 dovecot: IMAP(berni): UID larger than next_uid in
file /var/mail/vmail/b/berni/.unsorted/dovecot-uidlist (7105250 >=
6978786)
Jul 13 00:30:18 vs02 dovecot: IMAP(berni): Maildir
/var/mail/vmail/b/berni/.unsorted sync: UIDVALIDITY changed (7105250 ->
6978786)
Jul 13 00:30:18 vs02 dovecot: IMAP(bernilrz): Corrupted index cache file
/var/indexes/b/bernilrz/.hostmaster/dovecot.index.cache: indexid changed
Jul 13 00:32:19 vs02 dovecot: IMAP(bernilrz): Maildir
/var/mail/vmail/b/bernilrz/.hostmaster sync: UIDVALIDITY changed
(7136882 -> 7053650)
Jul 13 00:32:19 vs02 dovecot: IMAP(bernilrz): Disconnected: Internal
error occurred. Refer to server log for more information. [2007-07-13
00:32:19]

x86_64 Ubuntu Feisty (Linux 2.6) in a Xen-domain

Bernhard



Re: [Dovecot] v1.0.2 release candidate

2007-07-12 Thread Bernhard Schmidt

Timo Sirainen wrote:

Hi Timo,


Unless someone finds something broken, I'll release v1.0.2 in a few
days. The most important changes since v1.0.1:

I'm getting a _large_ number of UIDVALIDITY changes logging messages,
even when I have completely removed all old index files

rc2 should have fixed these. Did you get -rc.tar.gz or -rc2.tar.gz?


Sorry I forgot to send that detail, I was using the dovecot-1.0 
hg-repository. I just pulled again with your last fix and it looks 
slightly better so far.


I still see messages about invalid indexid / indexid changed, even one 
disconnect with internal server error, but that might be because the 
indices were messed with by the broken version.


Jul 13 01:01:55 vs02 dovecot: IMAP(berni): Maildir 
/var/mail/vmail/b/berni/.sysprak sync: UIDVALIDITY changed (7052738 -> 
1177317433)
Jul 13 01:01:55 vs02 dovecot: IMAP(berni): Disconnected: Internal error 
occurred. Refer to server log for more information. [2007-07-13 01:01:54]


Would that be an expected message after upgrading to the fixed version?

Since that box is only a private mailserver and doesn't get many mails 
(especially during the night) I can't tell whether the problem is fixed 
now for sure.


Regards,
Bernhard


Re: [Dovecot] dovecot 1.1beta2 and dovecot-sieve 1.1.2 - crash in LDA

2007-10-12 Thread Bernhard Schmidt
Bernhard Schmidt <[EMAIL PROTECTED]> wrote:

> I've upgraded to dovecot 1.1beta2 and the latest dovecot-sieve release
> yesterday and have one single mail that cannot be delivered repeatedly.

Screw that, fixed already in the latest hg version, probably with
changeset 58d9f94b9919.

Thanks,
Bernhard



[Dovecot] dovecot 1.1beta2 and dovecot-sieve 1.1.2 - crash in LDA

2007-10-12 Thread Bernhard Schmidt
Hi,

I've upgraded to dovecot 1.1beta2 and the latest dovecot-sieve release
yesterday and have one single mail that cannot be delivered repeatedly.

Log (reformatted):
Oct 12 15:19:19 vs02 deliver(bernilrz): pool_data_stack_realloc(): stack frame 
changed
Oct 12 15:19:19 vs02 deliver(bernilrz): Raw backtrace: 
/usr/local/libexec/dovecot/deliver(i_syslog_panic_handler+0x1e) [0x47117e] -> 
/usr/local/libexec/dovecot/deliver [0x470eac] -> 
/usr/local/libexec/dovecot/deliver [0x47929b] -> 
/usr/local/libexec/dovecot/deliver [0x46f3e3] -> 
/usr/local/libexec/dovecot/deliver(buffer_write+0x9d) [0x46f70d] ->
/usr/local/libexec/dovecot/deliver [0x469aaf] ->
/usr/local/libexec/dovecot/deliver(message_header_decode+0x104) [0x469c14] ->
/usr/local/libexec/dovecot/deliver(message_header_decode_utf8+0x4b) [0x469d4b] 
-> 
/usr/local/libexec/dovecot/deliver [0x43f3eb] ->
/usr/local /libexec/dovecot/deliver(index_mail_get_headers+0x42) [0x4401c2] ->
/usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so [0x2b662df67d87] ->
/usr/local/lib /dovecot/lda/lib90_cmusieve_plugin.so [0x2b662df716e8] ->
/usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so(sieve_eval_bc+0x395) 
[0x2b662df72665] ->
/usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so(sieve_execute_bytecode+0xfa)
 [0x2b662df77daa] ->
/usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so(cmu_sieve_run+0x318) 
[0x2b662df689b8] ->
/usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so [0x2b662df66d96] ->
/usr/local/libexec/dovecot/deliver(main+0xe74) [0x417d24] -> 
/lib/libc.so.6(__libc_start_main+0xf4) [0x2b662da15b44] ->
/usr/local/libexec/dovecot/deliver [0x416079]

All other mails work fine, so there is probably something corner case
here.

Timo, I'll send you the mail in private.

Regards,
Bernhard Schmidt



[Dovecot] Incomplete Subject Line

2007-10-16 Thread Bernhard Schmidt
Hi,

since upgrading from 1.0.5 to latest 1.1-hg I get an incomplete subject
line for mails autogenerated by one of our systems in the message list
(Thunderbird and mutt). When I open the mail the subject line is intact.

It appears that the system is using multiline subjects. Example

Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDEwNjM1OiBOYW1lc2U=?=
 =?ISO-8859-1?B?cnZlcjogTmV1dmVyZ2FiZSBvZGVyIMRuZGVydW5n?=

is printed as

Subject: Hostmaster: 10635: Namese

in the Message list and correctly decoded as

Subject: Hostmaster: 10635: Nameserver: Neuvergabe oder Änderung

when viewing the message.

Bug?

Regards,
Bernhard



Re: [Dovecot] Incomplete Subject Line

2007-10-20 Thread Bernhard Schmidt
Hi,

> > since upgrading from 1.0.5 to latest 1.1-hg I get an incomplete subject
> > line for mails autogenerated by one of our systems in the message list
> > (Thunderbird and mutt). When I open the mail the subject line is intact.
> >
> > It appears that the system is using multiline subjects. Example
> >
> > Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDEwNjM1OiBOYW1lc2U=?=
> >  =?ISO-8859-1?B?cnZlcjogTmV1dmVyZ2FiZSBvZGVyIMRuZGVydW5n?=
> >
> > is printed as
> >
> > Subject: Hostmaster: 10635: Namese
> >
> > in the Message list and correctly decoded as
>
> Both v1.0 and v1.1 replies the same for FETCH ENVELOPE and
> HEADER.FIELDS. I can't think of any other ways how this could be buggy
> in Dovecot's side (I did find that SEARCH was buggy though).
>
> x fetch 1 envelope
> * 1 FETCH (ENVELOPE ("Thu, 03 Jun 2004 15:42:53 -0300"
> "=?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDEwNjM1OiBOYW1lc2U=?=
> =?ISO-8859-1?B?cnZlcjogTmV1dmVyZ2FiZSBvZGVyIMRuZGVydW5n?=" ...) x OK Fetch
> completed.
> x fetch 1 body.peek[header.fields (subject)]
> * 1 FETCH (BODY[HEADER.FIELDS (SUBJECT)] {130}
> Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDEwNjM1OiBOYW1lc2U=?=
>  =?ISO-8859-1?B?cnZlcjogTmV1dmVyZ2FiZSBvZGVyIMRuZGVydW5n?=
>
> )


I just tcpdumped a mutt session (which also shows this behaviour) 

Mail:
Date: Tue, 16 Oct 2007 12:02:08 +0200 (MEST)
From: Doku-Ticket System <[EMAIL PROTECTED]>
Reply-To: Doku-Ticket System <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED],
 [EMAIL PROTECTED]
Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDAxMDE5OiBOYW1lc2U=?=
 =?ISO-8859-1?B?cnZlcjogTmV1dmVyZ2FiZSBvZGVyIMRuZGVydW5n?=

IMAP:
a0008 FETCH 1:1232 (UID FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS 
(DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE 
CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO LINES LIST-POST X-LABEL)])
[...]
* 1190 FETCH (UID 5300 FLAGS (\Seen NonJunk) INTERNALDATE "16-Oct-2007 
12:02:19 +0200" RFC822.SIZE 2196 BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC 
MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-DESCRIPTION IN-REPLY-TO REPLY-TO 
LINES LIST-POST X-LABEL)] {387}
Message-Id: <[EMAIL PROTECTED]>
Date: Tue, 16 Oct 2007 12:02:08 +0200 (MEST)
From: Doku-Ticket System <[EMAIL PROTECTED]>
Reply-To: Doku-Ticket System <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED],
Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDAxMDE5OiBOYW1lc2U=?=
Content-Type: multipart/alternative; 

)

Note that the second destination is missing as well. I can't remember seeing 
those issues in 1.0.5 (and I'm pretty sure all other users would have 
complained, given that we have migrated the official mailserver to Dovecot 
1.0 lately), but I don't have easy access to an 1.0 mailserver at the moment.

I'll upgrade to the latest .hg-version, but as you didn't seem to have 
suspected anything I guess this won't fix the issue.

Regards,
Bernhard


Re: [Dovecot] Incomplete Subject Line

2007-10-20 Thread Bernhard Schmidt
Hi,

> > Reply-To: Doku-Ticket System <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED],
> >  [EMAIL PROTECTED]
> > Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDAxMDE5OiBOYW1lc2U=?=
> >  =?ISO-8859-1?B?cnZlcjogTmV1dmVyZ2FiZSBvZGVyIMRuZGVydW5n?=
>
> ..
>
> > To: [EMAIL PROTECTED],
> > Subject: =?ISO-8859-1?B?SG9zdG1hc3RlcjogMDAwMDAxMDE5OiBOYW1lc2U=?=
>
> Was this message saved by Dovecot or some external program? Does it get
> fixed if you delete dovecot.index.cache file?

Ah, was just trying that and writing you the results. Yes, after deleting the 
index (I deleted the whole directory) the result looks fine. I'm using 
dovecot LDA (same version as dovecot, so somewhere between 1.1beta2 and 
beta3) to deliver the mail.

I can't tell whether the bug will reappear for new messages yet.

Regards,
Bernhard


Dovecot LMTP mixing up users on multi-recipient mail

2019-06-27 Thread Bernhard Schmidt via dovecot
Hi,

I've upgraded a mailstore from Debian Jessie (aka oldstable) with
Dovecot 2.2.13 to Debian Buster (next stable) with Dovecot 2.3.4.1
today. It worked pretty well, except that we're seeing error messages
very similar to this old thread

https://dovecot.org/pipermail/dovecot/2015-July/101396.html

It appears to be happening when a mail with multiple recipients on this
message store is getting delivered through lmtp.

Jun 27 11:47:36 lxmhs74 dovecot: lmtp(user1)<47683>: 
Error: open(/var/cache/dovecot/index/n/user2n/.INBOX/dovecot.index.cache) 
failed: Permission denied (euid=3814520() egid=12(man) missing +x 
perm: /var/cache/dovecot/index/n/user2, dir owned by 3391995:12 mode=0700)

user1 uid is 3814520, user2n uid is 3391995. Dovecot appears to be trying
to deliver the message to user1 while using the index directory of user2n.

Further configuration:
- message store is on NFS
- cache directory is on local disk
- users are coming from LDAP, one UID per user
  user_attrs = cn=user,homeDirectory=home,uidNumber=uid,gidNumber=gid
- index directory is calculated from the username
  maildir:~/Maildir:INDEX=/var/cache/dovecot/index/%-1.1n/%n

Despite the error messages (which appear dozens of times per delivery
attempt) delivery seems to work. Workaround was to set

lmtp_destination_recipient_limit = 1

on the postfix in front of the message store. 

Despite the report linked above being quite old, I can't recall having
issues with 2.2.13.

=== doveconf -n ===

# OS: Linux 4.19.0-5-amd64 x86_64 Debian 10.0 
# Hostname: lxmhs74.srv.lrz.de
default_vsz_limit = 512 M
deliver_log_format = from=<%e>, size=%p, message-id=<%m>, status=%$
imap_id_log = *
imap_id_send = *
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
login_greeting = Dovecot ready.
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c
session=<%{session}> cipher=<%k>
mail_gid = mstore
mail_location = maildir:~/Maildir:INDEX=/var/cache/dovecot/index/%-1.1n/%n
mail_plugins = quota listescape
mail_uid = mstore
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags
copy include variables body enotify environment mailbox date index ihave
duplicate mime foreverypart extracttext
mmap_disable = yes
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Junk {
auto = subscribe
special_use = \Junk
  }
  mailbox Sent {
auto = subscribe
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix = INBOX.
  separator = .
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
plugin {
  quota = maildir
  quota_rule = *:storage=1024M
  quota_rule2 = INBOX.Trash:ignore
  quota_status_nouser = DUNNO
  quota_status_overquota = 452 4.2.2 Mailbox is full
  quota_status_success = DUNNO
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  sieve = ~/currently-active-script.sieve
  sieve_dir = ~/sieve
}
pop3_uidl_format = %v-%u
protocols = imap lmtp sieve pop3
quota_full_tempfail = yes
service anvil {
  client_limit = 3000
  unix_listener anvil {
group = sudo
mode = 0660
  }
}
service auth {
  client_limit = 3000
  unix_listener auth-userdb {
group = mstore
mode = 0660
user = mstore
  }
}
service imap-login {
  client_limit = 1024
  inet_listener imap {
port = 143
  }
  inet_listener imaps {
port = 993
ssl = yes
  }
  process_limit = 2500
  process_min_avail = 4
  service_count = 0
}
service imap {
  process_limit = 8192
}
service lmtp {
  inet_listener lmtp {
port = 24
  }
}
service managesieve-login {
  inet_listener sieve {
port = 4190
  }
  inet_listener sieve_deprecated {
port = 2000
  }
  service_count = 1
}
service managesieve {
  process_limit = 1024
}
service pop3-login {
  inet_listener pop3 {
port = 110
  }
  inet_listener pop3s {
port = 995
ssl = yes
  }
}
service quota-status {
  client_limit = 20
  executable = quota-status -p postfix
  inet_listener {
port = 12340
  }
}
service quota-warning {
  executable = script /etc/dovecot/quotawarnmsg.sh
  unix_listener quota-warning {
group = mstore
mode = 0660
user = mstore
  }
  user = mstore
}
service stats {
  process_limit = 8192
}
ssl_cert =