Re: [Dovecot] expire tool - individual user/folder?
Hello, The patch shouldn't really have changed anything. in 1.1.16 it works without the patch. And I didn't fix anything in 1.1.16 either. Maybe it was some weird compiling issue or something.. i do not have an explanation, but effect is the same. i repackaged 1.1.15 with and without patch and only the one with the patch works. for 1.1.16 i do not need a patch. gcc is 4.1.2 but its not important for me, just some tests... Andre
Re: [Dovecot] expire tool - individual user/folder?
On Tue, 2009-06-02 at 20:21 +0200, Andre Hübner wrote: > > This is what I meant actually, the name just changed in v1.2. > > > What do you get with the attached patch? > > patch fixes the problem in both cases. it does not care if --enable-debug > is enabled or disabled. The patch shouldn't really have changed anything. > in 1.1.16 it works without the patch. And I didn't fix anything in 1.1.16 either. Maybe it was some weird compiling issue or something.. signature.asc Description: This is a digitally signed message part
Re: [Dovecot] expire tool - individual user/folder?
This is what I meant actually, the name just changed in v1.2. What do you get with the attached patch? patch fixes the problem in both cases. it does not care if --enable-debug is enabled or disabled. in 1.1.16 it works without the patch. Thanks, Andre
Re: [Dovecot] expire tool - individual user/folder?
On Tue, 2009-05-26 at 09:35 +0200, Andre Hübner wrote: > > Does the problem go away if you don't configure Dovecot with > > --enable-devel-checks? > > no, its not included in my configure-line. This is it: .. > --enable-debug This is what I meant actually, the name just changed in v1.2. What do you get with the attached patch? diff -r 140bd7523890 src/plugins/expire/auth-client.c --- a/src/plugins/expire/auth-client.c Sun May 31 19:32:54 2009 -0400 +++ b/src/plugins/expire/auth-client.c Sun May 31 19:39:45 2009 -0400 @@ -138,8 +138,11 @@ return; } - if (conn->orig_uid == 0 || getegid() != gid) - env_put(t_strconcat("RESTRICT_SETGID=", dec2str(gid), NULL)); + if (conn->orig_uid == 0 || getegid() != gid) { + const char *s = dec2str(gid); + i_warning("gid=%s", s); + env_put(t_strconcat("RESTRICT_SETGID=", s, NULL)); + } if (uid != conn->current_uid && conn->current_uid != 0) { if (seteuid(0) != 0) signature.asc Description: This is a digitally signed message part
Re: [Dovecot] expire tool - individual user/folder?
Does the problem go away if you don't configure Dovecot with --enable-devel-checks? no, its not included in my configure-line. This is it: ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/share/man \ --with-ssl=openssl \ --with-storages=mbox,maildir,raw \ --with-pam \ --with-passwd \ --with-db \ --enable-debug i just added --enable-debug after having the segfaults whren running the expire-tool to see more lines... sorry for always making problems ;) Andre
Re: [Dovecot] expire tool - individual user/folder?
On Tue, 2009-05-26 at 09:20 +0200, Andre Hübner wrote: > > That really shouldn't be happening. What dovecot version is this with? > > Can you run it with valgrind? > > its version 1.1.15 > > valgrind --trace-children=yes dovecot --exec-mail ext > /usr/libexec/dovecot/expire-tool --test .. > Warning: Growing pool 'Expire pool' with: 1024 > ==31981== Invalid read of size 1 > ==31981==at 0x4021FB8: strlen (in > /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so) > ==31981==by 0x80BA37F: vstrconcat (strfuncs.c:165) > ==31981==by 0x80BABE2: t_strconcat (strfuncs.c:265) > ==31981==by 0x804A948: auth_input (auth-client.c:142) Does the problem go away if you don't configure Dovecot with --enable-devel-checks? signature.asc Description: This is a digitally signed message part
Re: [Dovecot] expire tool - individual user/folder?
That really shouldn't be happening. What dovecot version is this with? Can you run it with valgrind? its version 1.1.15 valgrind --trace-children=yes dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test ==31981== Memcheck, a memory error detector. ==31981== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al. ==31981== Using LibVEX rev 1575, a library for dynamic binary translation. ==31981== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. ==31981== Using valgrind-3.1.1, a dynamic binary instrumentation framework. ==31981== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. ==31981== For more details, rerun with: -v ==31981== ==31981== Memcheck, a memory error detector. ==31981== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al. ==31981== Using LibVEX rev 1575, a library for dynamic binary translation. ==31981== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. ==31981== Using valgrind-3.1.1, a dynamic binary instrumentation framework. ==31981== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. ==31981== For more details, rerun with: -v ==31981== Warning: Growing pool 'Expire pool' with: 1024 ==31981== Invalid read of size 1 ==31981==at 0x4021FB8: strlen (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so) ==31981==by 0x80BA37F: vstrconcat (strfuncs.c:165) ==31981==by 0x80BABE2: t_strconcat (strfuncs.c:265) ==31981==by 0x804A948: auth_input (auth-client.c:142) ==31981==by 0x80B1A16: io_loop_handler_run (ioloop-epoll.c:209) ==31981==by 0x80B0B07: io_loop_run (ioloop.c:336) ==31981==by 0x804A5E3: auth_client_put_user_env (auth-client.c:229) ==31981==by 0x804B5C6: main (expire-tool.c:43) ==31981== Address 0x4 is not stack'd, malloc'd or (recently) free'd ==31981== ==31981== Process terminating with default action of signal 11 (SIGSEGV) ==31981== Access not within mapped region at address 0x4 ==31981==at 0x4021FB8: strlen (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so) ==31981==by 0x80BA37F: vstrconcat (strfuncs.c:165) ==31981==by 0x80BABE2: t_strconcat (strfuncs.c:265) ==31981==by 0x804A948: auth_input (auth-client.c:142) ==31981==by 0x80B1A16: io_loop_handler_run (ioloop-epoll.c:209) ==31981==by 0x80B0B07: io_loop_run (ioloop.c:336) ==31981==by 0x804A5E3: auth_client_put_user_env (auth-client.c:229) ==31981==by 0x804B5C6: main (expire-tool.c:43) ==31981== ==31981== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 3 from 1) ==31981== malloc/free: in use at exit: 34,477 bytes in 35 blocks. ==31981== malloc/free: 36 allocs, 1 frees, 34,637 bytes allocated. ==31981== For counts of detected errors, rerun with: -v ==31981== searching for pointers to 35 not-freed blocks. ==31981== checked 93,876 bytes. ==31981== ==31981== LEAK SUMMARY: ==31981==definitely lost: 0 bytes in 0 blocks. ==31981== possibly lost: 0 bytes in 0 blocks. ==31981==still reachable: 34,477 bytes in 35 blocks. ==31981== suppressed: 0 bytes in 0 blocks. ==31981== Reachable blocks (those to which a pointer was found) are not shown. ==31981== To see them, rerun with: --show-reachable=yes Segmentation Fault Andre
Re: [Dovecot] expire tool - individual user/folder?
On Tue, 2009-05-26 at 08:50 +0200, Andre Hübner wrote: > #1 0x080ba380 in vstrconcat (str1=0x80bd017 "RESTRICT_SETGID=", > args=0xbfd4bd78 "", ret_len=0xbfd4bd5c) at strfuncs.c:165 > str = 0x4 > temp = 0x80d6330 "RESTRICT_SETGID=", 'Þ' ... > bufsize = 512 > i = 16 > len = 16 > __PRETTY_FUNCTION__ = "vstrconcat" > #2 0x080babe3 in t_strconcat (str1=0x80bd017 "RESTRICT_SETGID=") at > strfuncs.c:265 > args = 0xbfd4bd74 "\004" > len = 28 > #3 0x0804a949 in auth_input (conn=0x80da350) at auth-client.c:142 > line = That really shouldn't be happening. What dovecot version is this with? Can you run it with valgrind? valgrind --trace-children=yes dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test signature.asc Description: This is a digitally signed message part
Re: [Dovecot] expire tool - individual user/folder?
Hello, ulimit -c unlimited dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test gdb /usr/libexec/dovecot/expire-tool core bt full here is the output. i am not in a hurry, for me it was just testing. But you are surely interested... gdb /usr/libexec/dovecot/expire-tool core GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux"...Using host libthread_db library "/lib/libthread_db.so.1". Core was generated by `expire-tool --test'. Program terminated with signal 11, Segmentation fault. warning: Can't read pathname for load map: Eingabe-/Ausgabefehler. Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0xb7e5eeb3 in strlen () from /lib/libc.so.6 (gdb) bt full #0 0xb7e5eeb3 in strlen () from /lib/libc.so.6 No symbol table info available. #1 0x080ba380 in vstrconcat (str1=0x80bd017 "RESTRICT_SETGID=", args=0xbfd4bd78 "", ret_len=0xbfd4bd5c) at strfuncs.c:165 str = 0x4 temp = 0x80d6330 "RESTRICT_SETGID=", 'Þ' ... bufsize = 512 i = 16 len = 16 __PRETTY_FUNCTION__ = "vstrconcat" #2 0x080babe3 in t_strconcat (str1=0x80bd017 "RESTRICT_SETGID=") at strfuncs.c:265 args = 0xbfd4bd74 "\004" len = 28 #3 0x0804a949 in auth_input (conn=0x80da350) at auth-client.c:142 line = #4 0x080b1a17 in io_loop_handler_run (ioloop=0x80da1a8) at ioloop-epoll.c:209 ctx = event = (const struct epoll_event *) 0x80da580 list = (struct io_list *) 0x80dadb0 io = (struct io_file *) 0x80da520 tv = {tv_sec = 2147483, tv_usec = 0} t_id = 3 msecs = ret = 1 i = 0 call = #5 0x080b0b08 in io_loop_run (ioloop=0x80da1a8) at ioloop.c:336 No locals. #6 0x0804a5e4 in auth_client_put_user_env (conn=0x80da350, user=0x80d6060 "m0127a22") at auth-client.c:229 No locals. #7 0x0804b5c7 in main (argc=Cannot access memory at address 0x0 ) at expire-tool.c:43 _data_stack_cur_id = 2 ioloop = (struct ioloop *) 0x80da1a8 test = (gdb) exit Undefined command: "exit". Try "help". (gdb) quit Thanks, Andre
Re: [Dovecot] expire tool - individual user/folder?
On Mon, 2009-05-25 at 14:38 +0200, Andre Hübner wrote: > Hello, > > > The plugin yes, but expire-tool not really. It would be possible to have > > userdb lookups return an overridden expire setting and use it instead of > > the global one, but that would require writing more code.. > > > i have made 2 testsetups with expire-plugin (mysql,dbd) > it seems to work, in table i can find new entry for expire_stamp > But how i can make individual settings for different users? adding > user/folder in dovecot.conf gets ignored. You can override a setting by returning it from userdb. http://wiki.dovecot.org/UserDatabase/ExtraFields > second question is much more importend. how to debug this if i get > seg.faults when running > "dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test" ? ulimit -c unlimited dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test gdb /usr/libexec/dovecot/expire-tool core bt full But as I said, you can't get expire-tool to work properly with different settings. It will always use only the settings you have in dovecot.conf, messing up all the database for the non-default users. signature.asc Description: This is a digitally signed message part
Re: [Dovecot] expire tool - individual user/folder?
Hello, The plugin yes, but expire-tool not really. It would be possible to have userdb lookups return an overridden expire setting and use it instead of the global one, but that would require writing more code.. i have made 2 testsetups with expire-plugin (mysql,dbd) it seems to work, in table i can find new entry for expire_stamp But how i can make individual settings for different users? adding user/folder in dovecot.conf gets ignored. is the plan to add separat settings directly in the expire-dict? (adding lines in mysql-table?) second question is much more importend. how to debug this if i get seg.faults when running "dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test" ? basically connect to mysql/dbd is working. if is expire-timestamp in future i get correct results. problem occurs when a folder is expired and action is required. how can i debug this to find real error? Common debugsettings in dovecot.conf seems not to work. i did compile with --enable-debug but all i got is: # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool --test Warning: Growing pool 'Expire pool' with: 1024 Segmentation Fault Thanks, Andre
Re: [Dovecot] expire tool - individual user/folder?
On Thu, 2009-04-23 at 08:52 +0200, Andre Hübner wrote: > is the expire plugin usable to delete mails with different settings for each > individual user? > If i view sample config at http://wiki.dovecot.org/Plugins/Expire it looks > like expire-data are related to foldernames. > Is it possible to let each user "activate" the expire-plugin for different > folders with different settings? The plugin yes, but expire-tool not really. It would be possible to have userdb lookups return an overridden expire setting and use it instead of the global one, but that would require writing more code.. signature.asc Description: This is a digitally signed message part
[Dovecot] expire tool - individual user/folder?
Hello, is the expire plugin usable to delete mails with different settings for each individual user? If i view sample config at http://wiki.dovecot.org/Plugins/Expire it looks like expire-data are related to foldernames. Is it possible to let each user "activate" the expire-plugin for different folders with different settings? Thanks, Andre