Re: [Dovecot] dovecot cores

2012-10-11 Thread dovecot
According to Timo Sirainen:
> On 11.10.2012, at 9.43, dove...@freakout.de wrote:
> 
> Dovecot code is calling str_to_time() from libmysqlclient,
> instead of from Dovecot's internal code.
> Not the first time mysql conflicted with Dovecot code.
> This could be worked around, but .. why is your dovecot
> binary linked with libmysqlclient?
> Only auth and dict binaries should be.
> 

but dovecot's configure script does not allow to specify the
mysql libs and headers explictly - only by global CPPFLAGS and
LDFLAGS extensions, which are used for all binaries - when i
tried to specify:

./configure --prefix=/opt/dovecot --sysconfdir=/etc/dovecot 
--mandir=/opt/dovecot/man \
--docdir=/opt/dovecot/doc --libexecdir=/opt/dovecot/sbin 
--datadir=/opt/dovecot \
--with-rundir=/var/dovecot/run --with-statedir=/var/dovecot/state \
--with-mysql=/opt/mysql/bin/mysql_config
checking for ...
checking pkg-config is at least version 0.9.0... yes
configure: error: --with-mysql=path not supported. You may want to use instead:
CPPFLAGS=-I/opt/mysql/bin/mysql_config/include 
LDFLAGS=-L/opt/mysql/bin/mysql_config/lib ./configure --with-mysql

i followed the hint from the configure script above and run
into the core-dumps due to symbol clash str_to_time.

How to work around with mysql in non-standard location?

Thanks
Axel


Re: [Dovecot] per-user quotas

2012-10-11 Thread Daniel Parthey
Hi Dave,

David Mehler wrote:
> I've got quotas set up on an all-user basis on my system, it's a
> Postfix, Dovecot, Mysql virtual users setup. Currently I have each
> user getting a 1GB quota with these settings in 90-quota.conf:
> 
> plugin {
>   quota_rule = *:storage=1G
>   quota_rule2 = Trash:storage=+100M
> }
> plugin {
>   quota = maildir:User quota
> }
> 
> While this works it's not what I want for all users. Say I add a
> virtual user called user1 to the mysql database but he's a test user
> and I only want that user to have 25 megabytes of storage, reading the
> wiki on quotas per-user items such as for example in a database
> overrides the global items above, is this right?
> 
> If so, I'm hoping I'm not going to have to redo my entire user
> database, some users will have per-user quotas while I'll let others
> have the global quota.

You can just make your SQL query a bit more sophisticated in
order to fit your needs.

MySQL supports SQL CASE statement and default value with ELSE:
http://dev.mysql.com/doc/refman/5.1/en/case.html

This example sets quota to unlimited if mail comes in via port 20025,
otherwise is uses the quota_bytes and quota_message columns:

user_query = SELECT username AS user, \
home as home, \
uid as uid, \
gid as gid, \
CASE '%a' \
WHEN '20025' THEN '*:bytes=0:messages=0' \
ELSE \
CONCAT('*:bytes=', CAST(quota_bytes AS CHAR), ':messages=', 
CAST(quota_message AS CHAR)) \
END AS `quota_rule` \
FROM dovecot_users \
WHERE username='%u'

Regards
Daniel
-- 
https://plus.google.com/103021802792276734820


Re: [Dovecot] Feature Request

2012-10-11 Thread Daniel Parthey
Timo Sirainen wrote:
> On 10.10.2012, at 5.40, Marc Perkel wrote:
> 
> >>> It would be handy (for me) if there were a userdb where a directory 
> >>> structure defined the db.
> >>> 
> >>> userdb stat {
> >>>   mail_location=maildir:/fakedir/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
> >>> }
> >>> 
> >>> userdb stat {
> >>>   mail_location=maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
> >>> }
> >>> 
> >>> The idea being that if the first directory doesn't exist then it will try 
> >>> the second one.
> >> You could already implement this as userdb checkpassword script.
> > 
> > Can you give me an example?
> 
> Something like this:
> 
> userdb {
>   driver = checkpasword
>   args = /usr/local/bin/userdb.sh
> }

Here is the documentation about how to implement a checkpassword script:

http://wiki2.dovecot.org/AuthDatabase/CheckPassword

Dovecot sets some environment variables that the script may use.
All of the AUTH_* variables are available as AUTH_
extra fields in the environment:

http://wiki2.dovecot.org/Variables#line-30

Regards
Daniel
-- 
https://plus.google.com/103021802792276734820


Re: [Dovecot] Multiple Maildir?

2012-10-11 Thread Daniel Parthey
Hi Marc,

Marc Perkel wrote:
> On 10/9/2012 3:42 PM, Daniel Parthey wrote:
> >Marc Perkel wrote:
> >>if the mail location doesn't exist
> >>then I want to try a second mail location:
> >>mail_location = maildir:/email/%d/%n:INBOX=/email/%d/%n:LAYOUT=fs
> >You might do this with a script which exports the MAIL environment
> >variable and then executes the service binary:
> >http://wiki2.dovecot.org/MailLocation#Custom_mailbox_location_detection
> But how do I pick up the name and domain parameters to test the directory?

You can get the username and any other userdb value from the environment,
have a look at the environment section:

http://wiki2.dovecot.org/PostLoginScripting#Running_environment

Regards
Daniel
-- 
https://plus.google.com/103021802792276734820


Re: [Dovecot] per-user quotas

2012-10-11 Thread David Mehler
Hello,

I'm running Dovecot 2.1.10.

Thanks.
Dave.


On 10/11/12, Tibby  wrote:
> Hello!
>
> What's the version of your dovecot? 1.2.X ? or 2.0 ?
>
> Tibby
>
> On Oct 11, 2012, at 10:40 PM, David Mehler wrote:
>
>> Hello,
>>
>> I've got quotas set up on an all-user basis on my system, it's a
>> Postfix, Dovecot, Mysql virtual users setup. Currently I have each
>> user getting a 1GB quota with these settings in 90-quota.conf:
>>
>> plugin {
>>  quota_rule = *:storage=1G
>>  quota_rule2 = Trash:storage=+100M
>> }
>> plugin {
>>  quota = maildir:User quota
>> }
>>
>> While this works it's not what I want for all users. Say I add a
>> virtual user called user1 to the mysql database but he's a test user
>> and I only want that user to have 25 megabytes of storage, reading the
>> wiki on quotas per-user items such as for example in a database
>> overrides the global items above, is this right?
>>
>> If so, I'm hoping I'm not going to have to redo my entire user
>> database, some users will have per-user quotas while I'll let others
>> have the global quota.
>>
>> Thanks.
>> Dave.
>
>


Re: [Dovecot] per-user quotas

2012-10-11 Thread Tibby
Hello!

What's the version of your dovecot? 1.2.X ? or 2.0 ?

Tibby

On Oct 11, 2012, at 10:40 PM, David Mehler wrote:

> Hello,
> 
> I've got quotas set up on an all-user basis on my system, it's a
> Postfix, Dovecot, Mysql virtual users setup. Currently I have each
> user getting a 1GB quota with these settings in 90-quota.conf:
> 
> plugin {
>  quota_rule = *:storage=1G
>  quota_rule2 = Trash:storage=+100M
> }
> plugin {
>  quota = maildir:User quota
> }
> 
> While this works it's not what I want for all users. Say I add a
> virtual user called user1 to the mysql database but he's a test user
> and I only want that user to have 25 megabytes of storage, reading the
> wiki on quotas per-user items such as for example in a database
> overrides the global items above, is this right?
> 
> If so, I'm hoping I'm not going to have to redo my entire user
> database, some users will have per-user quotas while I'll let others
> have the global quota.
> 
> Thanks.
> Dave.



Re: [Dovecot] Shared Squat index for public mailboxes

2012-10-11 Thread Timo Sirainen
On 11.10.2012, at 23.38, Frerich Raabe wrote:

> Am 11.10.2012 um 22:10 schrieb Timo Sirainen:
>> On 10.10.2012, at 11.06, Frerich Raabe wrote:
>>> I already use this; as I mentioned, the index files of the public readonly 
>>> mailbox is stored per-user so that each user has his own set of \Seen 
>>> flags. Here's my public namespace:
>>> 
>>> namespace public {
>>> separator = /
>>> prefix = Lists/
>>> location = 
>>> maildir:/home/vmail/lists/Maildir:CONTROL=~/Maildir/lists:INDEX=~/Maildir/lists
>>> subscriptions = no
>>> }
>>> 
>>> Alas, this means that *all* index files (including the Squat index) is 
>>> stored per-user whereas I'd just to have just *some* of them per-user. :-)
>> 
>> You'll need v2.2 and its INDEXPVT setting.
> 
> Hm, you mean the feature introduced by 
> http://hg.dovecot.org/dovecot-2.2/rev/dbd42f7198eb ?

Yes.

> Is there some discussion of the feature somewhere?

http://markmail.org/message/45jxf363ffrubonv has some.

> The commit log is a bit unclear to me, it says 'Per-user flags can now be 
> stored in private index files.' however 
> http://wiki2.dovecot.org/SharedMailboxes/Public says 'By making each user 
> have their own private index files, you can make the \Seen flag private for 
> the users.' (using the INDEX setting).
> 
> Makes me wonder - the Wiki talks about 'private index files' when talking 
> about 'INDEX' and the commit says 'private index files' talking about 
> INDEXPVT - what is the difference? :-)

You can have both! Shared indexes having the shared stuff (including squat 
indexes), while the private indexes only have the per-user flags, nothing else. 
For example with sdbox/mdbox you couldn't even have set per-user INDEX location 
or it would have just broken.

[Dovecot] per-user quotas

2012-10-11 Thread David Mehler
Hello,

I've got quotas set up on an all-user basis on my system, it's a
Postfix, Dovecot, Mysql virtual users setup. Currently I have each
user getting a 1GB quota with these settings in 90-quota.conf:

plugin {
  quota_rule = *:storage=1G
  quota_rule2 = Trash:storage=+100M
}
plugin {
  quota = maildir:User quota
}

While this works it's not what I want for all users. Say I add a
virtual user called user1 to the mysql database but he's a test user
and I only want that user to have 25 megabytes of storage, reading the
wiki on quotas per-user items such as for example in a database
overrides the global items above, is this right?

If so, I'm hoping I'm not going to have to redo my entire user
database, some users will have per-user quotas while I'll let others
have the global quota.

Thanks.
Dave.


Re: [Dovecot] Shared Squat index for public mailboxes

2012-10-11 Thread Frerich Raabe
Am 11.10.2012 um 22:10 schrieb Timo Sirainen:
> On 10.10.2012, at 11.06, Frerich Raabe wrote:
>> I already use this; as I mentioned, the index files of the public readonly 
>> mailbox is stored per-user so that each user has his own set of \Seen flags. 
>> Here's my public namespace:
>> 
>> namespace public {
>> separator = /
>> prefix = Lists/
>> location = 
>> maildir:/home/vmail/lists/Maildir:CONTROL=~/Maildir/lists:INDEX=~/Maildir/lists
>> subscriptions = no
>> }
>> 
>> Alas, this means that *all* index files (including the Squat index) is 
>> stored per-user whereas I'd just to have just *some* of them per-user. :-)
> 
> You'll need v2.2 and its INDEXPVT setting.

Hm, you mean the feature introduced by 
http://hg.dovecot.org/dovecot-2.2/rev/dbd42f7198eb ? Is there some discussion 
of the feature somewhere?

The commit log is a bit unclear to me, it says 'Per-user flags can now be 
stored in private index files.' however 
http://wiki2.dovecot.org/SharedMailboxes/Public says 'By making each user have 
their own private index files, you can make the \Seen flag private for the 
users.' (using the INDEX setting).

Makes me wonder - the Wiki talks about 'private index files' when talking about 
'INDEX' and the commit says 'private index files' talking about INDEXPVT - what 
is the difference? :-)

-- 
Frerich Raabe - ra...@froglogic.com
www.froglogic.com - Multi-Platform GUI Testing








Re: [Dovecot] Clarifications on Pigeonhole and MySQL lookups

2012-10-11 Thread Stephan Bosch

On 10/10/2012 11:23 AM, Sandro Tosi wrote:

Hello,
we're scouting if it's possible to use Pigeonhole (currently v0.3.1, 
as this will be provided with an upcoming Debian package) with MySQL 
dict lookups with the mail setup we're designing.


Our (main) goals are:

1. store the filters on the database

That is possible with some limitations.

2. allow each user to enable/disable any of the filters set we provide 
(it's a static set of some general filters, available to all the 
users; we're currently not providing the possibility to users to write 
their own filters)

Will one or multiple scripts be active at the same time?

For point 1) we already see[1] that's possible, but it uses the map 
construct that might not fit with our current database structure: we 
have a domain table (storing the domain info) and a mailbox table 
(storing the mailbox info, but the username is composed by the local 
part, stored in this table, and the domain part is a FK to the domain 
table, using an id).


Do you think it's possible to run a join query on domain+mailbox to 
retrieve the mailbox_id needed to query the table for the filters? Or 
do we have to create the filter table and store the lo...@domain.ext 
info there ("relaxing" the integrity relationships between tables)?


My SQL is a bit rusty, but afaik this is possible with a JOIN or a 
nested query.


How do we specify which filters are enabled for any given user? We 
originally thought of an "Enabled" field on the filter table, but in 
the example in the doc[1] I hadn't seen a way to do that: it seems 
like the filter list is specified in the proxy definition - am I 
wrong? How can we do that? 


The above suggests that you would like to activate multiple Sieve 
scripts at the same time. That is currently not possible with the dict 
Script location. It is on my TODO list, but I am not sure when it will 
be ready (definitely not for coming Debian stable).


For Dovecot v2.2 the new :optional tag for the Sieve include command 
could be used in - combination with the dict Sieve script location type 
- to provide some hackish solution. Unfortunately, in your case that is 
still not helpful, because v2.2 is not even in beta stage. :/


Regards,

Stephan.


Re: [Dovecot] Shared Squat index for public mailboxes

2012-10-11 Thread Timo Sirainen
On 10.10.2012, at 11.06, Frerich Raabe wrote:

> I already use this; as I mentioned, the index files of the public readonly 
> mailbox is stored per-user so that each user has his own set of \Seen flags. 
> Here's my public namespace:
> 
> namespace public {
>  separator = /
>  prefix = Lists/
>  location = 
> maildir:/home/vmail/lists/Maildir:CONTROL=~/Maildir/lists:INDEX=~/Maildir/lists
>  subscriptions = no
> }
> 
> Alas, this means that *all* index files (including the Squat index) is stored 
> per-user whereas I'd just to have just *some* of them per-user. :-)

You'll need v2.2 and its INDEXPVT setting.



Re: [Dovecot] dovecot cores

2012-10-11 Thread Timo Sirainen
On 11.10.2012, at 9.43, dove...@freakout.de wrote:

> Core was generated by `/opt/dovecot/sbin/dovecot'.

OK..

> #0  0xb7f95fe4 in str_to_time () from /opt/mysql/lib/libmysqlclient.so.18
> #1  0xb7f131c0 in master_instance_list_add_line (list=0x9d48880, 
> line=0x9d540c8 "1349762052\tdovecot\t/var/dovecot/run\t")
>at master-instance.c:85

Dovecot code is calling str_to_time() from libmysqlclient, instead of from 
Dovecot's internal code. Not the first time mysql conflicted with Dovecot code. 
This could be worked around, but .. why is your dovecot binary linked with 
libmysqlclient? Only auth and dict binaries should be.



Re: [Dovecot] memory allocation in new thread

2012-10-11 Thread Timo Sirainen
On 11.10.2012, at 13.21, . . wrote:

> Hi! I have some problems with memory allocation.
> I create new thread in cidir storage and call malloc(), and it fails to 
> allocate even 1 byte.
> What can cause this problem?

No idea. Dovecot in general isn't designed to work with threads.

> Oct 11 12:56:15 imap(guest): Info: test_pthread_malloc: malloc() succeeded
> Oct 11 12:56:15 imap(guest): Info: test_pthread_malloc_func: malloc() failed

Well, or the one thing I can think of you to try: Set default_vsz_limit=0

Also straceing the process could show what exactly fails.



Re: [Dovecot] Irrelevant information filling logs

2012-10-11 Thread Stephan Bosch

On 10/10/2012 9:37 PM, Timo Sirainen wrote:

On 10.10.2012, at 16.39, 3.lis...@adminlinux.com.br wrote:


I have a "Ubuntu10.04 + dovecot-2.0.13" configuration in my server. My mailbox 
server is shared by ~ 10k domains. It works fine with ~50k accounts.

There is a lot of logs of "quota exceeded" like this:

Oct 10 13:00:56 mailboxserver5 dovecot: lmtp(29105, user@mailboxserver5): 
Error: ifcIN1NxdVCxcQAAMBx7mQ: sieve: msgid=unspecified: failed to store into 
mailbox 'INBOX': Quota exceeded (mailbox for user is full)

These messages are not important to me. But these messages fill the log files, 
damaging the display of messages that could be important.

Is there a way to send specific Dovecot errors on specific files or just 
discard them?

Upgrade to v2.1, they are logged with info level there. (I think v2.0 also logs 
them with info level if you don't use Sieve.)


Nope, that is unfortunately not going to help right now. At least not 
until the following change I made yesterday is released:


http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/5c1ce25596ed

Of course you can patch it if you're in a hurry.

Regards,

Stephan.


[Dovecot] imap proxy setup - "killed with signal 11"

2012-10-11 Thread btb

hi-

i'm setting up an imap proxy in front of a novell groupwise server.  it 
seems to so far be partially working, but dovecot is having trouble in 
certain cases.  i expect that it's ultimately due to what i believe is a 
very poor implementation of imap provided by groupwise [at least based 
on other experiences in the past] - but that's a big part of why i'd 
like to have dovecot in between it and clients.


below is information collected during starting of dovecot, 
opening/initial connection from a client [os x mail.app], closing of the 
client, and stopping of dovecot.


os is ubuntu 12.10 development/beta, dovecot is 2.1.7 courtesy of 
ubuntu's packages.


log entries:
Oct 11 13:24:33 halo dovecot: master: Dovecot v2.1.7 starting up
Oct 11 13:24:49 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14171, TLS, 
session=
Oct 11 13:24:50 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14174, TLS, 
session=
Oct 11 13:24:51 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14176, TLS, 
session=
Oct 11 13:24:51 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14178, TLS, 
session=

Oct 11 13:24:51 halo dovecot: imap(jdoe): Connection closed in=16 out=350
Oct 11 13:24:52 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14180, TLS, 
session=
Oct 11 13:24:52 halo dovecot: imap(jdoe): Error: imapc: Mailbox 'Trash' 
state corrupted: Expunged message reappeared in session (uid=6282 < 
next_uid=6283)
Oct 11 13:24:52 halo dovecot: imap(jdoe): Fatal: master: service(imap): 
child 14176 killed with signal 11 (core dumped)
Oct 11 13:24:57 halo dovecot: imap(jdoe): Error: imapc: Mailbox 'Trash' 
state corrupted: Expunged message reappeared in session (uid=6282 < 
next_uid=6283)
Oct 11 13:24:57 halo dovecot: imap(jdoe): Fatal: master: service(imap): 
child 14178 killed with signal 11 (core dumped)
Oct 11 13:24:57 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14182, TLS, 
session=
Oct 11 13:24:58 halo dovecot: imap(jdoe): Error: imapc: Mailbox 'Trash' 
state corrupted: Expunged message reappeared in session (uid=6282 < 
next_uid=6283)
Oct 11 13:24:58 halo dovecot: imap(jdoe): Fatal: master: service(imap): 
child 14180 killed with signal 11 (core dumped)
Oct 11 13:25:03 halo dovecot: imap(jdoe): Error: imapc: Mailbox 'Trash' 
state corrupted: Expunged message reappeared in session (uid=6282 < 
next_uid=6283)
Oct 11 13:25:03 halo dovecot: imap(jdoe): Fatal: master: service(imap): 
child 14182 killed with signal 11 (core dumped)
Oct 11 13:25:03 halo dovecot: imap-login: Login: user=, 
method=PLAIN, rip=10.68.40.110, lip=10.59.1.53, mpid=14184, TLS, 
session=
Oct 11 13:25:03 halo dovecot: imap(jdoe): Error: imapc: Mailbox 'Trash' 
state corrupted: Expunged message reappeared in session (uid=6282 < 
next_uid=6283)
Oct 11 13:25:03 halo dovecot: imap(jdoe): Fatal: master: service(imap): 
child 14184 killed with signal 11 (core dumped)
Oct 11 13:25:09 halo dovecot: imap(jdoe): Error: imapc: Mailbox 'Trash' 
state corrupted: Expunged message reappeared in session (uid=6282 < 
next_uid=6283)
Oct 11 13:25:09 halo dovecot: imap(jdoe): Fatal: master: service(imap): 
child 14174 killed with signal 11 (core dumped)

[repeats]
Oct 11 13:25:27 halo dovecot: dns-client: Warning: Killed with signal 15 
(by pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: dns-client: Warning: Killed with signal 15 
(by pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: master: Warning: Killed with signal 15 (by 
pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: auth: Warning: Killed with signal 15 (by 
pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: config: Warning: Killed with signal 15 (by 
pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: ssl-params: Warning: Killed with signal 15 
(by pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: anvil: Warning: Killed with signal 15 (by 
pid=1 uid=0 code=kill)
Oct 11 13:25:27 halo dovecot: log: Warning: Killed with signal 15 (by 
pid=1 uid=0 code=kill)


gdb backtrace:

~ >gdb /usr/lib/dovecot/imap /var/cache/imapproxy/jdoe/core
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/lib/dovecot/imap...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/imap...done.

done.
[New LWP 13939]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
U

Re: [Dovecot] some questions on AOX or rather a mail system setup

2012-10-11 Thread Christoph Anton Mitterer
Hi.

Sorry folks for the stupid postings...

At first I posted what should go to the AOX list accidentally here and
then our institute's MTA hat some issues yesterday, so the mail[0] where
I already tried to explain the wrong posting, came much earlier than the
wrong post itself.
Guess you see why I need a better mail system ;)


Sorry,
Chris.

[0] http://dovecot.org/pipermail/dovecot/2012-October/068740.html


smime.p7s
Description: S/MIME cryptographic signature


Re: [Dovecot] iterate_query does not use userdb - mail_location not found

2012-10-11 Thread Jack Bates

On 10/11/2012 8:19 AM, dove...@freakout.de wrote:

sql.conf:
driver = mysql
connect = host=much dbname=toarx user=exim password=
default_pass_scheme = PLAIN
password_query = select user as username, password, userdb_home, userdb_mail, 
userdb_quota_rule from vusers where email = '%u'
user_query = select user as username, userdb_home, userdb_mail, 
userdb_quota_rule from vusers where email = '%u'
iterate_query = select email as user from vusers



Only prefetch in the password_query prefixes with userdb_. Some things 
such as doveadm commands and lmtp delivery don't use passdb but userdb 
directly. The user_query should not have the userdb_ prefix. Also, 
according to the wiki, iterate_query returns username, not user.


http://wiki2.dovecot.org/AuthDatabase/SQL



Jack


[Dovecot] iterate_query does not use userdb - mail_location not found

2012-10-11 Thread dovecot
Hi dovecot-comminity,

can't get iterate_query working. doveadm cannot find mail_location
which comes from userdb query. dovecot itself works fine with sql.
Whats wrong? please help:

 [root@glen exim]# /opt/dovecot/bin/doveadm search -A mailbox Trash savedbefore 
90d
doveadm(u...@mitmachnet.de): Error: user u...@mitmachnet.de: Initialization 
failed:
mail_location not set and autodetection failed:
Mail storage autodetection failed with home=(not 
set)
doveadm(u...@mitmachnet.de): Error: User init failed

dovecot.conf:
passdb {
  driver = sql
  args = /etc/dovecot/sql.conf
}
userdb {
  driver = sql
  args = /etc/dovecot/sql.conf
}

sql.conf:
driver = mysql
connect = host=much dbname=toarx user=exim password=
default_pass_scheme = PLAIN
password_query = select user as username, password, userdb_home, userdb_mail, 
userdb_quota_rule from vusers where email = '%u'
user_query = select user as username, userdb_home, userdb_mail, 
userdb_quota_rule from vusers where email = '%u'
iterate_query = select email as user from vusers

Cheers
Axel


Re: [Dovecot] some questions on AOX or rather a mail system setup

2012-10-11 Thread Frerich Raabe

Am 11.10.2012 14:56, schrieb Robert Schetterer:

Am 11.10.2012 04:10, schrieb Christoph Anton Mitterer:

3) Is AOX suitable for the local server?


[..]


Christoph, sorry, what exact is AOX, and what is its relation to the
dovecot list


I suppose he meant Archiveopteryx (another IMAP server).

--
Frerich Raabe - ra...@froglogic.com
www.froglogic.com - Multi-Platform GUI Testing



Re: [Dovecot] some questions on AOX or rather a mail system setup (ignore)

2012-10-11 Thread Robert Schetterer
Am 11.10.2012 04:18, schrieb Christoph Anton Mitterer:
> Oops... that was obivously not intended for dovecot but AOX mailing
> list,... where I ask around similar questions.
> 
> Sorry for the noise =)
> 
> 
> Cheers,
> Chris.
> 

ups answered exact about this *g


-- 
Best Regards
MfG Robert Schetterer


Re: [Dovecot] some questions on AOX or rather a mail system setup

2012-10-11 Thread Robert Schetterer
Am 11.10.2012 04:10, schrieb Christoph Anton Mitterer:
> 3) Is AOX suitable for the local server?
> - I couldn't use maildir locally, because I loose just to much space to
> the block fragmentation. But I guess I won't have this problem with the DB 
> backend.
> 
> 
> a) Is AOX able to manage a really big folder hierarchy that basically
> ever keeps growing... with easily several 100k
> mails per folder... and that is in total already over 100GB?
> 
> I read that e.g. dovecot would have more performance problems with that.
> 
> 
> b) I would prefer to have fast full text search. Does AOX provide
> this?
> 
> I read that IMAP has limitations which make full text search not really 
> usable via it?
> 
> 
> Further, I remember some dovecot wiki page that showed a comparison which said
> that both do not perfectly implement imap.

Christoph, sorry, what exact is AOX, and what is its relation to the
dovecot list

youre looking to an overall mail setup
so split your questions up to software you wanna use and ask the related
mail list, perhaps hire some mail consultant advice you

-- 
Best Regards
MfG Robert Schetterer


[Dovecot] some questions on AOX or rather a mail system setup

2012-10-11 Thread Christoph Anton Mitterer
Hi folks.


Perhaps you find some time to look into this,...


I'm trying to plan my mail system and would have some questions.

The overall idea is about the following:
- There is a (internet) server, which is the MTA (which will be postfix)
and imap and/or pop3 server (which shall be, guess, dovecot ... AOX comes in 
later).
- Any spam filtering, virus-scanning, mail filtering happens on that
server.
- I have not yet decided on whether to use maildrop for this or Sieve.
Maildrop is nice, but has one major deficiency which I don't know how to
work around.
- A few clients (that means I won't serve 100 of users) connect to that
server via imap and should see all mails, etc. already in some fancy
sorted hierarchy (that means filtered into different directories).



So far nothing complicated. But now...



- Apart from spam, I never delete mail; and because I'm subscribed to
many lists, I get a lot of mail.

- Storage on my server is limited and it's located somewhere at my ISP,
so I generally do not trust it with respect to safety...
For both reasons, I want the canonical archive of all mail to be at home
at some local server.

- The local server should also be an imap server, so that I can access
the archive from may computers at home.

- The local server won't be available from the internet.

- The local archive should have the same folder hierarchy as the
internet server (I'd prefer not to filter twice).

- The local archive might be AOX...



Mail Flow:
- I generally want to have _all_ mail (which is not sorted out because
of being spam) to be archived at the local server.

- But(!) I want to selectively keep (in addition) mail at the internet
server.
For example I may want to select the folder that contains all mail form
some friend to be kept online completely.
But I may want to decide that mailinglists keep only the last 10 days
and/or 1000 messages of mail.

- The idea is, that the local server regularly (when it is
online/running) catches new mail from the internet server... and stores
it in the archive.

- So apart from new mail that has not yet been read, that local archive
contains always all mails that are also on the internet server... the
later may contain (for specific directories) the same, or just parts of.

- The MUAs will then have two imap accounts, one to the internet server
and one to the local archive,... each one being usable, depending on
where I am.



1) This is where my first problem arises:
How can I implement that mail flow, especially:
- How do I secure that all mail is read from the internet server (i.e.
that nothing is "forgotten"?
- How do I make sure that no mails are retrieved twice (or more)? A
problem which I often had with pop, when the mail client crashed during
sync?
- Further it must be secured, that when I delete something on the
internet server, it is NOT deleted on the local server (on the next
mail-fetching) this is why I don't use the word "sync".

a) One stupid solution would be, that I duplicate all mail on the online
server,... one part is for staying online, one part is for being fetched
to the local archive.
As soon as it was fetched... that copy gets removed (always).
That solution would give a clean and secured separation of both?
b) I don't think offlineimap or any other caching-like solution is the
right thing... especially as one must always fear that such a cache may
be accidentally wiped.

Are there better solutions than (a)?


2) Problem would be already a refinement of a working solution for (1)
(but obviously not when using (1).(a) ).
When e.g. reply to or forward a mail using the online server,... and
that mail had already been fetched,... can I make the flag synced?



3) Is AOX suitable for the local server?
- I couldn't use maildir locally, because I loose just to much space to
the block fragmentation. But I guess I won't have this problem with the DB 
backend.


a) Is AOX able to manage a really big folder hierarchy that basically
ever keeps growing... with easily several 100k
mails per folder... and that is in total already over 100GB?

I read that e.g. dovecot would have more performance problems with that.


b) I would prefer to have fast full text search. Does AOX provide
this?

I read that IMAP has limitations which make full text search not really usable 
via it?


Further, I remember some dovecot wiki page that showed a comparison which said
that both do not perfectly implement imap.




Thanks a lot,
Chris.



smime.p7s
Description: S/MIME cryptographic signature


[Dovecot] memory allocation in new thread

2012-10-11 Thread . .
Hi! I have some problems with memory allocation.
I create new thread in cidir storage and call malloc(), and it fails to 
allocate even 1 byte.
What can cause this problem?

Dovecot vesrion is: 2.1.10 (130563b592c9+)

Sample code looks like this (I also link to pthread with: -pthread):

#define TEST_MALLOC() \
{ \
    void *p; \
     p = malloc(1); \
     if (!p) { \
         i_info("%s: malloc() failed", __FUNCTION__); \
     } else { \
         i_info("%s: malloc() succeeded", __FUNCTION__); \
         free(p); \
     } \
}

#include 

static void *test_pthread_malloc_func(void *data_)
{
     TEST_MALLOC();
     return NULL;
}

static void test_pthread_malloc()
{
     int ret;
     pthread_t tid;
     TEST_MALLOC();
     ret = pthread_create(&tid, NULL, test_pthread_malloc_func, NULL);
     if (ret) {
     i_info("failed to start thread");
     } else {
     pthread_join(tid, NULL);
     }
}

I call test_pthread_malloc() function.
It produces following output:

Oct 11 12:56:15 imap(guest): Info: test_pthread_malloc: malloc() succeeded
Oct 11 12:56:15 imap(guest): Info: test_pthread_malloc_func: malloc() failed



Re: [Dovecot] some questions on AOX or rather a mail system setup (ignore)

2012-10-11 Thread Christoph Anton Mitterer
Oops... that was obivously not intended for dovecot but AOX mailing
list,... where I ask around similar questions.

Sorry for the noise =)


Cheers,
Chris.


smime.p7s
Description: S/MIME cryptographic signature