[Dovecot] How to see if sieve is active ?

2009-10-29 Thread Koenraad Lelong

Hi,

I think I activated sieve, but it's doing nothing. I know manage-sieve 
works so I made some rules. But they do nothing.
I ran sieve-test, which seems to work, but does not move the mail I 
test. Is this how it works ? I thought the -e parameter just tested 
the rules and did nothing and my command was supposed to do the real 
thing. I read there should be a log. I don't find this, how should I 
enable this ?


I just found that lda can have a separate log. I'll enable this and see.

I read the wiki-page different times, but I don't see what I'm doing wrong.

I attached some files. Sieve-test.txt is the command and output from 
sieve-test. Phpscript.sieve is the file .dovecot.sieve points to, and 
dovecot-config is my dovecot config ;-).


Thanks for any pointers.

Regards,

Koenraad Lelong.
# 1.2.5: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.22.19-0.4-default x86_64 openSUSE 10.3 (X86-64) 
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot
log_timestamp: %Y-%m-%d %H:%M:%S 
protocols: imap imaps managesieve
listen(default): *:143
listen(imap): *:143
listen(managesieve): *
ssl_listen(default): *:993
ssl_listen(imap): *:993
ssl_listen(managesieve): 
ssl_ca_file: /etc/postfix/certificate/cacert.org.pem
ssl_cert_file: /etc/postfix/certificate/mailbox.pem
ssl_key_file: /etc/postfix/certificate/mailboxkey.pem
disable_plaintext_auth: no
verbose_ssl: yes
login_dir: /var/run/dovecot//login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
first_valid_uid: 499
last_valid_uid: 499
mail_location: maildir:/var/vmail/%d/%u
mail_debug: yes
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugin_dir(default): /usr/lib64/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib64/dovecot/modules/imap
mail_plugin_dir(managesieve): /usr/lib64/dovecot/modules/managesieve
managesieve_logout_format(default): bytes=%i/%o
managesieve_logout_format(imap): bytes=%i/%o
managesieve_logout_format(managesieve): bytes ( in=%i : out=%o )
lda:
  postmaster_address: postmas...@ace-electronics.be
  sendmail_path: /usr/lib/sendmail
  auth_socket_path: /var/run/dovecot/auth-master
  mail_plugins: sieve
auth default:
  mechanisms: plain login
  user: nobody
  passdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  userdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  socket:
type: listen
client:
  path: /var/spool/postfix/private/auth
  mode: 432
  user: postfix
  group: postfix
master:
  path: /var/run/dovecot/auth-master
  mode: 432
  user: vmail
  group: vmail
plugin:
  sieve: ~/.dovecot.sieve
  sieve_dir: ~/sieve
sieve-test .dovecot.sieve new/1256755771.V6806I4ec63M549667.lace3
Performed actions:
 * store message in folder: Opensuse
Implicit keep:
  (none)
Info: final result: success
# This script has been automatically generated by avelsieve
# (Sieve Mail Filters Plugin for Squirrelmail)
# Warning: If you edit this manually, then the changes will not 
# be reflected in the users' front-end!
#AVELSIEVE_VERSIONYTo0OntzOjU6Im1ham9yIjtpOjE7czo1OiJtaW5vciI7aTo5O3M6NzoicmVsZWFzZSI7aTo5O3M6Njoic3RyaW5nIjtzOjU6IjEuOS45Ijt9
#AVELSIEVE_CREATED1256640979
#AVELSIEVE_MODIFIED1256715146
require 
[fileinto,envelope,reject,vacation,imap4flags,relational,comparator-i;ascii-numeric,regex,body,date];
#START_SIEVE_RULEYTo2OntzOjQ6ImNvbmQiO2E6MTp7aTowO2E6NTp7czo0OiJraW5kIjtzOjc6Im1lc3NhZ2UiO3M6NDoidHlwZSI7czo2OiJoZWFkZXIiO3M6NjoiaGVhZGVyIjtzOjc6IlN1YmplY3QiO3M6OToibWF0Y2h0eXBlIjtzOjg6ImNvbnRhaW5zIjtzOjExOiJoZWFkZXJtYXRjaCI7czoxMDoiW29wZW5zdXNlXSI7fX1zOjQ6InR5cGUiO3M6MToiMSI7czo5OiJjb25kaXRpb24iO3M6MzoiYW5kIjtzOjY6ImFjdGlvbiI7czoxOiI1IjtzOjY6ImZvbGRlciI7czo4OiJPcGVuc3VzZSI7czo0OiJzdG9wIjtzOjI6Im9uIjt9END_SIEVE_RULE
if header :contains Subject [opensuse]
{
fileinto  Opensuse;
stop;
}
#START_SIEVE_RULEYTo2OntzOjQ6ImNvbmQiO2E6MTp7aTowO2E6NTp7czo0OiJraW5kIjtzOjc6Im1lc3NhZ2UiO3M6NDoidHlwZSI7czo2OiJoZWFkZXIiO3M6NjoiaGVhZGVyIjtzOjc6IlN1YmplY3QiO3M6OToibWF0Y2h0eXBlIjtzOjg6ImNvbnRhaW5zIjtzOjExOiJoZWFkZXJtYXRjaCI7czo5OiJbRG92ZWNvdF0iO319czo0OiJ0eXBlIjtzOjE6IjEiO3M6OToiY29uZGl0aW9uIjtzOjM6ImFuZCI7czo2OiJhY3Rpb24iO3M6MToiNSI7czo2OiJmb2xkZXIiO3M6NzoiZG92ZWNvdCI7czo0OiJzdG9wIjtzOjI6Im9uIjt9END_SIEVE_RULE
if header :contains Subject [Dovecot]
{
fileinto  dovecot;
stop;
}
#START_SIEVE_RULEYTo2OntzOjQ6ImNvbmQiO2E6MTp7aTowO2E6NTp7czo0OiJraW5kIjtzOjc6Im1lc3NhZ2UiO3M6NDoidHlwZSI7czo2OiJoZWFkZXIiO3M6NjoiaGVhZGVyIjtzOjc6IlN1YmplY3QiO3M6OToibWF0Y2h0eXBlIjtzOjg6ImNvbnRhaW5zIjtzOjExOiJoZWFkZXJtYXRjaCI7czoxNDoiW0JhY3VsYS11c2Vyc10iO319czo0OiJ0eXBlIjtzOjE6IjEiO3M6OToiY29uZGl0aW9uIjtzOjM6ImFuZCI7czo2OiJhY3Rpb24iO3M6MToiNSI7czo2OiJmb2xkZXIiO3M6NjoiQmFjdWxhIjtzOjQ6InN0b3AiO3M6Mjoib24iO30%3DEND_SIEVE_RULE
if header :contains Subject [Bacula-users]
{
fileinto  Bacula;
stop;
}

Re: [Dovecot] How to see if sieve is active ?

2009-10-29 Thread Thomas Leuxner

Am 29.10.2009 um 08:34 schrieb Koenraad Lelong:

I just found that lda can have a separate log. I'll enable this and  
see.


I read the wiki-page different times, but I don't see what I'm doing  
wrong.



Hi,

put something in the LDA section like this to record the activities:

log_path = /var/log/dovecot-deliver.log
info_log_path = /var/log/dovecot-deliver.log

You can raise the logging level with 'mail_debug = yes'. It will then  
dump more information related to sieve. What MTA are you using? If  
Postfix, can you post that configuration as well including 'master.cf'?


It should have those in 'main.cf' for instance:

virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

...and the corresponding entries in 'master.cf'

Regards
Thomas


Re: [Dovecot] Thunderbird and Trash folder

2009-10-29 Thread Aiko Barz
On Thu, Oct 29, 2009 at 06:31:02AM +0100, Stefan Onken wrote:
 I can confirm that two trash folders seems to confuse Thunderbird.

Here is my bugreport from february this year:
https://bugzilla.mozilla.org/show_bug.cgi?id=479226

It's still open.

So long,
Aiko
-- 
:wq ✉


Re: [Dovecot] mailbox count folders issues

2009-10-29 Thread Nikita Koshikov
On Wed, 28 Oct 2009 14:17:52 -0400
Timo Sirainen t...@iki.fi wrote:

 On Wed, 2009-10-28 at 10:39 +0200, Nikita Koshikov wrote:
Oct 26 15:26:38 IMAP(gozhd...@domain.com): Panic: data stack: Out of 
memory when allocating 268435472 bytes
Oct 26 15:26:38 IMAP(gozhd...@domain.com): Error: *** glibc detected 
*** imap: double free or corruption (!prev): 0x0812ba00 ***
 
 Oh, the double free is because of broken handling of out-of-memory
 error. http://hg.dovecot.org/dovecot-1.2/rev/acfef2f0fec3 probably fixes
 that.

Sorry, but this patch didn't help.

 
   It's anyway related to one of your virtual maiboxes. I suppose you have
   a virtual mailbox that includes messages from all real mailboxes?
  
  Yes, I have two virtual mailboxes:
  all - contains all messages
  favorites - contains flagged letters
  
  But this user didn't subscribe to any of them.
 
 Backtrace shows that it crashes while trying to refresh a virtual
 mailbox.
 
 Hmm. So I guess there's no memory corruption causing this, but I don't
 really see why it would try to allocate that much memory. 268435472 in
 hex is 0x1010, which is an interesting number but doesn't really
 help much either.
268435456 is 256M which is max mail_process_size config setting, maybe this 
values is in use ? 

 
 Can you make sure debugging symbols aren't stripped from imap binary
 (i.e. file /usr/.../dovecot/imap says not stripped, this is the
 default when compiling Dovecot from sources) and get gdb backtrace?
 http://dovecot.org/bugreport.html Then I could see exactly where it's
 crashing and figuring out this would be a lot easier.
I recompile dovecot binaries with debug symbols, but seemed that gdb backtrace 
is broken.

r...@mail dovecot-1.2.6 0:0 # file /usr/libexec/dovecot/imap
/usr/libexec/dovecot/imap: ELF 32-bit LSB executable, Intel 80386, version 1 
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

r...@mail dovecot-1.2.6 0:130 # gdb /usr/libexec/dovecot/imap 
/data/mail/domain.com/gozhda.a/core 
GNU gdb 6.8
Copyright (C) 2008 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 i686-pc-linux-gnu...
(no debugging symbols found)

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/dovecot/imap/lib10_quota_plugin.so...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib10_quota_plugin.so
Reading symbols from /usr/lib/dovecot/imap/lib11_imap_quota_plugin.so...(no 
debugging symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib11_imap_quota_plugin.so
Reading symbols from /usr/lib/dovecot/imap/lib11_trash_plugin.so...(no 
debugging symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib11_trash_plugin.so
Reading symbols from /usr/lib/dovecot/imap/lib20_autocreate_plugin.so...(no 
debugging symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib20_autocreate_plugin.so
Reading symbols from /usr/lib/dovecot/imap/lib20_expire_plugin.so...(no 
debugging symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib20_expire_plugin.so
Reading symbols from /usr/lib/dovecot/imap/lib20_virtual_plugin.so...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib20_virtual_plugin.so
Reading symbols from /usr/lib/dovecot/imap/lib20_zlib_plugin.so...(no debugging 
symbols found)...done.
Loaded symbols for /usr/lib/dovecot/imap/lib20_zlib_plugin.so
Reading symbols from /lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libbz2.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libbz2.so.1
Reading symbols from /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/libgcc_s.so.1...(no 
debugging symbols found)...done.
Loaded symbols for /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/libgcc_s.so.1

(no debugging symbols found)
Core was generated by `imap'.
Program terminated with signal 6, Aborted.
[New process 29774]
#0  0xe424 in __kernel_vsyscall ()
(gdb) bt full
#0  0xe424 in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7e6e660 in raise () from /lib/libc.so.6
No symbol table info available.
#2  0xb7e6fe98 

Re: [Dovecot] How to see if sieve is active ?

2009-10-29 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thu, 29 Oct 2009, Thomas Leuxner wrote:


put something in the LDA section like this to record the activities:

  log_path = /var/log/dovecot-deliver.log
  info_log_path = /var/log/dovecot-deliver.log


The user deliver runs as probably may not write to this location, for 
testing you should chown a+rw these files or use syslog.


BTW: Do you have the corresponding compiled binary of the Sieve script? 
.dovecot.sievec (note the 'c') or .dovecot.svbin, respectivly of your 
Sieve variant.


Bye,

- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBSumT+HWSIuGy1ktrAQLQQAf+LSA87Zuux2F60nazMHh4QQRkh39rb3Py
GgySxC0PTI39tcieXZ1HpVYSJNk6xlCcAEygIWmZL2BEh9VEo19xBcwxQFAI6o+H
dkQq5L4S3jdZUiLQMY1rkSVaBs+W9pSQ8/R+5Lz9AzkXPX3G6hLE8r8sG3m+0orQ
iXBaGtL/qOLHpIA3Utk+kMb6ojEh9EbXO6WYq/n7aO/jK3IKUyNkrcjKKWBpey7T
rrTMTYSwtPuLJSdmrIZrpN5pc6pN6BSNi1PzQVFhf9QjT/bZ9pxgqVJmZ2fuOc5i
xmZkHsIip9YHjzFrHqAJ7/uswEGOY6F3mqV9TX93Bg9trnb3j6w/tg==
=yxQ8
-END PGP SIGNATURE-


Re: [Dovecot] second fs quota root crashes

2009-10-29 Thread Juergen Obermann
On Tue, Oct 27, 2009 at 07:19:26PM -0400, Timo Sirainen wrote:
 On Tue, 2009-10-20 at 14:52 +0200, Juergen Obermann wrote:
  Hallo.
  
  In our dovecot 1.2.6 server running under Solaris 9 I would like to set up a
  second quota root because the mail folders are in the users home 
  directories and
  the inboxes of all users are in /var/mail. As soon as I add
  
quota2 = fs:INBOX:noenforcing:mount=/var/mail
  
  the imap client crashes repeatedly as soon as the user tries to open a mail
  folder. 
 
 I guess this helps? http://hg.dovecot.org/dovecot-1.2/rev/439e14ff1467
 
 Or just adding the mount= path to the first quota setting.
 

Hello,

The patch in http://hg.dovecot.org/dovecot-1.2/rev/439e14ff1467 helps with the
crash of the imap client, but the second quota still does not work. The below
log shows, that only the first fs quota is used for the inbox and the mail
folders. Even adding 'mount=/home/hrz' to the first quota setting does not help.
Btw what would be the right mount path setting for an automounter mountpoint
/home for home filesystems?

Thank you, 
Jürgen

Oct 28 15:20:49 horus dovecot: [ID 583609 local0.info] Dovecot v1.2.6 starting 
up

Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Loading 
modules from directory: /opt/local/lib/dovecot/imap
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Module 
loaded: /opt/local/lib/dovecot/imap/lib10_quota_plugin.so
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Module 
loaded: /opt/local/lib/dovecot/imap/lib11_imap_quota_plugin.so
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Effective 
uid=10033, gid=10010, home=/home/hrz/g033
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Quota root: 
name=Home-Verzeichnis backend=fs args=noenforcing
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Quota root: 
name=INBOX backend=fs args=noenforcing:mount=/var/mail
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Namespace: 
type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): mbox: 
data=~/Mail:INBOX=/var/mail/g033
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): fs: 
root=/home/hrz/g033/Mail, index=, control=, inbox=/var/mail/g033
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): fs quota add 
storage dir = /home/hrz/g033/Mail
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): fs quota 
block device = fileserv:/export/home1/hrz
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): fs quota 
mount point = /home/hrz
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): Namespace: 
type=private, prefix=Mail/, sep=/, inbox=no, hidden=yes, list=no, 
subscriptions=yes
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): mbox: 
data=~/Mail:INBOX=/var/mail/g033
Oct 28 15:21:19 horus dovecot: [ID 583609 local0.info] IMAP(g033): fs: 
root=/home/hrz/g033/Mail, index=, control=, inbox=/var/mail/g033
Oct 28 15:21:20 horus dovecot: [ID 583609 local0.info] IMAP(g033): quota-fs: 
host=fileserv, path=/export/home1/hrz, uid=10033, bytes
Oct 28 15:21:20 horus dovecot: [ID 583609 local0.info] IMAP(g033): quota-fs: 
uid=10033, value=1550740480, limit=204800, active=1
Oct 28 15:21:20 horus dovecot: [ID 583609 local0.info] IMAP(g033): 
box=/var/mail/g033 mount=/var/mail match=yes
Oct 28 15:21:20 horus dovecot: [ID 583609 local0.info] IMAP(g033): quota-fs: 
host=fileserv, path=/export/home1/hrz, uid=10033, bytes
Oct 28 15:21:20 horus dovecot: [ID 583609 local0.info] IMAP(g033): quota-fs: 
uid=10033, value=1550740480, limit=204800, active=1
Oct 28 15:21:20 horus dovecot: [ID 583609 local0.info] IMAP(g033): 
box=/var/mail/g033 mount=/var/mail match=yes

Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Loading 
modules from directory: /opt/local/lib/dovecot/imap
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Module 
loaded: /opt/local/lib/dovecot/imap/lib10_quota_plugin.so
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Module 
loaded: /opt/local/lib/dovecot/imap/lib11_imap_quota_plugin.so
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Effective 
uid=10033, gid=10010, home=/home/hrz/g033
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Quota root: 
name=Home-Verzeichnis backend=fs args=noenforcing
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Quota root: 
name=INBOX backend=fs args=noenforcing:mount=/var/mail
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): Namespace: 
type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): mbox: 
data=~/Mail:INBOX=/var/mail/g033
Oct 28 15:21:29 horus dovecot: [ID 583609 local0.info] IMAP(g033): fs: 

Re: [Dovecot] Public Folder Quotas

2009-10-29 Thread Anton Dollmaier

OK thanks just one last query, would the quota rule be something like this?
quota_rule2 = Public*:storage=100M



===
namespace public {
prefix = shared.
separator = .
(...)
}
dict {
  quotadict = mysql:/etc/dovecot/dovecot-dict-quota.conf
  expire = mysql:/etc/dovecot/dovecot-dict-expire.conf
}
  quota = dict:INBOX::proxy::quotadict
  quota2 = dict:shared:%d:ns=shared.:proxy::quotadict
  quota_rule = *:storage=50M:messages=1000
  quota_rule2 = Trash:storage=50M:messages=100
  quota2_rule = *:storage=100M:messages=1000
===

this currently works - you must use the prefix of the namespace as 
parameter in the quota-definition.


Re: [Dovecot] mailbox count folders issues

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 12:11 +0200, Nikita Koshikov wrote:
 On Wed, 28 Oct 2009 14:17:52 -0400
 Timo Sirainen t...@iki.fi wrote:
 
  On Wed, 2009-10-28 at 10:39 +0200, Nikita Koshikov wrote:
 Oct 26 15:26:38 IMAP(gozhd...@domain.com): Panic: data stack: Out of 
 memory when allocating 268435472 bytes
 Oct 26 15:26:38 IMAP(gozhd...@domain.com): Error: *** glibc detected 
 *** imap: double free or corruption (!prev): 0x0812ba00 ***
  
  Oh, the double free is because of broken handling of out-of-memory
  error. http://hg.dovecot.org/dovecot-1.2/rev/acfef2f0fec3 probably fixes
  that.
 
 Sorry, but this patch didn't help.

Not with the out of memory, but did it get rid of the double free or
corruption error?

  Hmm. So I guess there's no memory corruption causing this, but I don't
  really see why it would try to allocate that much memory. 268435472 in
  hex is 0x1010, which is an interesting number but doesn't really
  help much either.
 268435456 is 256M which is max mail_process_size config setting, maybe this 
 values is in use ? 

I guess it's just exponentially increasing the buffer size then until it
reaches mail_process_size.

 I recompile dovecot binaries with debug symbols, but seemed that gdb 
 backtrace is broken.

Yeah, it is. Hmm. Since the core isn't working, can you attach gdb to
imap process while it's still running? So something like:

 - open the account so imap process starts
 - gdb -p imap process pid
 - gdb command: c
 - cause imap to crash - gdb should stop
 - gdb command: bt full



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot-shared and shared \Seen flags

2009-10-29 Thread Timo Sirainen
On Wed, 2009-10-28 at 16:21 -0500, Dave wrote:
 (Running Dovecot 1.1.0)  Is it possible to either -
 
 (a) Still have shared \Seen flags even while using the dovecot-shared file

Not currently.

 (b) Indicate to Dovecot in some way other than the dovecot-shared file 
 which permissions to use for any messages created?

In v1.2 the permissions are taken from parent directory.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] second fs quota root crashes

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 14:21 +0100, Juergen Obermann wrote:
 The patch in http://hg.dovecot.org/dovecot-1.2/rev/439e14ff1467 helps with the
 crash of the imap client, but the second quota still does not work. 

What does it show if you give:

a GETQUOTA Home-Verzeichnis
b GETQUOTA INBOX
c GETQUOTAROOT INBOX
d GETQUOTAROOT some other mailbox name than INBOX

i.e. is the problem that there really isn't those two quotas, or one of
them returns wrong value, or one of them just isn't listed, or..?

 The below
 log shows, that only the first fs quota is used for the inbox and the mail
 folders. 

I thought the logs showed both of the quotas.

 Even adding 'mount=/home/hrz' to the first quota setting does not help.
 Btw what would be the right mount path setting for an automounter mountpoint
 /home for home filesystems?

mount=%h maybe?


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Wish-list: X-Delivered-To headers generated by dovecot-deliver

2009-10-29 Thread Timo Sirainen
On Wed, 2009-10-28 at 09:08 +0100, Andrzej Adam Filip wrote:
 By specifying content of the header(s) via command line parameter(s)
 
 e.g.
 deliver -d userx -x us...@gmail.com
   X-Delivered-To: us...@gmail.com

I guess there could be a new command line parameter that allows you to
specify any header you want. Something like:

deliver -h 'X-Delivered-To: f...@bar.org' -h 'X-Hello: world'

But.. It's a bit more work than I want to spend on it right now. I'll
add to todo at least, or maybe someone else can implement it..



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Wish-list: X-Delivered-To headers generated by dovecot-deliver

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 13:03 -0400, Timo Sirainen wrote:
 On Wed, 2009-10-28 at 09:08 +0100, Andrzej Adam Filip wrote:
  By specifying content of the header(s) via command line parameter(s)
  
  e.g.
  deliver -d userx -x us...@gmail.com
X-Delivered-To: us...@gmail.com
 
 I guess there could be a new command line parameter that allows you to
 specify any header you want. Something like:
 
 deliver -h 'X-Delivered-To: f...@bar.org' -h 'X-Hello: world'

Oh, and you could of course already do this with an ugly shell script:

(echo X-Delivered-To: u...@domain; grep -v ^X-Delivered-To:) | deliver


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Multiple LDAP Userdb lookups

2009-10-29 Thread Timo Sirainen
On Wed, 2009-10-28 at 09:29 +, David wrote:
 So, if I add another ldap stanza to dovecot.conf will I break anything?

Should work fine.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] expire plugin + --exec-mail in 1.2.6 version

2009-10-29 Thread Timo Sirainen
On Wed, 2009-10-28 at 10:30 +0200, Nikita Koshikov wrote:
 The  problem that some users have their own quotas stored in ldap. 

So the quota_rule should be returned by userdb lookup from ldap, right?

 Info: auth input: uid=8
 Info: auth input: gid=12
 Info: auth input: home=/data/mail/domain.com/koshikov.n
 Info: auth input: mail=maildir:~/data

This should have listed quota_rule.

 If dovecot -n output is needed, please let me know.

If the above doesn't help, then yeah, dovecot -n and dovecot-ldap.conf
contents.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Wish-list: X-Delivered-To headers generated by dovecot-deliver

2009-10-29 Thread Andrzej Adam Filip
Timo Sirainen t...@iki.fi wrote:
 On Thu, 2009-10-29 at 13:03 -0400, Timo Sirainen wrote:
 On Wed, 2009-10-28 at 09:08 +0100, Andrzej Adam Filip wrote:
  By specifying content of the header(s) via command line parameter(s)
  
  e.g.
  deliver -d userx -x us...@gmail.com
X-Delivered-To: us...@gmail.com
 
 I guess there could be a new command line parameter that allows you to
 specify any header you want. Something like:
 
 deliver -h 'X-Delivered-To: f...@bar.org' -h 'X-Hello: world'

 Oh, and you could of course already do this with an ugly shell script:

 (echo X-Delivered-To: u...@domain; grep -v ^X-Delivered-To:) |
 deliver

I have done it via perl script executed from procmail script [...@2002 ;-)]
  http://anfi.homeunix.org/sendmail/sharedmailbox.html
Does such vote of no confidence in dovecot's deliver and sieve make
you happy? ;-)

BTW could you add to your todo list an option for making deliver use
sieve script specified via command line including turning off sieve
scripts via command line?

-- 
[plen: Andrew] Andrzej Adam Filip : a...@onet.eu
The Shuttle is now going five times the sound of speed.
  -- Dan Rather, first landing of Columbia


Re: [Dovecot] Wish-list: X-Delivered-To headers generated by dovecot-deliver

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 18:38 +0100, Andrzej Adam Filip wrote:
 BTW could you add to your todo list an option for making deliver use
 sieve script specified via command line including turning off sieve
 scripts via command line?

In v2.0 you can override settings. For example:

dovecot-lda -o plugin/sieve=/foo/bar.sieve

dovecot-lda -o mail_plugins=



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Wish-list: X-Delivered-To headers generated by dovecot-deliver

2009-10-29 Thread Andrzej Adam Filip
Timo Sirainen t...@iki.fi wrote:
 On Thu, 2009-10-29 at 18:38 +0100, Andrzej Adam Filip wrote:
 BTW could you add to your todo list an option for making deliver use
 sieve script specified via command line including turning off sieve
 scripts via command line?

 In v2.0 you can override settings. For example:

 dovecot-lda -o plugin/sieve=/foo/bar.sieve

 dovecot-lda -o mail_plugins=

OK - so I merely need to wait patiently :-)

-- 
[plen: Andrew] Andrzej Adam Filip : a...@onet.eu
Humanity has the stars in its future, and that future is too important to be
lost under the burden of juvenile folly and ignorant superstition.
  -- Isaac Asimov


Re: [Dovecot] Error: NO Mailbox is locked

2009-10-29 Thread Giovanni Mancuso
Timo Sirainen wrote:
 Do you have more than one Dovecot instance accessing the mailboxes in NFS 
 server? 
   
Yes, I have two Dovecot istance that accessing in mailboxes.
I have a balancer that balance traffic to imap server.

Bye


Re: [Dovecot] pop3-login: Fatal: io_loop_handle_add: epoll_ctl(1, 5):

2009-10-29 Thread Brandon Davidson
We've had this reoccur twice this week. In both cases, it seems to hit a
swath of machines all within a few minutes. For some reason it's been
limited to the master serving pop3 only. In all cases, the logging
socket at fd 5 had gone missing.

I haven't applied the fd leak detection patch, but I do have lsof output
and a core file available here:
http://uoregon.edu/~brandond/dovecot-1.2.6/

Timo, is there anything else I can collect to assist in debugging this?
I'd rather not go back to 1.2.4, but my coworkers are becoming annoyed
at having to restart the master processes every few days.

-Brad


Re: [Dovecot] pop3-login: Fatal: io_loop_handle_add: epoll_ctl(1, 5):

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 12:08 -0700, Brandon Davidson wrote:
 I haven't applied the fd leak detection patch, but I do have lsof output
 and a core file available here:
 http://uoregon.edu/~brandond/dovecot-1.2.6/

There's no 0,12 in the lsof list.. Annoying, I can't seem to find what
it is. 0,10 is inotify, 0,11 is epoll, but 0,12 just doesn't show up
anywhere. 

The core file is also pretty useless without the exact same binaries and
libraries that produced it.

 Timo, is there anything else I can collect to assist in debugging this?
 I'd rather not go back to 1.2.4, but my coworkers are becoming annoyed
 at having to restart the master processes every few days.

You could also set login_process_per_connection=no and this should go
away, because then it only creates login processes at startup and can't
fail randomly later.


signature.asc
Description: This is a digitally signed message part


[Dovecot] Question about Windows Mail for Vista IMAP client

2009-10-29 Thread Stewart Dean
When TBird logs on, it does it quietly, that is it opens one or two 
logins.  When you start working it'll open a few more.

Quiet, no thrashing around

When WM4Vista opens, it appears to login and disconnect (immediately) 
once for every folder a person has.  20 folders, 20 logins and 
disconnect, ripple fire.
Anybody have an idea why WM4V is so busy and TB is quiet doing the same 
thing?  I fell over this doing testing on V1.2.6 but find it's also the 
case back on my production V1.1.15

--
 Once upon a time, the Internet was a friendly, 
neighbors-helping-neighbors small town, and no one locked their doors. 
Now it's like an apartment in Bed-Stuy: you need three heavy duty 
pick-proof locks, one of those braces that goes from the lock to the 
floor, and bars on the windows  Stewart Dean, Unix System Admin, 
Bard College, New York 12504 sd...@bard.edu voice: 845-758-7475, fax: 
845-758-7035




Re: [Dovecot] pop3-login: Fatal: io_loop_handle_add: epoll_ctl(1, 5):

2009-10-29 Thread Timo Sirainen
If this really started happening only with v1.2.4 - v1.2.5, the only
change that looks anything like it could have to do with this problem is
the attached patch. I guess you could try reversing it and seeing if it
helps..

--- /home/timo/m/dovecot-1.2.4/src/master/main.c	2009-05-20 17:48:16.0 -0400
+++ ./main.c	2009-10-29 16:05:50.0 -0400
@@ -139,6 +139,46 @@
 	i_set_failure_timestamp_format(set-log_timestamp);
 }
 
+static void ATTR_NORETURN
+tee_fatal_handler(enum log_type type, int status, const char *fmt, va_list args)
+{
+	const struct settings *set = settings_root-defaults;
+	va_list args2;
+
+	VA_COPY(args2, args);
+	fprintf(stderr, Fatal: %s\n, t_strdup_vprintf(fmt, args2));
+
+	if (*set-log_path == '\0') {
+		i_syslog_fatal_handler(type, status, fmt, args);
+	} else {
+		default_fatal_handler(type, status, fmt, args);
+	}
+}
+
+static void
+tee_error_handler(enum log_type type, const char *fmt, va_list args)
+{
+	const struct settings *set = settings_root-defaults;
+	va_list args2;
+
+	VA_COPY(args2, args);
+	fprintf(stderr, Error: %s\n, t_strdup_vprintf(fmt, args2));
+
+	if (*set-log_path == '\0') {
+		i_syslog_error_handler(type, fmt, args);
+	} else {
+		default_error_handler(type, fmt, args);
+	}
+}
+
+static void set_tee_logfile(struct settings *set)
+{
+	set_logfile(set);
+
+	i_set_fatal_handler(tee_fatal_handler);
+	i_set_error_handler(tee_error_handler);
+}
+
 static void settings_reload(void)
 {
 	struct server_settings *old_set = settings_root;
@@ -222,7 +262,7 @@
 	fd_close_on_exec(null_fd, TRUE);
 }
 
-static void open_fds(void)
+static void open_std_fds(void)
 {
 	/* make sure all fds between 0..3 are used. */
 	while (null_fd  4) {
@@ -232,12 +272,6 @@
 		fd_close_on_exec(null_fd, TRUE);
 	}
 
-	if (!IS_INETD()) {
-		T_BEGIN {
-			listeners_open_fds(NULL, FALSE);
-		} T_END;
-	}
-
 	/* close stdin and stdout. */
 	if (dup2(null_fd, 0)  0)
 		i_fatal(dup2(0) failed: %m);
@@ -600,11 +634,20 @@
 		mail_process_exec(exec_protocol, exec_args);
 	}
 
-	if (!log_error)
-		open_fds();
+	/* closes stdin/stdout, must be after --exec-mail handling */
+	open_std_fds();
+
+	/* log all errors to both stderr and log file until we've finished
+	   startup. */
+	set_tee_logfile(settings_root-defaults);
 
 	fatal_log_check();
 	auth_warning_print(settings_root);
+
+	if (!log_error  !IS_INETD()) T_BEGIN {
+		listeners_open_fds(NULL, FALSE);
+	} T_END;
+
 	if (!foreground)
 		daemonize(settings_root-defaults);
 	master_original_pid = getpid();


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] 1.1 Quota Question

2009-10-29 Thread Marty Anstey

 We are currently running Dovecot 1.1.16  Postfix; maildir++.

 When a message arrives for a mailbox which is over quota, it is bounced.
 Obviously, this isn't very desirable; the primary downside to this is
 that when junk mail hits a full mailbox it's bounced to that recipient
 of the message. On a busy mail system, that could potentially get us
 blacklisted pretty quickly. Ideally we would like to reject the messages
 inline. Is there an easy way to set this up?
 

 a) Use deliver -e parameter and configure your MTA to wait on replying
 to DATA command until deliver has finished. I don't know how to make
 Postfix do this (or perhaps it does it by default? dunno).

 b) Use quota_warning scripts on 100% quota usage to update user's quota
 full bit in a database (or wherever) and have Postfix reject RCPT TO
 command based on that information. I don't know how to do that on
 Postfix's side either.  
Thanks for the feedback.

Option (a) sounds like the cleanest solution, but a bit of testing
showed that Postfix doesn't wait on deliver before replying to DATA so
this seems to always result in a bounce. I've perused the postfix
documentation but so far no luck; if anyone reading this has any insight
on how we might configure postfix to behave this way, could you please
let me know (maybe offlist would be best, as this may be considered
somewhat off-topic).

We are using something similar to option (b) currently, but it's not
really an elegant approach and we would really like to move away from
it. Option (a) sounds great, if we can somehow get it to work.

TIA,
Marty




Re: [Dovecot] pop3-login: Fatal: io_loop_handle_add: epoll_ctl(1, 5):

2009-10-29 Thread Brandon Davidson
Hi Timo,

 -Original Message-
 From: Timo Sirainen [mailto:t...@iki.fi]
 
 On Thu, 2009-10-29 at 12:08 -0700, Brandon Davidson wrote:
  I haven't applied the fd leak detection patch, but I do have lsof
output
  and a core file available here:
  http://uoregon.edu/~brandond/dovecot-1.2.6/
 
 There's no 0,12 in the lsof list.. Annoying, I can't seem to find what
 it is. 0,10 is inotify, 0,11 is epoll, but 0,12 just doesn't show up
 anywhere.

It looks like eventpoll uses the dynamic minor stuff (.minor =
MISC_DYNAMIC_MINOR), so it could well be that this is just what it got
on his system due to something else loading and requesting a dynamic
minor before eventpoll loaded. A better check (if one is necessary)
might be to see if the minor of the leaked device is different from the
minor of the epoll device right after creation.

 The core file is also pretty useless without the exact same binaries
and
 libraries that produced it.

RPMs are now in that directory.

 You could also set login_process_per_connection=no and this should go
 away, because then it only creates login processes at startup and
can't
 fail randomly later.

Are there any downsides to doing this?

-Brad


Re: [Dovecot] dovecot-shared and shared \Seen flags

2009-10-29 Thread Dave

 (b) Indicate to Dovecot in some way other than the dovecot-shared file
 which permissions to use for any messages created?

 In v1.2 the permissions are taken from parent directory.

Hmm, that might be the best solution then, an upgrade to 1.2.  Fwiw, I 
also tried NOT using the dovecot-shared file and just relying on the 
UMASK=007 directive I put in .procmailrc to create the messages with the 
correct permissions. and that worked!  Well, as far as the messages 
themselves go.  However, the dovecot.index, dovecot.index.log, and 
dovecot-uidlist all got rewritten with only user permissions and created 
problems.  I'm guessing dovecot-shared is the only way to make sure 
those files keep their correct permissions?


David





Re: [Dovecot] dovecot-shared and shared \Seen flags

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 16:16 -0500, Dave wrote:
  (b) Indicate to Dovecot in some way other than the dovecot-shared file
   which permissions to use for any messages created?
  
   In v1.2 the permissions are taken from parent directory.
 
 Hmm, that might be the best solution then, an upgrade to 1.2.  Fwiw, I 
 also tried NOT using the dovecot-shared file and just relying on the 
 UMASK=007 directive I put in .procmailrc to create the messages with the 
 correct permissions. and that worked!  Well, as far as the messages 
 themselves go.  However, the dovecot.index, dovecot.index.log, and 
 dovecot-uidlist all got rewritten with only user permissions and created 
 problems.  

v1.2 is the first version that actually tries to handle permissions
correctly everywhere. In previous versions umask sometimes did something
and sometimes it didn't.

 I'm guessing dovecot-shared is the only way to make sure 
 those files keep their correct permissions?

There's also umask setting in dovecot.conf that I think overrides the
UMASK in procmail. You could try setting it, but if that doesn't help
either then yeah, v1.2 or dovecot-shared are the only possibilities.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Public Folder Quotas

2009-10-29 Thread Peter Fraser
The public mailbox quota works fine. Thanks to ll who helped. I'm running 1.2.4
This is what I did to get a public folder called newsletters with
quota of 100M

1. Create a maildir called newsletters
2. Entered this to define the namespace in dovecot.conf

namespace public {
  separator = /
  prefix = newsletters/
  list = yes
  subscriptions = yes
  location = maildir:/home/public/newsletters
}

3. quota3 = maildir:Public quota:ns=newsletters/
4. quota3_rule = *:storage=100M

Thanks again.

On Thu, Oct 29, 2009 at 10:05 AM, Anton Dollmaier
antondollma...@aditsystems.de wrote:
 OK thanks just one last query, would the quota rule be something like
 this?
 quota_rule2 = Public*:storage=100M


 ===
 namespace public {
        prefix = shared.
        separator = .
 (...)
 }
 dict {
  quotadict = mysql:/etc/dovecot/dovecot-dict-quota.conf
  expire = mysql:/etc/dovecot/dovecot-dict-expire.conf
 }
  quota = dict:INBOX::proxy::quotadict
  quota2 = dict:shared:%d:ns=shared.:proxy::quotadict
  quota_rule = *:storage=50M:messages=1000
  quota_rule2 = Trash:storage=50M:messages=100
  quota2_rule = *:storage=100M:messages=1000
 ===

 this currently works - you must use the prefix of the namespace as parameter
 in the quota-definition.



Re: [Dovecot] pop3-login: Fatal: io_loop_handle_add: epoll_ctl(1, 5):

2009-10-29 Thread Timo Sirainen
On Thu, 2009-10-29 at 14:03 -0700, Brandon Davidson wrote:

  You could also set login_process_per_connection=no and this should go
  away, because then it only creates login processes at startup and
 can't
  fail randomly later.
 
 Are there any downsides to doing this?

http://wiki.dovecot.org/LoginProcess



signature.asc
Description: This is a digitally signed message part