[Dovecot] quota not updated

2010-08-02 Thread Martin Ott
Hi,

we're using quota with the maildir backend. When new mail arrives, the quota
gets updated. But when mail is expunged, quota stays the same (see imap dialog
below). We're using the latest version from hg ( 1.2.13 ). Any ideas?

###quota part from dovecot -n

plugin:
  quota: maildir:User quota
  quota_rule: *:storage=2000M
  quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
  quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
  quota2: maildir:Shared quota:ns=shared/
  quota2_rule: *:storage=1M

###imap dialog:

* PREAUTH [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 ACL RIGHTS=texk QUOTA]
Logged in as user
a01 select INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk $MDNSent $Forwarded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk
$MDNSent $Forwarded \*)] Flags permitted.
* 15 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1264203739] UIDs valid
* OK [UIDNEXT 1133] Predicted next UID
* OK [HIGHESTMODSEQ 3543] Highest
a01 OK [READ-WRITE] Select completed.
a02 getquotaroot INBOX
* QUOTAROOT INBOX User quota
* QUOTA User quota (STORAGE 302485 2048000)
a02 OK Getquotaroot completed.
a03 store 15 +Flags \Deleted
* 15 FETCH (FLAGS (\Deleted \Seen NonJunk))
a03 OK Store completed.
a04 expunge
* 15 EXPUNGE
a04 OK Expunge completed.
a05 select INBOX
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk $MDNSent $Forwarded)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk
$MDNSent $Forwarded \*)] Flags permitted.
* 14 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1264203739] UIDs valid
* OK [UIDNEXT 1133] Predicted next UID
* OK [HIGHESTMODSEQ 3545] Highest
a05 OK [READ-WRITE] Select completed.
a06 getquotaroot INBOX
* QUOTAROOT INBOX User quota
* QUOTA User quota (STORAGE 302485 2048000)
a06 OK Getquotaroot completed.

Regards,
Martin


Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Denny Schierz
hi,

Am Freitag, den 30.07.2010, 15:24 +0100 schrieb Timo Sirainen:

 pass_attrs = .., postAddress=domain
 
 Assuming v1.1+. This changes the username to u...@domain everywhere.

thanks for helping :-) But, it doesn't work:

ldap.conf:

user_attrs = postalAddress=domain,homeDirectory=/imap/spool/%d/%1n/%n
user_filter = ((objectClass=posixAccount)(uid=%n))
pass_attrs = postalAddress=domain, uid=user, userPassword=password
pass_filter = ((objectClass=posixAccount)(uid=%n))


After login, DoveCot creates the directory /imap/spool/f/foo, instead
of /imap/spool/subdomain.domain.bla/f/foo

Log (anonymized) :

http://pastebin.com/RZfpZkyc

so I assume, that %d isn't filled ...

any suggestions?


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Denny Schierz
hi,

Am Montag, den 02.08.2010, 10:08 +0200 schrieb Denny Schierz:

 http://pastebin.com/RZfpZkyc
 
 so I assume, that %d isn't filled ...
 
 any suggestions?

I've forgotten to say: our version from Dovecot is 1.2.11

cu denny


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: [Dovecot] Cant compile managesieve 0.11.11 on Solaris10

2010-08-02 Thread Denny Schierz
Am Donnerstag, den 29.07.2010, 23:53 +0900 schrieb Kenji Iuchi:

 Please show me configure and Comple Options.
 $ ./configure OPTIONS

./configure --prefix=/usr/local/dovecot/managesieve-0.11
--with-dovecot=/usr/local/dovecot/src/dovecot-1.2.11
--with-dovecot-sieve=/usr/local/dovecot/src/dovecot-1.2-sieve-0.1.16

 and let me resulu of command:
 $ echo $PATH

$PATH:/usr/pkg/bin:/usr/pkg/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/sfw/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/opt/csw/sbin:/opt/csw/bin:/usr/sfw/bin:/usr/sfw/sbin:/root/bin:/usr/public/bin:/usr/ccs/bin


 $ crle

Configuration file [version 4]: /var/ld/ld.config  
  Default Library Path
(ELF):   
/lib:/usr/lib:/usr/local/lib:/opt/csw/lib:/opt/csw/lib/amd64:/opt/csw/lib/i386:/opt/csw/postgresql/lib
  Trusted Directories (ELF):/lib/secure:/usr/lib/secure  (system
default)

Command line:
  crle -c /var/ld/ld.config
-l 
/lib:/usr/lib:/usr/local/lib:/opt/csw/lib:/opt/csw/lib/amd64:/opt/csw/lib/i386:/opt/csw/postgresql/lib


  ld: fatal: Symbol referencing errors. No output written to
 So, I think OS cannot find OpenSolaris-OpenSSL Library and Header.
 Where OpenSolaris-OpenSSL was installed in ? /usr/sfw ?

root:/usr/local/dovecot/src/dovecot-1.2-managesieve-0.11.11#
find /usr/ /opt/ -name ssl.h
/usr/sfw/include/openssl/ssl.h
/opt/csw/include/openssl/ssl.h

the second ssl.h ist from pkgutil (blastwave), cause of Apache2/Postfix

cu denny



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: [Dovecot] error 89 when loading plugin

2010-08-02 Thread John O'Brien
Pascal,

On 02/08/2010, at 2:22 AM, Pascal Volk wrote:

 On 08/01/2010 08:37 AM John O'Brien wrote:
 Hi,
 
 I'm very confused - that's not too difficult for me.
 
 I have written a small plugin change_passwd_plugin.c
 I would like this custom IMAP command to be available to all users.
 
 The code contains the following.
 
 void change_passwd_plugin_init(void)
{
  command_register(XCHANGEPASSWORD, cmd_xchangepasswd, 0);
  str_append(capability_string,  XCHANGEPASSWORD);
}
 
 void change_passwd_plugin_deinit(void)
{
  command_unregister(XCHANGEPASSWORD);
}
 
 % nm
 0920 T change_passwd_plugin_deinit
 08ec T change_passwd_plugin_init
 00201248 D change_passwd_plugin_version
 
 dovecot.conf
 mail_plugins = change_passwd_plugin
 mail_plugin_dir = /usr/lib/dovecot/imap
 imap_capability = XCHANGEPASSWORD
 
 %ls -la /usr/lib/dovecot/imap
 ls -la /usr/lib/dovecot/imap
 total 28
 drwxr-xr-x 2 root root  4096 Aug  1 16:03 .
 drwxr-xr-x 3 root root  4096 Aug  1 10:51 ..
 -rwxr-xr-x 1 root root 16969 Aug  1 16:03 change_passwd_plugin.so
 
 
 During login I see the following
 
 /var/log/maillog
 Aug  1 16:13:00 development dovecot: IMAP(test): Loading modules from 
 directory: /usr/lib/dovecot/imap
 Aug  1 16:13:00 development dovecot: IMAP(test): Plugin change_passwd_plugin 
 not found from directory /usr/lib/dovecot/imap
 Aug  1 16:13:00 development dovecot: child 29715 (imap) returned error 89
 
 I don't understand why I'm getting an error 89 reported.
 The login session is terminated by dovecot when the error occurs.
 
 Any assistance or ideas would be appreciated.
 
 Regards,
 
 John
 
 
 The name of the plungins is plugin_name_plugin.ext. To load a plugin
 use:
 
   mail_plugins = plugin_name
 
 Without the trailing _plugin.
 
Thanks that works with 1.2
 
 Which clients, except for telnet, supports the XCHANGEPASSWORD command?

Unfortunately we are prevented from telling you about the specific device 
because of a very strict NDA.
It is an NDA from a very litigious systems supplier from silicon valley, so we 
must be careful.

All I can say is that its a embedded system that has plenty of clients.
Access to some of the stored data is via an IVR style audio interface, access 
to which is controlled via a PIN code.
So think of this as the PIN code you need to enter if you were accessing your 
telephone banking service via an IVR.
The embedded client needs to be able to change this PIN code via IMAP.

As a result of a suggestion from Pascal late last week I spent today loading 
2.0.rc3 and converting the plugin to the new form.

What a nightmare.

Is there an easy way to have a plugin included in the configuration and built 
as part of the make and make install?
Everything has changed. I was previously happily generating a .so and putting 
it the right directory.
I know this is the wrong way to do it, but I was doing something like this.
#
# Build the XCHANGEPASSWORD custom IMAP command
# 
export DOVECOT=../../../../dovecot-2.0.rc3
gcc -fPIC -g -shared -Wall \
-I$DOVECOT -I$DOVECOT/src/imap  -I$DOVECOT/src/lib  -I$DOVECOT/src/lib-auth 
-I$DOVECOT/src/lib-charset \
-I$DOVECOT/src/lib-dict -I$DOVECOT/src/lib-dns  -I$DOVECOT/src/lib-dovecot  
-I$DOVECOT/src/lib-imap \
-I$DOVECOT/src/lib-index -I$DOVECOT/src/lib-lda -I$DOVECOT/src/lib-mail 
-I$DOVECOT/src/lib-master \
-I$DOVECOT/src/lib-ntlm -I$DOVECOT/src/lib-otp -I$DOVECOT/src/lib-settings 
-I$DOVECOT/src/lib-sql \
-I$DOVECOT/src/lib-storage  -DHAVE_CONFIG_H \
change_passwd_plugin.c -o change_passwd_plugin.so

I'm trying to figure out how to build it under 2.0. The documentation assumes a 
degree of prior knowledge which I have not
been able to find.

I have built a test framework change_passwd_plugin.c which is 165 lines of C, 
its tiny.
Once I get the custom IMAP command been parsed I can then add support in to 
store the PIN data in a postgresql database table.
I was hoping to avoid having to learn too much about all this but it seems it 
can't be avoided.

Any suggestions would be greatly appreciated.

Best Regards,

John

 
 
 Regards,
 Pascal
 -- 
 The trapper recommends today: c01dcofe.1021...@localdomain.org
 



Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Timo Sirainen
On Mon, 2010-08-02 at 10:08 +0200, Denny Schierz wrote:
  pass_attrs = .., postAddress=domain
  
  Assuming v1.1+. This changes the username to u...@domain everywhere.
 
 thanks for helping :-) But, it doesn't work:
 
 ldap.conf:
 
 user_attrs = postalAddress=domain,homeDirectory=/imap/spool/%d/%1n/%n
 user_filter = ((objectClass=posixAccount)(uid=%n))

OK, there is a bug/missing feature that this doesn't work with
user_attrs.

 pass_attrs = postalAddress=domain, uid=user, userPassword=password
 pass_filter = ((objectClass=posixAccount)(uid=%n))

This would work, except I guess you're using auth binds and have also
set auth_bind_userdn? Since according to your logs, it doesn't even
attempt to do this passdb lookup from ldap.



Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Timo Sirainen
On Mon, 2010-08-02 at 13:10 +0100, Timo Sirainen wrote:
  user_attrs = postalAddress=domain,homeDirectory=/imap/spool/%d/%1n/%n
  user_filter = ((objectClass=posixAccount)(uid=%n))
 
 OK, there is a bug/missing feature that this doesn't work with
 user_attrs.

Fixed for v2.0: http://hg.dovecot.org/dovecot-2.0/rev/63124518977a




Re: [Dovecot] Cant compile managesieve 0.11.11 on Solaris10

2010-08-02 Thread Timo Sirainen
On Tue, 2010-07-27 at 16:16 +0200, Denny Schierz wrote:
 SSL_COMP_get_name   
 /usr/local/dovecot/src/dovecot-1.2.13/src/login-common/liblogin-common.a(ssl-proxy-openssl.o)
 SSL_get_current_compression 
 /usr/local/dovecot/src/dovecot-1.2.13/src/login-common/liblogin-common.a(ssl-proxy-openssl.o)

Oh. I think you can't compile even unpatched Dovecot? For a while I was
confused why this would break only with managesieve, but I think it's
only because managesieve-login gets compiled before imap/pop3-login. But
if you don't have those functions in SSL library, why do you have
HAVE_SSL_COMPRESSION defined in config.h? Maybe configure is finding
different libssl than what make is later using?



Re: [Dovecot] quota not updated

2010-08-02 Thread Timo Sirainen
On Mon, 2010-08-02 at 09:30 +0200, Martin Ott wrote:
 Hi,
 
 we're using quota with the maildir backend. When new mail arrives, the quota
 gets updated. But when mail is expunged, quota stays the same (see imap dialog
 below). We're using the latest version from hg ( 1.2.13 ). Any ideas?

Anything in logs? What about with mail_debug=yes? Does maildirsize file
get changed? Any per-user quota overrides? What if you delete
maildirsize file and do GETQUOTAROOT INBOX in IMAP, does it recalculate
it correctly?

 plugin:
   quota: maildir:User quota
   quota_rule: *:storage=2000M
   quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
   quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
   quota2: maildir:Shared quota:ns=shared/
   quota2_rule: *:storage=1M

Try also temporarily disabling quota2 to see if it somehow confuses
Dovecot?



Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Denny Schierz
hi,

Am Montag, den 02.08.2010, 13:10 +0100 schrieb Timo Sirainen:
 auth_bind_userdn

I have (I think):

the complete ldap.conf:

hosts = ldap.subdomain.domain.foo
auth_bind = yes
auth_bind_userdn = uid=%u,cn=accounts,dc=mail,dc=subdomain,dc=foo,dc=bla
ldap_version = 3
base = cn=accounts, dc=mail, dc=subdomain, dc=foo, dc=bla
user_attrs = postalAddress=domain,homeDirectory=/imap/spool/%d/%1n/%n
user_filter = ((objectClass=posixAccount)(uid=%n))
pass_attrs = postalAddress=domain, uid=user, userPassword=password
pass_filter = ((objectClass=posixAccount)(uid=%n))

If I remove user_attrs=postalAddress=domain, then I don't see anything
in the logs, where domain is replaced.

dovecot.conf

auth default {
  mechanisms = plain login
  passdb ldap {
args = /usr/local/dovecot/dovecot/etc/conf.d/ldap.conf
  }


  userdb ldap {
args = /usr/local/dovecot/dovecot/etc/conf.d/ldap.conf
  }

So I repeat before getting confused :-) : Login works and I don't need
the domainpart, with this setup. I only want to change the
mail_location.' For me it looks like, that Dovecot has no reason to take
a look into %d, because the username does not had one while he logged
in. 
DoveCot has to replace %d with the content of PostalAdress, before
home=...

 Just only a thought :-) Maybe, I'm completely wrong ...


cu denny

ps. I saw the patch from you for 2.0. 


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[Dovecot] Auto delete older messages in SPAM folder

2010-08-02 Thread Thiago Henrique
Hello,

I use Cyrus in my mailservers and I intend to migrate it to Dovecot.

Cyrus has a setting that purge the emails from a mailbox under a
pre-defined criteria. For example:

EVENTS {
 ...
  # At 12:01 delete messages older than 60 days in SPAM folder
  deletespam cmd=ipurge -d 60 -f user/*/SPAM at=1201
}

Is there in Dovecot any setting like this ?

Thank you.
--
[]'s
Thiago Henrique
Network Administration
Digirati Networks
K8 Networks



Re: [Dovecot] quota not updated

2010-08-02 Thread Martin Ott
Hi Timo,

thanks for your answer. I triggered the problem down to the lazy_expunge
plugin. When I remove lazy_expunge from mail_plugins, quota gets calculated as
expected. How can I change the quota_rule, so that only the namespace with
prefix INBOX is regarded?

namespace:
  type: private
  separator: /
  prefix: INBOX/
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: public
  separator: /
  prefix: shared/
  location: maildir:/var/vmail/public:INDEX=~/public:CONTROL=~/public
  list: children
  subscriptions: yes
namespace:
  type: private
  separator: /
  prefix: .EXPUNGED/
  location: maildir:~/mail/expunged
  hidden: yes
  list: no

plugin:
  quota: maildir:User quota
  quota_rule: *:storage=2000M
  quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
  quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
  acl: vfile
  lazy_expunge: .EXPUNGED/



 we're using quota with the maildir backend. When new mail arrives, the quota
 gets updated. But when mail is expunged, quota stays the same (see imap 
 dialog
 below). We're using the latest version from hg ( 1.2.13 ). Any ideas?
 
 Anything in logs? What about with mail_debug=yes? Does maildirsize file
 get changed? Any per-user quota overrides? What if you delete
 maildirsize file and do GETQUOTAROOT INBOX in IMAP, does it recalculate
 it correctly?
 
 plugin:
   quota: maildir:User quota
   quota_rule: *:storage=2000M
   quota_warning: storage=95%% /usr/local/bin/quota-warning.sh 95
   quota_warning2: storage=80%% /usr/local/bin/quota-warning.sh 80
   quota2: maildir:Shared quota:ns=shared/
   quota2_rule: *:storage=1M
 
 Try also temporarily disabling quota2 to see if it somehow confuses
 Dovecot?
 


Re: [Dovecot] Patch: New event mailbox_create for the mail_log plugin

2010-08-02 Thread Timo Sirainen
On Thu, 2010-07-29 at 13:28 +0200, Tobias Joch wrote:

 the following patch for the mail_log plugin (source version = 1.2.13) adds a 
 new logging event mailbox_create. 
 Perhaps this is also of interest to other people except me ;)

I added mailbox_create event now to v2.0, but I had to pretty much
rewrite the patch because v2.0's mail_log plugin works via notify
plugin.



Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Timo Sirainen
On Mon, 2010-08-02 at 15:08 +0200, Denny Schierz wrote:
 hosts = ldap.subdomain.domain.foo
 auth_bind = yes
 auth_bind_userdn = uid=%u,cn=accounts,dc=mail,dc=subdomain,dc=foo,dc=bla

If you remove the auth_bind_userdn, it does a lookup using pass_filter
and pass_attrs.

 pass_attrs = postalAddress=domain, uid=user, userPassword=password
 pass_filter = ((objectClass=posixAccount)(uid=%n))

And when such lookup is done, it reads the domain, and changes the
username to u...@postaladdress and %d expands to postalAddress then.

 If I remove user_attrs=postalAddress=domain, then I don't see anything
 in the logs, where domain is replaced.

Yes, but even though you see it in logs, it's completely ignored by
everything.. Unless you use latest v2.0 hg.

 So I repeat before getting confused :-) : Login works and I don't need
 the domainpart, with this setup. I only want to change the
 mail_location.' For me it looks like, that Dovecot has no reason to take
 a look into %d, because the username does not had one while he logged
 in. 
 DoveCot has to replace %d with the content of PostalAdress, before
 home=...

There's no simple way to currently use random userdb fields in
mail_location. Maybe some day.



Re: [Dovecot] quota not updated

2010-08-02 Thread Timo Sirainen
On Mon, 2010-08-02 at 15:34 +0200, Martin Ott wrote:

 thanks for your answer. I triggered the problem down to the lazy_expunge
 plugin. When I remove lazy_expunge from mail_plugins, quota gets calculated as
 expected. How can I change the quota_rule, so that only the namespace with
 prefix INBOX is regarded?
 
 namespace:
   type: private
   separator: /
   prefix: INBOX/
..
 plugin:
   quota: maildir:User quota

See if this works:

quota = maildir:User quota:ns=INBOX/

If it doesn't, I guess more code is needed..



Re: [Dovecot] Auto delete older messages in SPAM folder

2010-08-02 Thread Timo Sirainen
On Mon, 2010-08-02 at 10:33 -0300, Thiago Henrique wrote:

 Cyrus has a setting that purge the emails from a mailbox under a
 pre-defined criteria. For example:
 
 EVENTS {
  ...
   # At 12:01 delete messages older than 60 days in SPAM folder
   deletespam cmd=ipurge -d 60 -f user/*/SPAM at=1201
 }
 
 Is there in Dovecot any setting like this ?

There's http://wiki.dovecot.org/Plugins/Expire

With v2.0 it's been pretty much redesigned to run via doveadm, which
works much better and easier: http://wiki2.dovecot.org/Plugins/Expire




Re: [Dovecot] Cant compile managesieve 0.11.11 on Solaris10 *SOLVED*

2010-08-02 Thread Denny Schierz
hi,

Am Montag, den 02.08.2010, 13:29 +0100 schrieb Timo Sirainen:
 On Tue, 2010-07-27 at 16:16 +0200, Denny Schierz wrote:
  SSL_COMP_get_name   
  /usr/local/dovecot/src/dovecot-1.2.13/src/login-common/liblogin-common.a(ssl-proxy-openssl.o)
  SSL_get_current_compression 
  /usr/local/dovecot/src/dovecot-1.2.13/src/login-common/liblogin-common.a(ssl-proxy-openssl.o)
 
 Oh. I think you can't compile even unpatched Dovecot? For a while I was

I had two problems:

1.) I was able to get everything working with 1.2.11, cause i had
OpenLdap 2.3.x installed

Managesieve was also no problem, but in the second try, I've forgotten
to set the LDD flags:

LDFLAGS=-L/opt/csw/lib -L/usr/lib -R/opt/csw/lib/ ./configure
--prefix=/usr/local/dovecot/managesieve-0.11
--with-dovecot=/usr/local/dovecot/src/dovecot-1.2.13
--with-dovecot-sieve=/usr/local/dovecot/src/dovecot-1.2-sieve-0.1.17

With setting the flags (as I used for DoveCot himself), it works.

2. ) The second problem was, I've got an update from OpenLDAP via
pkgutil OpenLdap 2.4.so.2.5.5, so ./configure says, there is no libldap.
It seems, that the API has changed.

Now I have DoveCot 1.2.13 running. Stil solving the other problem with 
%d for Maildir.

cu denny



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: [Dovecot] LDAP + mail_location: Get %d from customfield

2010-08-02 Thread Denny Schierz
hi,

Am Montag, den 02.08.2010, 15:37 +0100 schrieb Timo Sirainen:
 If you remove the auth_bind_userdn, it does a lookup using pass_filter
 and pass_attrs. 

ahh, that was it !


Very big thank You for helping me :-) It works now :-)

cu denny


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Re: [Dovecot] 2.0rc3: Panic: [...] mailbox_list_is_valid_pattern (was: Crash while accessing mdbox folders)

2010-08-02 Thread Timo Sirainen
On Thu, 2010-07-29 at 13:56 +0300, Axel Thimm wrote:
  Jul 28 19:42:48 lda(athimm): Panic: file mailbox-list-fs.c: line 150
  (fs_list_get_path): assertion failed:
  (mailbox_list_is_valid_pattern(_list, name))
..
 I found what the issue was, a bogus line in my sieve script tried to use
 a match variable that hadn't been set (e.g. I matched only two globs,
 but I used ${3}).

Is it the same as if you just did fileinto ? I can't reproduce this,
the best I get is:

Aug 02 15:59:25 lda(2189 tss): Error: sieve: msgid=b...@blah: subject=blah: 
failed to store into mailbox '': Unknown namespace
Aug 02 15:59:25 lda(2189 tss): Error: sieve: execution of script 
/home/tss/.dovecot.sieve failed, but implicit keep was successful

or if I have a prefix= namespace, then it just quietly goes to INBOX.




Re: [Dovecot] Plugin for XFS project quota

2010-08-02 Thread Timo Sirainen
On Wed, 2010-07-28 at 16:08 +0200, Wessel Dankers wrote:

 I just finished writing a small plugin that reports XFS project quota in de
 IMAP component of Dovecot (1.2, currently). It was written to fill the
 needs of our organization but someone else might find this useful as well.
 In its current form it's not suitable for inclusion in the generic quota
 backend (see “Drawbacks”).
 
  - LGPL 3 (just like Dovecot itself).

Actually, no. Dovecot is LGPLv2.1 without the or later clause. I don't
think LGPLv3 is compatible with that.

  - IMAP only: I tried to write a generic quota backend, but the current
setup of the quota plugin does not really seem to permit this;

Hmm. Yeah.. I didn't really think anyone would want quota-per-mailbox.

 Sources:
 https://www.non-gnu.uvt.nl/pub/dovecot-prjquota/

I looked through it and didn't notice any obvious bugs.



Re: [Dovecot] [2.0] Experience in production environment

2010-08-02 Thread Timo Sirainen
On Tue, 2010-07-27 at 07:26 +0200, Luigi Rosa wrote:

 The only difference between 2.0 and the previous version is the RIM server. 
 Some
 users have configured their blackberry to synchronize the phone with their
 mailbox in IMAP. Previously RIM kept a connection open, after upgrading to 
 2.0,
 RIM opens a connection and then closes it.

This happens because IDLE is no longer advertised in CAPABILITY before
login. This is the only widely used IMAP client I know of that has this
problem now. Wonder if RIM would have any interest in fixing this
themselves.. Probably not. Maybe I should just give up and put IDLE into
the pre-login capability..

 This is not an issue, because the synchronization is ok, and I think that is
 better this way than to keep an oper socket. 

The reason why it keeps the connection open is to give users
instantaneous notifications of new mails.




Re: [Dovecot] BUG: Unknown internal error

2010-08-02 Thread Timo Sirainen
On Wed, 2010-07-28 at 10:40 +0200, myleetl...@gmx.de wrote:

 I saw this BUG message in the logfile (only one time).
 
 dovecot: IMAP(xxx): FETCH for mailbox INBOX UID 4572 failed to read message 
 input: Input/output error

This input/output error shouldn't happen. It was caused by some
temporary NFS problem.

 dovecot: IMAP(xxx): Disconnected: BUG: Unknown internal error isp=xxx lip=xxx 
 rip=xxx bytes=117/341182

This should have said instead Disconnected: Internal error occurred.
It's already been fixed in v2.0, and not worth the trouble to fix in
v1.2 anymore.




Re: [Dovecot] Patch: New event mailbox_create for the mail_log plugin

2010-08-02 Thread Tobias Joch
Am 02.08.2010 um 16:34 schrieb Timo Sirainen:

 On Thu, 2010-07-29 at 13:28 +0200, Tobias Joch wrote:
 
 the following patch for the mail_log plugin (source version = 1.2.13) adds a 
 new logging event mailbox_create. 
 Perhaps this is also of interest to other people except me ;)
 
 I added mailbox_create event now to v2.0, but I had to pretty much
 rewrite the patch because v2.0's mail_log plugin works via notify
 plugin.
 

Cool ;) Thanks!

Re: [Dovecot] [2.0] Experience in production environment

2010-08-02 Thread Daniel L. Miller

On 8/2/2010 8:15 AM, Timo Sirainen wrote:

cause IDLE is no longer advertised in CAPABILITY before
login. This is the only widely used IMAP client I know of that has this
problem now. Wonder if RIM would have any interest in fixing this
themselves.. Probably not. Maybe I should just give up and put IDLE into
the pre-login capability..


Why the change?  RFC compliance?  Performance?
--
Daniel


[Dovecot] Dovecot 2.0.rc3 doesn't compile with custom OpenSSL

2010-08-02 Thread Andreas M. Kirchwitz
Hi folks,

when building Dovecot 2.0.rc3 (never used any other 2.0.X before,
so this issue might not be new to that specific release), then
compilation fails on anything that is linked against the new
libdovecot-login.so library.

For example, imap-login fails:

/bin/sh ../../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 -Wstrict-aliasing=2 -I/usr/local/ssl/include
-o imap-login client.o client-authenticate.o imap-login-settings.o imap-proxy.o 
../../src/login-common/libdovecot-login.la ../../src/lib-dovecot/libdovecot.la 
-lrt
libtool: link: gcc -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes 
-Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 
-Wbad-function-cast -Wstrict-aliasing=2 -I/usr/local/ssl/include -o 
.libs/imap-login client.o client-authenticate.o imap-login-settings.o 
imap-proxy.o  ../../src/login-common/.libs/libdovecot-login.so 
../../src/lib-dovecot/.libs/libdovecot.so -lrt -Wl,-rpath 
-Wl,/usr/local/Dovecot-2.0.rc3/lib/dovecot
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by 
../../src/login-common/.libs/libdovecot-login.so, not found (try using -rpath 
or -rpath-link)
/usr/bin/ld: warning: libssl.so.1.0.0, needed by 
../../src/login-common/.libs/libdovecot-login.so, not found (try using -rpath 
or -rpath-link)
../../src/login-common/.libs/libdovecot-login.so: undefined reference to 
`OBJ_txt2nid'
[...]
collect2: ld returned 1 exit status
make[3]: *** [imap-login] Error 1
make[3]: Leaving directory `/usr/local/src/dovecot-2.0.rc3/src/imap-login'

I'm not using system OpenSSL but a custom installation in /usr/local/ssl.
According to the documentation, Dovecot is smart enough to get everything
it needs from the /usr/local/ssl/lib/pkgconfig/*.pc files. Dovecot 1.2.X
just compiles fine if configured like this:

./configure --prefix=/usr/local/${DOVECOTVER} --with-ssl=openssl

The problem with Dovecot 2.0.rc3 is, that libdovecot-login.so isn't given
the correct pathes for the OpenSSL libraries:

$ ldd src/login-common/.libs/libdovecot-login.so
linux-gate.so.1 =  (0x00b6e000)
libssl.so.1.0.0 = not found
libcrypto.so.1.0.0 = not found
libdl.so.2 = /lib/libdl.so.2 (0x00b2a000)
librt.so.1 = /lib/librt.so.1 (0x004d4000)
libc.so.6 = /lib/libc.so.6 (0x0011)
/lib/ld-linux.so.2 (0x006e7000)
libpthread.so.0 = /lib/libpthread.so.0 (0x009c6000)

So everything depending on libdovecot-login.so will fail.
Setting SSL_CFLAGS and SSL_LIBS manually doesn't help because
Dovecot already sets these perfectly fine via pkg-config:

env SSL_CFLAGS=-I/usr/local/ssl/include 
SSL_LIBS=-L/usr/local/ssl/lib -Wl,-R/usr/local/ssl/lib -lcrypto -lssl 
./configure --prefix=/usr/local/${DOVECOTVER} --with-ssl=openssl

Only the hard way works:

env CPPFLAGS=-I/usr/local/ssl/include LDFLAGS=-L/usr/local/ssl/lib 
-Wl,-R/usr/local/ssl/lib -lcrypto -lssl ./configure 
--prefix=/usr/local/${DOVECOTVER} --with-ssl=openssl

However, setting CPPFLAGS and LDFLAGS shouldn't be necessary because
SSL_CFLAGS and SSL_LIBS already contain the information that is needed
to build a proper library. They are just not used when linking
libdovecot-login.so ;-)

Greetings, Andreas


Re: [Dovecot] [2.0] Experience in production environment

2010-08-02 Thread Timo Sirainen
On 2.8.2010, at 19.04, Daniel L. Miller wrote:

 On 8/2/2010 8:15 AM, Timo Sirainen wrote:
 cause IDLE is no longer advertised in CAPABILITY before
 login. This is the only widely used IMAP client I know of that has this
 problem now. Wonder if RIM would have any interest in fixing this
 themselves.. Probably not. Maybe I should just give up and put IDLE into
 the pre-login capability..
 
 Why the change?  RFC compliance?  Performance?

1) To get rid of the horrible ugly way of getting a list of capabilities at 
startup. Dovecot doesn't know what capabilities are available until it has 
loaded all plugins and loaded them and asked what capabilities those plugins 
added. This caused numerous problems with v1.x for many years. I doubt all of 
the potential problems are still fixed in latest v1.2.

2) Per-user capabilities aren't possible if the capability list must be the 
same before and after login.

So I reduced the pre-login capability list to be as minimal as it can be. Not 
just because of 1) and 2), but because the minimal capability list would make 
it obvious when a client doesn't recognize the post-login capabilities and that 
the client could also never support 2). Several of these clients were already 
found and fixed. And I knew that this worked fine with the most widely used 
clients. But I hadn't encountered RIM before.. Does anyone happen to know 
anyone in RIM's email team? :) The good thing here is that it would only 
require RIM to upgrade their servers to fix this, not to force thousands or 
millions of users to upgrade their clients..



Re: [Dovecot] quota not updated

2010-08-02 Thread Martin Ott
Am 02.08.2010 16:39, schrieb Timo Sirainen:
 On Mon, 2010-08-02 at 15:34 +0200, Martin Ott wrote:
 
 thanks for your answer. I triggered the problem down to the lazy_expunge
 plugin. When I remove lazy_expunge from mail_plugins, quota gets calculated 
 as
 expected. How can I change the quota_rule, so that only the namespace with
 prefix INBOX is regarded?

 namespace:
   type: private
   separator: /
   prefix: INBOX/
 ..
 plugin:
   quota: maildir:User quota
 
 See if this works:
 
 quota = maildir:User quota:ns=INBOX/

with

quota: maildir:User quota:ns=INBOX/

log says
Aug  3 07:43:11 vlmail01 dovecot: IMAP(user): quota maildir: No maildir
storages, ignoring quota.
Aug  3 07:43:25 vlmail01 dovecot: deliver(u...@domain.com): quota maildir: No
maildir storages, ignoring quota.

and
* PREAUTH [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 ACL RIGHTS=texk QUOTA]
Logged in as mott
a getquotaroot INBOX
* QUOTAROOT INBOX User quota
* QUOTA User quota (STORAGE 0 2048000)
a OK Getquotaroot completed.