[Dovecot] Segfault in dovecot 1.2rc2 with quota + public namespace enabled

2009-04-07 Thread Markus Werner
Hi,

I have configured a public namespace ("#Shared"). Since dovecot 1.2rc2
(1.1.11 worked fine) I get a segfault, if I try to access a folder
under this namespace when quota plugin is enabled. When the quota
plugin is disabled, accessing those folders works.


$ dovecot -n

# 1.2.rc2: /opt/dovecot/etc/dovecot.conf
# OS: Linux 2.6.26-1-686 i686 Debian 5.0
base_dir: /var/run/dovecot
protocols: imap pop3
listen: 127.0.0.1,192.168.128.151
ssl_listen: 192.168.128.151
ssl_ca_file: /opt/dovecot/etc/certs/cacert.pem
ssl_cert_file: /opt/dovecot/etc/certs/asterixCert.pem
ssl_key_file: /opt/dovecot/etc/certs/asterixKey.pem
ssl_parameters_regenerate: 0
ssl_cipher_list: ALL:!LOW:!SSLv2
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /opt/dovecot/libexec/dovecot/imap-login
login_executable(imap): /opt/dovecot/libexec/dovecot/imap-login
login_executable(pop3): /opt/dovecot/libexec/dovecot/pop3-login
login_user: dovecotl
login_process_per_connection: no
login_processes_count: 1
login_max_processes_count: 3
max_mail_processes: 100
mail_max_userip_connections: 8
first_valid_uid: 2000
last_valid_uid: 2000
first_valid_gid: 2000
last_valid_gid: 2000
mail_access_groups: dovecot
mail_uid: 2000
mail_gid: 2000
mail_location: maildir:~/Maildir
mail_debug(default): yes
mail_debug(imap): yes
mail_debug(pop3): no
mail_executable(default): /opt/dovecot/libexec/dovecot/imap
mail_executable(imap): /opt/dovecot/libexec/dovecot/imap
mail_executable(pop3): /opt/dovecot/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota acl imap_acl fts fts_squat
mail_plugins(imap): quota imap_quota acl imap_acl fts fts_squat
mail_plugins(pop3):
mail_plugin_dir(default): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(imap): /opt/dovecot/lib/dovecot/imap
mail_plugin_dir(pop3): /opt/dovecot/lib/dovecot/pop3
pop3_no_flag_updates(default): no
pop3_no_flag_updates(imap): no
pop3_no_flag_updates(pop3): yes
namespace:
  type: private
  separator: /
  prefix: INBOX/
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: public
  separator: /
  prefix: #Shared/
  location: 
maildir:/var/spool/dovecot/sharedfolders:INDEX=~/Maildir/index/public:CONTROL=~/Maildir/control/public
  list: yes
  subscriptions: yes
namespace:
  type: shared
  separator: /
  prefix: #User/%%u/
  location: maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u
  list: yes
auth default:
  mechanisms: plain login
  user: dovecota
  worker_max_count: 3
  passdb:
driver: passwd-file
args: /opt/dovecot/etc/passwd
  userdb:
driver: passwd-file
args: /opt/dovecot/etc/passwd
  socket:
type: listen
client:
  path: /var/run/dovecot/auth-client
  mode: 432
  user: postfix
  group: postfix
master:
  path: /var/run/dovecot/auth-master
  mode: 432
  user: dovecota
  group: dovecot
plugin:
  sieve: ~/.dovecot/.dovecot.sieve
  acl: vfile:/opt/dovecot/etc/dovecot-acls
  acl_shared_dict: file:/var/lib/dovecot/shared-mailboxes.db
  acl_anyone: allow
  quota: dict:user::file:%h/Maildir/dovecot-quota
  quota_rule: *:storage=10G:messages=50
  fts: squat
  fts_squat: partial=4 full=10


$ gdb /opt/dovecot/libexec/dovecot/imap /var/spool/dovecot/users/markus/core

GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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 "i486-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/i686/cmov/libdl.so.2
Reading symbols from /lib/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so
Reading symbols from
/opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so
Reading symbols from
/opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so
Reading symbols from
/opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so
Reading symbols from /lib/i686/cmov/libnss_compat.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_compat.so.2
Readin

Re: [Dovecot] Segfault in dovecot 1.2rc2 with quota + public namespace enabled

2009-04-07 Thread Markus Werner
Hi Timo,

On Tue, Apr 07, 2009 at 12:27:24PM -0400, Timo Sirainen wrote:
> On Tue, 2009-04-07 at 15:53 +0200, Markus Werner wrote:
> > I have configured a public namespace ("#Shared"). Since dovecot 1.2rc2
> > (1.1.11 worked fine) I get a segfault, if I try to access a folder
> > under this namespace when quota plugin is enabled. When the quota
> > plugin is disabled, accessing those folders works.
> 
> This should fix it: http://hg.dovecot.org/dovecot-1.2/rev/f38765916f6d

Not yet:

#0  0xb7f683f1 in acl_mailbox_get_aclobj (box=0x85ad440) at acl-mailbox.c:49
49  struct acl_mailbox *abox = ACL_CONTEXT(box);
(gdb) bt full
#0  0xb7f683f1 in acl_mailbox_get_aclobj (box=0x85ad440) at acl-mailbox.c:49
No locals.
#1  0xb7dfbc89 in cmd_myrights (cmd=0x85a5bd8) at imap-acl-plugin.c:305
storage = (struct mail_storage *) 0x85a35a8
box = (struct mailbox *) 0x85ad440
mailbox = 0x85aace0 "#Shared/System"
real_mailbox = 0x85932c0 "System"
rights = 
str = 
#2  0x0806700c in client_command_input (cmd=0x85a5bd8) at client.c:603
client = (struct client *) 0x85a5948
command = 
__PRETTY_FUNCTION__ = "client_command_input"
#3  0x080670a9 in client_command_input (cmd=0x85a5bd8) at client.c:652
client = (struct client *) 0x85a5948
command = 
__PRETTY_FUNCTION__ = "client_command_input"
#4  0x080676ed in client_handle_input (client=0x85a5948) at client.c:693
_data_stack_cur_id = 3
ret = 
remove_io = 
handled_commands = true
#5  0x08067ba3 in client_input (client=0x85a5948) at client.c:748
cmd = 
output = (struct ostream *) 0x85a5afc
bytes = 
__PRETTY_FUNCTION__ = "client_input"
#6  0x080f73f0 in io_loop_handler_run (ioloop=0x859eae8) at ioloop-epoll.c:208
ctx = (struct ioloop_handler_context *) 0x859ebf0
event = (const struct epoll_event *) 0x859ec30
list = (struct io_list *) 0x85a5b80
io = (struct io_file *) 0x85a5b58
tv = {tv_sec = 4, tv_usec = 999835}
t_id = 2
msecs = 
ret = 1
i = 0
j = 0
call = 
#7  0x080f6880 in io_loop_run (ioloop=0x859eae8) at ioloop.c:338
No locals.
#8  0x080704c5 in main (argc=Cannot access memory at address 0xc
) at main.c:320
No locals.


Re: [Dovecot] Segfault in dovecot 1.2rc2 with quota + public namespace enabled

2009-04-07 Thread Markus Werner
On Tue, Apr 07, 2009 at 02:42:43PM -0400, Timo Sirainen wrote:
> On Tue, 2009-04-07 at 20:31 +0200, Markus Werner wrote:
> > #0  0xb7f683f1 in acl_mailbox_get_aclobj (box=0x85ad440) at acl-mailbox.c:49
> > 49  struct acl_mailbox *abox = ACL_CONTEXT(box);
> > (gdb) bt full
> > #0  0xb7f683f1 in acl_mailbox_get_aclobj (box=0x85ad440) at acl-mailbox.c:49
> > No locals.
> > #1  0xb7dfbc89 in cmd_myrights (cmd=0x85a5bd8) at imap-acl-plugin.c:305
> 
> Another fix: http://hg.dovecot.org/dovecot-1.2/rev/4907cc591449
> 

This fixes the problem. Thanks.


[Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-07 Thread Markus Werner
Hi Timo,

I have another problem, this time with user shared folders:

User "markus" shared the folder "ForTest" to test:

SETACL "INBOX/ForTest" test akxeilrwts

dovecot-acl and shared-mailboxes.db have been successfully updated.

As user "test" the folder (and "#User" namespace) is not visible.
When I configure the shared namespace with "list = yes", the namespace
and folder became visible and accessible, but lines like this are logged:

Apr  7 22:08:58 asterix dovecot: IMAP(test): acl vfile: reading file 
/var/spool/dovecot/users/test/Maildir/.Shared/dovecot-acl
Apr  7 22:09:03 asterix dovecot: IMAP(test): Invalid namespace prefix %u/ vs %
Apr  7 22:09:03 asterix dovecot: IMAP(test): auth input: uid=2000
Apr  7 22:09:03 asterix dovecot: IMAP(test): auth input: gid=2000
Apr  7 22:09:03 asterix dovecot: IMAP(test): auth input: 
home=/var/spool/dovecot/users/markus
Apr  7 22:09:03 asterix dovecot: IMAP(test): maildir: 
data=/var/spool/dovecot/users/markus/Maildir:INDEX=~/Maildir/index/shared/markus
Apr  7 22:09:03 asterix dovecot: IMAP(test): maildir++: 
root=/var/spool/dovecot/users/markus/Maildir, 
index=/var/spool/dovecot/users/markus/Maildir, 
index=/var/spool/dovecot/users/test/Maildir/index/shared/markus, control=, 
inbox=/var/spool/dovecot/users/markus/Maildir
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl: initializing backend with 
data: vfile
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl: acl username = test
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl: owner = 0
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl vfile: Global ACL directory: 
(null)
Apr  7 22:09:03 asterix dovecot: IMAP(test): acl vfile: reading file 
/var/spool/dovecot/users/markus/Maildir/.ForTest/dovecot-acl
Apr  7 22:09:08 asterix dovecot: IMAP(test): Invalid namespace prefix %u/ vs 
markus


When I try to access the folder directly with "list = children" set, then
dovecot segfaults. Last lines in logfile:

Apr  7 22:28:04 asterix dovecot: IMAP(test): acl: initializing backend with 
data: vfile
Apr  7 22:28:04 asterix dovecot: IMAP(test): acl: acl username = test
Apr  7 22:28:04 asterix dovecot: IMAP(test): acl: owner = 0
Apr  7 22:28:04 asterix dovecot: IMAP(test): acl vfile: Global ACL directory: 
(null)
Apr  7 22:28:04 asterix dovecot: child 5441 (imap) killed with signal 11 (core 
dumped)


The backtrace looks like the one I got with your first quota fix, but
quota works now and this error is reproducible with or without the quota
plugin:


GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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 "i486-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/i686/cmov/libdl.so.2
Reading symbols from /lib/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so
Reading symbols from 
/opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so
Reading symbols from 
/opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so
Reading symbols from /opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so
Reading symbols from 
/opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so...done.
Loaded symbols for /opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so
Reading symbols from /lib/i686/cmov/libnss_compat.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_compat.so.2
Reading symbols from /lib/i686/cmov/libnsl.so.1...done.
Loaded symbols for /lib/i686/cmov/libnsl.so.1
Reading symbols from /lib/i686/cmov/libnss_nis.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_nis.so.2
Reading symbols from /lib/i686/cmov/libnss_files.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_files.so.2
Core was generated by `imap'.
Program terminated with signal 11, Segmentation fault.
[New process 5441]
#0  0xb7ee43f1 in acl_mailbox_get_aclobj (box=0x8693488) at acl-mailbox.c:49
49  struct acl_mailbox *abox = ACL_CONTEXT(box);
(gdb) bt full
#0  0xb7ee43f1 in acl_mailbox_get_aclobj (box=0x8693488) at acl-mailbox.c:49
No locals.
#1  0xb7d77c89 in cmd_myrights (cmd=0x8658b90) at imap-acl-plugin.c:305
storage =

Re: [Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-07 Thread Markus Werner
Hi Timo,

>
> http://hg.dovecot.org/dovecot-1.2/rev/7d484e0f0789
> http://hg.dovecot.org/dovecot-1.2/rev/3a30d73fc463
> http://hg.dovecot.org/dovecot-1.2/rev/b6abc84440df
>

With "list = children" the namespace ist still not listed, but that's no
problem for me. With "list = all" now there is a folder named "%"
listed, directly under "#User/", additionaly to "mar...@example.com".

Accessing the folder "mar...@example.com/ForTest" with Thunderbird results
in a segfault. Mutt works.
(FYI: I changed the usernames, now they include @domain, if that matters)

Apr  8 00:50:41 asterix dovecot: imap-login: Login: user=, 
method=PLAIN, rip=192.168.128.151, lip=192.168.128.151, secured
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Loading modules from 
directory: /opt/dovecot/lib/dovecot/imap
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Module loaded: 
/opt/dovecot/lib/dovecot/imap/lib01_acl_plugin.so
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Module loaded: 
/opt/dovecot/lib/dovecot/imap/lib02_imap_acl_plugin.so
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Module loaded: 
/opt/dovecot/lib/dovecot/imap/lib10_quota_plugin.so
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Module loaded: 
/opt/dovecot/lib/dovecot/imap/lib11_imap_quota_plugin.so
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Module loaded: 
/opt/dovecot/lib/dovecot/imap/lib20_fts_plugin.so
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Module loaded: 
/opt/dovecot/lib/dovecot/imap/lib21_fts_squat_plugin.so
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Effective uid=2000, 
gid=2000, home=/var/spool/dovecot/users/example.com/test
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Quota root: name=user 
backend=dict 
args=:file:/var/spool/dovecot/users/example.com/test/Maildir/dovecot-quota
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Quota rule: root=user 
mailbox=* bytes=2147483648 messages=5
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): dict quota: 
user=t...@example.com, 
uri=file:/var/spool/dovecot/users/example.com/test/Maildir/dovecot-quota, 
noenforcing=0
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Namespace: 
type=private, prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, 
subscriptions=yes
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): maildir: data=~/Maildir
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): maildir++: 
root=/var/spool/dovecot/users/example.com/test/Maildir, index=, control=, 
inbox=/var/spool/dovecot/users/example.com/test/Maildir
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl: initializing 
backend with data: vfile
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl: acl username = 
t...@example.com
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl: owner = 1
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl vfile: Global ACL 
directory: (null)
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Namespace: 
type=public, prefix=#Shared/, sep=/, inbox=no, hidden=no, list=yes, 
subscriptions=yes
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): maildir: 
data=/var/spool/dovecot/sharedfolders:INDEX=~/Maildir/index/public:CONTROL=~/Maildir/control/public
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): maildir++: 
root=/var/spool/dovecot/sharedfolders, 
index=/var/spool/dovecot/users/example.com/test/Maildir/index/public, 
control=/var/spool/dovecot/users/example.com/test/Maildir/control/public, inbox=
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl: initializing 
backend with data: vfile
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl: acl username = 
t...@example.com
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl: owner = 0
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): acl vfile: Global ACL 
directory: (null)
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): Namespace: 
type=shared, prefix=#User/%u/, sep=/, inbox=no, hidden=no, list=yes, 
subscriptions=no
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): shared: root=, index=, 
control=, inbox=
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): dict quota: 
user=mar...@example.com, 
uri=file:/var/spool/dovecot/users/example.com/test/Maildir/dovecot-quota, 
noenforcing=0
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): auth input: uid=2000
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): auth input: gid=2000
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): auth input: 
home=/var/spool/dovecot/users/example.com/markus
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): auth input: 
quota_rule=*:storage=20G:messages=50
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): maildir: 
data=/var/spool/dovecot/users/example.com/markus/Maildir:INDEX=~/Maildir/index/shared/mar...@example.com
Apr  8 00:50:41 asterix dovecot: IMAP(t...@example.com): maildir++: 
root=/va

Re: [Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-08 Thread Markus Werner
Another one:

#0  0xb7fbf424 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7e7a640 in raise () from /lib/i686/cmov/libc.so.6
No symbol table info available.
#2  0xb7e7c018 in abort () from /lib/i686/cmov/libc.so.6
No symbol table info available.
#3  0x080ee9a5 in default_fatal_finish (type=, status=0) 
at failures.c:161
backtrace = 0x8282480 "imap [0x80ee991] -> imap [0x80eea12] -> imap 
[0x80ee399] -> imap [0x80b50eb] -> imap(shared_storage_get_namespace+0x2bf) 
[0x8075fff] -> imap [0x80757d7] -> imap [0x8063034] -> 
imap(cmd_list_full+0x514"...
#4  0x080eea12 in i_internal_fatal_handler (type=LOG_TYPE_PANIC, status=0, 
fmt=0x810632c "file %s: line %d (%s): assertion failed: (%s)",
args=0xbfbda674 "\017\v\021\b\036") at failures.c:441
No locals.
#5  0x080ee399 in i_panic (format=0x810632c "file %s: line %d (%s): assertion 
failed: (%s)") at failures.c:208
No locals.
#6  0x080b50eb in mail_user_init (username=0x829854e "") at mail-user.c:30
user = 
pool = 
__PRETTY_FUNCTION__ = "mail_user_init"
#7  0x08075fff in shared_storage_get_namespace (_storage=0x82929d0, 
_name=0xbfbda724, ns_r=0xbfbda728) at shared-storage.c:224
user = (struct mail_user *) 0x828e270
ns = (struct mail_namespace *) 0x0
owner = 
domain = 0x0
username = 0x829854e ""
userdomain = 0x829854e ""
name = 0x810fc97 "INBOX"
p = 
dest = 
error = 
prefix = (string_t *) 0x82823b0
location = 
ret = 
static_tab = {{key = 117 'u', value = 0x0, long_key = 0x8110b32 
"user"}, {key = 110 'n', value = 0x0, long_key = 0x8109830 "username"}, {
key = 100 'd', value = 0x0, long_key = 0x8109839 "domain"}, {key = 104 'h', 
value = 0x0, long_key = 0x8109807 "home"}, {key = 0 '\0', value = 0x0,
long_key = 0x0}}
__PRETTY_FUNCTION__ = "shared_storage_get_namespace"
#8  0x080757d7 in shared_list_join_refpattern (list=0x8292dd8, ref=0x8298548 
"#User/", pattern=0x8298550 "*") at shared-list.c:148
ns = 
ns_ref = 0x829854e ""
prefix = 0x8292998 "#User/"
#9  0x08063034 in cmd_list_continue (cmd=0x8293448) at cmd-list.c:672
_data_stack_cur_id = 4
ctx = (struct cmd_list_context *) 0x82934e0
#10 0x08063a04 in cmd_list_full (cmd=0x8293448, lsub=false) at cmd-list.c:903
client = (struct client *) 0x82931b8
args = (const struct imap_arg *) 0x82984e8
arg = 
ctx = (struct cmd_list_context *) 0x82934e0
patterns = {arr = {buffer = 0x8293508, element_size = 4}, v = 
0x8293508, v_modifiable = 0x8293508}
pattern = 0x8298550 "*"
#11 0x08063d09 in cmd_list (cmd=0x8293448) at cmd-list.c:918
No locals.
#12 0x0806700c in client_command_input (cmd=0x8293448) at client.c:603
client = (struct client *) 0x82931b8
command = 
__PRETTY_FUNCTION__ = "client_command_input"
#13 0x080670a9 in client_command_input (cmd=0x8293448) at client.c:652
client = (struct client *) 0x82931b8
command = 
__PRETTY_FUNCTION__ = "client_command_input"
#14 0x080676ed in client_handle_input (client=0x82931b8) at client.c:693
_data_stack_cur_id = 3
ret = 
remove_io = 
handled_commands = false
#15 0x08067ba3 in client_input (client=0x82931b8) at client.c:748
cmd = 
output = (struct ostream *) 0x829336c
bytes = 
__PRETTY_FUNCTION__ = "client_input"
#16 0x080f73a0 in io_loop_handler_run (ioloop=0x828aae0) at ioloop-epoll.c:208
ctx = (struct ioloop_handler_context *) 0x828abe8
event = (const struct epoll_event *) 0x828ac28
list = (struct io_list *) 0x82933f0
io = (struct io_file *) 0x82933c8
tv = {tv_sec = 1799, tv_usec = 999778}
t_id = 2
msecs = 
ret = 1
i = 0
j = 0
call = 
#17 0x080f6830 in io_loop_run (ioloop=0x828aae0) at ioloop.c:338
No locals.
#18 0x080704c5 in main (argc=Cannot access memory at address 0x4c2f
) at main.c:320


Re: [Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-16 Thread Markus Werner
On Thu, Apr 16, 2009 at 07:49:17PM -0400, Timo Sirainen wrote:
> On Wed, 2009-04-08 at 14:40 +0200, Markus Werner wrote:
> > #6  0x080b50eb in mail_user_init (username=0x829854e "") at mail-user.c:30
> 
> Fixed, although I don't really understand why any IMAP client would do
> that.

That fixed it. Thanks. Just for your information: Felamimail, the
mail client of EGroupware, seems to do that.


Re: [Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-16 Thread Markus Werner
On Thu, Apr 16, 2009 at 08:10:00PM -0400, Timo Sirainen wrote:
> > With "list = children" the namespace ist still not listed, but that's no
> > problem for me. With "list = all" now there is a folder named "%"
> > listed, directly under "#User/", additionaly to "mar...@example.com".
> 
> Neither should be happening.. What does shared-mailboxes.db file
> contain?


shared/shared-boxes/user/mar...@example.com/t...@example.com
1
shared/shared-boxes/user/t...@example.com/mar...@example.com
1


> > Accessing the folder "mar...@example.com/ForTest" with Thunderbird results
> > in a segfault. Mutt works.
> 
> Oh. This was a stupid bug. Fixed:
> http://hg.dovecot.org/dovecot-1.2/rev/d7847f03ae65

Thanks.


[Dovecot] Shared folders and subscriptions

2009-04-17 Thread Markus Werner
Hi,

I've got a problem with user shared folders and subscriptions. When I try to
subscribe a folder, dovecot returns "OK Subscribe completed", but the newly
subscribed folder is not listed with LSUB:

a1 login t...@example.com ***
a1 OK [CAP.
a2 list "" "*"
* LIST (\HasChildren) "/" "INBOX"
* LIST (\Noselect \HasChildren) "/" "#User"
* LIST (\Noselect \HasChildren) "/" "#User/mar...@example.com"
* LIST (\HasNoChildren) "/" "#User/mar...@example.com/ForTest"
a3 subscribe "#User/mar...@example.com/ForTest"
a3 OK Subscribe completed.
a4 lsub "" "*"
* LSUB (\Noselect) "/" "#User/mar...@example.com"


Dovecot is 1.2-rc3, namespace configuration as follows:

namespace private {
separator = /
prefix = INBOX/
inbox = yes
subscriptions = yes
}

namespace public {
separator = /
prefix = "#Shared/"
location = 
maildir:/var/spool/dovecot/sharedfolders:INDEX=~/Maildir/index/public:CONTROL=~/Maildir/control/public
subscriptions = yes
}

namespace shared {
separator = /
prefix = "#User/%%u/"
location = 
maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u:CONTROL=~/Maildir/control/shared
subscriptions = yes
list = yes
}

I tried without CONTROL= directory in the shared namespace, but that made no 
difference.

Contents of the subscriptions (with CONTROL=) file after subscribing:

ForTestUser



Regards,
Markus


Re: [Dovecot] Shared folders and subscriptions

2009-04-17 Thread Markus Werner
On Fri, Apr 17, 2009 at 05:22:32PM -0400, Timo Sirainen wrote:
> On Fri, 2009-04-17 at 22:48 +0200, Markus Werner wrote:
> > namespace shared {
> > separator = /
> > prefix = "#User/%%u/"
> > location = 
> > maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u:CONTROL=~/Maildir/control/shared
> > subscriptions = yes
> > list = yes
> > }
> 
> The CONTROL must have also %%u in it, otherwise different shared users'
> control files get mixed together and everything breaks.

Thanks. I completely overlooked that missing part.

> Preferably you should also be using subscriptions=no so you wouldn't
> have to specify CONTROL at all, but for that you'd need to have a
> namespace with prefix="".

Would an additional namespace, for subscriptions only, work? I would
like to keep all subfolders of an Mailbox under INBOX/ .

> Anyway, this fixes subscriptions=yes:
> http://hg.dovecot.org/dovecot-1.2/rev/0dcb7e34a216

Works, thanks.


Re: [Dovecot] Shared folders and subscriptions

2009-04-17 Thread Markus Werner
On Fri, Apr 17, 2009 at 05:43:01PM -0400, Timo Sirainen wrote:
> It would be possible to do both. The INBOX/ could be set up as a hidden
> namespace and the "" namespace would be the default one. Or is there a
> reason why you wouldn't want "" namespace to show up anything?

Crying users, because suddenly something in their clients looks "very"
different :) I have many of those.

> Or you could also see if you could create a private namespace with
> prefix="#User/" and subscriptions=yes, perhaps with
> location=maildir:/var/lib/dovecot/empty:CONTROL=~/Maildir/shared where
> the empty directory would be a world-readable non-writable empty
> directory. That namespace should then catch subscriptions to shared
> mailboxes.

I tried this. The following is logged:

Apr 18 00:12:01 asterix dovecot: IMAP(mar...@example.com):
fchown(/var/spool/dovecot/users/example.com/markus/Maildir/control/shared/subscriptions.lock,
-1, 0) failed: Operation not permitted
Apr 18 00:12:01 asterix dovecot: IMAP(mar...@example.com):
file_dotlock_open() failed with subscription file
/var/spool/dovecot/users/example.com/markus/Maildir/control/shared/subscriptions:
Operation not permitted


Re: [Dovecot] Shared folders and subscriptions

2009-04-18 Thread Markus Werner
On Fri, Apr 17, 2009 at 07:07:49PM -0400, Timo Sirainen wrote:
>> I tried this. The following is logged:
>>
>> Apr 18 00:12:01 asterix dovecot: IMAP(mar...@example.com):
>> fchown(/var/spool/dovecot/users/example.com/markus/Maildir/control/ 
>> shared/subscriptions.lock,
>> -1, 0) failed: Operation not permitted
>
> It tries to preserve the group. Try chmod g+s to the empty directory.

That worked. Thanks again.


Re: [Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-18 Thread Markus Werner
On Thu, Apr 16, 2009 at 08:10:00PM -0400, Timo Sirainen wrote:
> On Wed, 2009-04-08 at 01:03 +0200, Markus Werner wrote:
> > With "list = children" the namespace ist still not listed, but that's no
> > problem for me. With "list = all" now there is a folder named "%"
> > listed, directly under "#User/", additionaly to "mar...@example.com".

Talking IMAP manually, this looks like this:

a003 LIST "" "#User/%"
* LIST (\Noselect \HasChildren) "/" "#User/%"
* LIST (\Noselect \HasChildren) "/" "#User/t...@example.com"
* LIST (\Noselect \HasChildren) "/" "#User/stefa...@example.com"
a003 OK List completed.
a004 LIST "" "#User/%/%"
* LIST (\HasNoChildren) "/" "#User/t...@example.com/Shared"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Software"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Junk"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Apple"
a004 OK List completed.

or with "*":

a003 LIST "" "#User/*"
* LIST (\Noselect \HasChildren) "/" "#User/*"
* LIST (\Noselect \HasChildren) "/" "#User/t...@example.com"
* LIST (\Noselect \HasChildren) "/" "#User/stefa...@example.com"
* LIST (\HasNoChildren) "/" "#User/t...@example.com/Shared"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Software"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Junk"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Apple"
a003 OK List completed.
a004 LIST "" "#User/*/*"
* LIST (\HasNoChildren) "/" "#User/t...@example.com/Shared"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Software"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Junk"
* LIST (\HasNoChildren) "/" "#User/stefa...@example.com/Apple"
a004 OK List completed.


Re: [Dovecot] Segfault in ACL Plugin + user shared folders

2009-04-20 Thread Markus Werner
On Mon, Apr 20, 2009 at 01:28:47PM -0400, Timo Sirainen wrote:
> On Sat, 2009-04-18 at 14:46 +0200, Markus Werner wrote:
> > On Thu, Apr 16, 2009 at 08:10:00PM -0400, Timo Sirainen wrote:
> > > On Wed, 2009-04-08 at 01:03 +0200, Markus Werner wrote:
> > > > With "list = children" the namespace ist still not listed, but that's no
> 
> Fixed: http://hg.dovecot.org/dovecot-1.2/rev/163c3f85a3aa
> 
> > > > problem for me. With "list = all" now there is a folder named "%"
> > > > listed, directly under "#User/", additionaly to "mar...@example.com".
> > 
> > Talking IMAP manually, this looks like this:
> > 
> > a003 LIST "" "#User/%"
> > * LIST (\Noselect \HasChildren) "/" "#User/%"
> 
> Fixed: http://hg.dovecot.org/dovecot-1.2/rev/6a4cccf11702
> 

Both fixes work. Thanks.


[Dovecot] Incorrect listing of shared mailbox names

2009-04-20 Thread Markus Werner
After the LOGIN do STATUS "User/somemailbox":

a0007 STATUS "INBOX/Rechnung" (UIDNEXT UIDVALIDITY UNSEEN RECENT)
a0008 STATUS "User/li...@example.com/Announce" (UIDNEXT UIDVALIDITY UNSEEN 
RECENT)
a0009 STATUS "User/sys...@example.com/INBOX-root" (UIDNEXT UIDVALIDITY UNSEEN 
RECENT)
a0010 STATUS "User/t...@example.com/Shared" (UIDNEXT UIDVALIDITY UNSEEN RECENT)
a0011 STATUS "User/sys...@example.com/INBOX-mueller" (UIDNEXT UIDVALIDITY 
UNSEEN RECENT)
* STATUS "INBOX/Rechnung" (RECENT 0 UIDNEXT 82 UIDVALIDITY 1225738300 UNSEEN 0)
a0007 OK Status completed.
* STATUS "User/li...@example.com/Announce" (RECENT 0 UIDNEXT 103 UIDVALIDITY 
1240061761 UNSEEN 0)
a0008 OK Status completed.
* STATUS "User/sys...@example.com/INBOX-root" (RECENT 0 UIDNEXT 4 UIDVALIDITY 
1240060869 UNSEEN 0)
a0009 OK Status completed.
* STATUS "User/t...@example.com/Shared" (RECENT 0 UIDNEXT 3 UIDVALIDITY 
1225742113 UNSEEN 0)
a0010 OK Status completed.
* STATUS "User/sys...@example.com/INBOX-mueller" (RECENT 0 UIDNEXT 80 
UIDVALIDITY 1240060873 UNSEEN 0)
a0011 OK Status completed.


The first listing of "User/%" also lists the first folder of each user,
which has been polled by STATUS before. This seems to occur one time
(after the login) only.

a0012 LIST "" "%"
* LIST (\Noselect \HasChildren) "/" "User"
* LIST (\HasChildren) "/" "INBOX"
a0012 OK List completed.
a0013 LIST "" "User"
* LIST (\Noselect \HasNoChildren) "/" "User"
* LIST (\Noselect \HasChildren) "/" "User"
a0013 OK List completed.
a0014 LIST "" "User/%"
* LIST (\Noselect \HasChildren) "/" "User/Shared"
* LIST (\Noselect \HasChildren) "/" "User/Announce"
* LIST (\Noselect \HasChildren) "/" "User/INBOX-root"
* LIST (\Noselect \HasChildren) "/" "User/t...@example.com"
* LIST (\Noselect \HasChildren) "/" "User/li...@example.com"
* LIST (\Noselect \HasChildren) "/" "User/sys...@example.com"
a0014 OK List completed.



Used namespace configuration:

namespace private {
separator = /
prefix = INBOX/
inbox = yes
subscriptions = yes
}

namespace private {
separator = /
prefix = User/
location = maildir:/var/lib/dovecot/empty:CONTROL=~/Maildir/control/shared
subscriptions = yes
hidden = yes
list = no
}

namespace shared {
separator = /
prefix = User/%%u/
location = maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u
subscriptions = no
list = yes
}


Re: [Dovecot] Incorrect listing of shared mailbox names

2009-04-29 Thread Markus Werner
On Wed, Apr 29, 2009 at 02:26:58PM -0400, Timo Sirainen wrote:
> On Tue, 2009-04-21 at 08:21 +0200, Markus Werner wrote:
> > The first listing of "User/%" also lists the first folder of each user,
> > which has been polled by STATUS before. This seems to occur one time
> > (after the login) only.
> 
> Fixed: http://hg.dovecot.org/dovecot-1.2/rev/739c4e372140
> 
> Hopefully that's the final bug in there. :)
> 

Bugfix works.