[Dovecot] imap support for attachement deletion?

2010-03-13 Thread Louis-David Mitterrand
Hi,

Does dovecot support in-place attachement deletion?

Mutt currently uploads a new message after deleting attachements. Is
there a better, imap way to do it?


Re: [Dovecot] Sendmail / Dovecot Config

2010-03-13 Thread John Moorhouse
I've tried this and failed I found a really good article on using postfix with 
dovecot, so went that route and all is bow well.

Thanks for the help.

John


On 11 Mar 2010, at 17:21, Dennis Guhl wrote:

> On Thu, Mar 11, 2010 at 04:40:27PM +, John Moorhouse wrote:
> 
> [..]
> 
>> My only problem is that I have also configured send mail as best as I know
>> to listen on port 25 as an SMPT client but any emails sent to it to one of
>> the email addresses are saved by sendmail to /var/spool/mail/username and
>> not picked up by dovecot
> 
> You might want to tell sendmail how to deliver mail to dovecot. For
> example, this can be done with dovecots LDA:
> 
> http://wiki.dovecot.org/LDA
> http://wiki.dovecot.org/LDA/Sendmail
> 
> Bye
> Dennis



[Dovecot] extraneous mail folder created

2010-03-13 Thread John Moorhouse
I'm trying to set up dovecot on a Fedora box for about 5 users, I have a
raid 5 array that is used for home folders etc mounted on /home, and I've
created a directory /home/mail, which I have used a sym link to map
/var/mail to. I've created folders for each of the users with relevant
permissions and edited the dovecote config with:-

namespace private {
separator = /
prefix = "#dbox/"
location = dbox:~/mail:INBOX=/var/mail/%u
inbox = yes
hidden = yes
list = no   # for v1.1+
}
namespace private {
separator = /
prefix =
location = dbox:/var/mail/%u/mail
}

This all seems to work with the exception that when a imap client attaches to 
dovecot an empty folder called 'mail' is created in the users home directory. 
so for client jenni, whist all her emails etc are stored in /home/mail/jenni/ 
for INBOX and /home/mail/jenni/mail/ for folders etc, an empty folder is 
created as /home/jenni/mail/

Any help appreciated

John

Re: [Dovecot] imap support for attachement deletion?

2010-03-13 Thread Louis-David Mitterrand
On Sat, Mar 13, 2010 at 12:25:49PM +0100, Oliver Eales wrote:
> 
> Am 13.03.2010 um 11:26 schrieb Louis-David Mitterrand:
> 
> > Hi,
> > 
> > Does dovecot support in-place attachement deletion?
> > 
> > Mutt currently uploads a new message after deleting attachements. Is
> > there a better, imap way to do it?
> 
> Hello,
> no, this is the IMAP way to do it. 
> Via IMAP you can't modify a message, only its attributes (flags)

On the mutt-dev list someone pointed out the APPEND spec from the
IMAP4rev1 standard:

If a date-time is specified, the internal date SHOULD be set in
the resulting message; otherwise, the internal date of the
resulting message is set to the current date and time by default.

Does dovecot honor a date-time passed during APPEND?


[Dovecot] Dovecot 2.0beta3: Auth changes in Mercurial

2010-03-13 Thread Thomas Leuxner
Hi Timo,

are the latest 'Auth-Changes' supposed to be complete? They break 
'al...@domain.tld' logins for me.

Regards
Thomas


Re: [Dovecot] Dovecot 2.0beta3: Auth changes in Mercurial

2010-03-13 Thread Timo Sirainen
On Sat, 2010-03-13 at 18:07 +0100, Thomas Leuxner wrote:

> are the latest 'Auth-Changes' supposed to be complete? They break 
> 'al...@domain.tld' logins for me.

I was running mdbox stress testing so I didn't bother to stop that and
test auth commits. :) Fixed now.



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


Re: [Dovecot] Dovecot 2.0beta3: Auth changes in Mercurial

2010-03-13 Thread Thomas Leuxner
Am 13.03.2010 um 18:39 schrieb Timo Sirainen:
> I was running mdbox stress testing so I didn't bother to stop that and
> test auth commits. :) Fixed now.

That does the trick. Thanks.



Re: [Dovecot] Plugin like zlib

2010-03-13 Thread Timo Sirainen
On Thu, 2010-03-11 at 19:33 -0300, Alex Baule wrote:
> do {
> ret = read(zstream->fd ,crypttext, size);
> fprintf(zstream->debug,"DENTRO DA READ RET = %d -- ERRNO = %d -- STR
> = |%s|\n", ret, errno, strerror(errno));
> if(ret > 0){
> EVP_DecryptUpdate(&ctx, plaintext, &plain_len, crypttext, ret);
> memcpy(stream->w_buffer + stream->pos , plaintext, plain_len);
> 
> bzero (plaintext, DEFAULT_MAX_BUFFER_SIZE);
> EVP_DecryptFinal(&ctx, plaintext, &plain_len_final);
> memcpy(stream->w_buffer + stream->pos + plain_len , plaintext,
> plain_len_final);

I think you should do some kind of internal buffering here that contains
the unused part of crypttext, and reuse it for next DecryptUpdate().
v1.x's zlib plugin lets zlib library take care of that, so it makes the
code a lot simpler.

Maybe you should look at hg version of v2.0 and its istream-bzlib.c.
That's probably a lot closer to what you need to do. (But note that
there are some other istream changes in v2.0, so you can't just use the
same code with v1.x without some more changes.)

And I don't think you should call EVP_DecryptFinal() until you've seen
EOF from the parent fd?


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


Re: [Dovecot] IMAP proxy configuration

2010-03-13 Thread Timo Sirainen
On Thu, 2010-03-11 at 09:27 -0300, Leonardo Rodrigues wrote:

> # Get the password
> password_query = select endereco as user, password, '/var/spool/mail/%u' 
> as userdb_home, 'maildir:/var/spool/mail/%u' as userdb_mail, 8 as 
> userdb_uid, 12 as userdb_gid, concat('*:storage=', quota) as 
> userdb_quota_rule, 'Trash:storage=100M' as userdb_quota_rule2 from 
> emails where endereco = '%u' and ativa = '1'
> [r...@correio dovecot]#
> 
> 
>  i've read several docs about configuring proxy on dovecot but all 
> of them says about proxying specific users  i'm interested on 
> proxying some domains. I couldnt find a way to configure that nor some 
> howto similar to that.

Basically add to your password_query something like:

.., domains.host as host, 'Y' as proxy_maybe, ..
from emails, domains where domains.domain = '%d', ..

So it's really exactly the same as per-user quota, except you're just
returning it per-domain in the query.


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


Re: [Dovecot] Bug in driver-mysql.c + fix

2010-03-13 Thread Timo Sirainen
On Wed, 2010-03-10 at 17:03 +, Alain Williams wrote:
> > The problem with doing that is that 1) it's not normally necessary and
> > more importantly 2) doing that makes any potential SQL injection
> > security holes a lot easier to exploit. So I'm not all that eager in
> > adding such code, especially if it can be worked around another way..
> 
> CLIENT_MULTI_STATEMENTS allows multiple statements in one call (you separate 
> by ',').
> CLIENT_MULTI_RESULTS does not imply CLIENT_MULTI_STATEMENTS.
> Is this what you were concerned about ?

Yeah, I mixed up MULTI_STATEMENTS and MULTI_RESULTS. So I can enable the
MULTI_RESULTS I guess..

I committed your patch, but with some changes. In error conditions it
would have leaked memory.
http://hg.dovecot.org/dovecot-2.0/rev/612db456c090

> That is not how I store passwords - I keep them as DIGEST-MD5, this is:
>   md5('username:domain:password')
> So I want %o to be that value. Squirrelmail should be able to deduce that from
> the line in the dovecot-sql.conf:
>   default_pass_scheme="DIGEST-MD5"

Well, yeah.. That would be possible to implement. But not a very good
idea to waste everyone's CPU by calculating that checksum for each
lookup, when you're the only one using it. So it should be a var-expand
modified instead of variable, so you could then use e.g. %Sw that
expands to %w through default_pass_scheme (and only when it's used).

The problem is, var-expand code doesn't currently support adding more
modifiers. So its API would need to be changed.

> I am trying to find a definition of the API to plugins, ...

There are many kinds of plugins, but none really seem to fit what you
wanted to do below.

> if the SQL stored procedure can return arbitrary variables that can then be 
> used
> by PHP plugins then I can do things like issuing a warning about the password
> about to expire, number of failed login attempts since the last success, ...
> Ie all sorts of things that the authentication stored procedures could store
> and manage.

One possibility would be to return 'reason' string from password_query
for failures, which contains all of the information you want to know.
And if you don't want it to be visible to non-webmail clients, you could
return it only when '%r'='127.0.0.1'.


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


[Dovecot] Design: Asynchronous I/O for single/multi-dbox

2010-03-13 Thread Timo Sirainen
The long term plan is to get all of Dovecot disk I/O asynchronous. The
first step to that direction would be to make dbox/mdbox I/O
asynchronous. This might also allow mbox/maildir to become partially
asynchronous.

http://www.dovecot.org/list/dovecot/2009-December/045481.html already
started describing how the lib-storage API could be changed to support
high-latency storages. Adding support for all of the paralellism would
be nice, but probably not necessary as the first step. Then again, the
API changes are necessary, so the parallelism optimizations probably
aren't a huge task on top of that.

Besides the API changes described in the above link, another change
that's necessary is to add mail_get_nonblocking_stream(). The returned
stream can return EAGAIN whenever it would need to block. Whenever
sending message data to client, this stream would have to be used. It
would also be used internally by all of message parsing/searching code.
Luckily all of that already supports nonblocking input or can be easily
modified to support it.

Below are some thoughts how to go forward with this. I originally
thought about writing a more specific plan, but I think this is good
enough now to start coding. The target Dovecot version is v2.1, not
v2.0.

Filesystem API
==

The idea is to first abstract out all POSIX filesystem accessing in
dbox/mdbox code. Non-blocking I/O works pretty nicely for socket I/O, so
I thought I'd use a similar API for disk I/O as well:

handle = open(path, mode)
 - this function can't fail. it's executed asynchronously.
 - mode=read-only: no writing to file
 - mode=append: appending to file is allowed

handle = create(path, mode, permissions)
 - this function can't fail. it's executed asynchronously.
 - mode=fail-if-exists: commit() fails if file already exists
 - mode=replace-if-exists: commit() replaces file if it already exists
 - permissions: i'm not entirely sure how this works yet. but it should
contain mode and gid in some format

set_input_callback(handle, callback, context)
set_output_callback(handle, callback, context)
 - call the callback when more data can be read/written

ret = pread(handle, buf, size, offset)
 - just like pread(), but can fail with EAGAIN if there are no bytes
already buffered. so the idea is that the backend implementation would
buffer/readahead data, which would be returned by this call. this would
require memcpy()ing all data, but it might get too complex/fragile if it
was asynchronously written to given buffer.

ret = write(handle, buf, size)
 - append data to given file and return how many bytes were actually
added to write buffer. works in a similar way than writing to socket.
data can only be appended to files, there is no support for overwriting
data.
 - no writes will be visible to reads until commit() is called

ret = commit(handle, [filename])
 - commit all previous writes to disk. either returns success/EAGAIN.
 - if filename is given and a new file is being created, the filename is
changed to the given one instead of using the original path's filename.
this is needed because e.g. mdbox saving can write many temp files in a
single transaction and only at commit stage it locks the index files and
knows what the filenames will be.

rollback(handle)
 - rollback all previous writes.

close(handle)
 - if file was created and not committed, the temp file will be deleted
 - does implicit rollback

ret = try_lock(handle)
 - this isn't an asynchronous operation! it assumes that locking state
is kept in memory, so that the operation will be fast. if backend
doesn't support locking or it's slow, single-dbox should be used
(instead of multi-dbox), because it doesn't need locking.
 - returns success or "already locked"
 - only exclusive locking is possible

Async IO streams


Async input streams are created with FS API handle, so it's possible to
start reading from them before the file has even been open()ed. The
callers must be aware of this and realize that read() can fail with
ENOENT, etc.

Async input streams' read() would work exactly as file_istream works for
non-blocking sockets: It would return data that is already buffered in
memory. If there's nothing, it returns EAGAIN. The FS API's
set_input_callback() can be used to set a callback function that is
called whenever there's more data available in the buffer.

Async output streams also work the same as non-blocking file_ostreams:
write() returns the number of bytes added to buffer. When buffer becomes
full, it starts returning EAGAIN. The ostream handles flushing
internally the same way as file_ostreams does, although instead of using
io_add(IO_WRITE) it uses FS API's set_output_callback(). If callers need
to know when more data can be written or when all of the data has been
written, it can override the ostream's flush_callback, just like with
file_ostreams.

Async IO for FS API backend
===

So now that all of the APIs have been designed, all that's nee

Re: [Dovecot] IMAP proxy configuration

2010-03-13 Thread Leonardo Rodrigues

Em 13/03/2010 18:17, Timo Sirainen escreveu:


Basically add to your password_query something like:

.., domains.host as host, 'Y' as proxy_maybe, ..
from emails, domains where domains.domain = '%d', ..

So it's really exactly the same as per-user quota, except you're just
returning it per-domain in the query.
   



but if i simply add that, query will always return nothing when 
user is not local.


where endereco='%u'

will make it return an empty resultset when user does not exists 
locally.



i'm really strugling to discover how, probably with MySQL select 
syntax, to return one resultset if CONDITION1 (where endereco='%u' 
exists) and another resultset if CONDITION2 (where domains.domain = '%d' 
exists)


i really dont know to acchieve that  imap proxying is clear to 
me, but i couldnt get how to acchieve it for users that does not exists 
in my local email table ...




--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






Re: [Dovecot] IMAP proxy configuration

2010-03-13 Thread Timo Sirainen
On Sat, 2010-03-13 at 21:19 -0300, Leonardo Rodrigues wrote:
> >
> > .., domains.host as host, 'Y' as proxy_maybe, ..
> > from emails, domains where domains.domain = '%d', ..
> >
> > So it's really exactly the same as per-user quota, except you're just
> > returning it per-domain in the query.
> >
> 
> 
>  but if i simply add that, query will always return nothing when 
> user is not local.
> 
>  where endereco='%u'
> 
>  will make it return an empty resultset when user does not exists 
> locally.

So are you saying that the users table contains only local users, while
some domain table contains all domains and their destination servers?
Then you'll just need to do outer join. Something like:

.., domains.host as host, 'Y' as proxy_maybe, ..
from domains
outer join emails on (username = '%u')
where domain.domain = '%d'


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


Re: [Dovecot] IMAP proxy configuration

2010-03-13 Thread Leonardo Rodrigues

Em 13/03/2010 21:23, Timo Sirainen escreveu:

So are you saying that the users table contains only local users, while
some domain table contains all domains and their destination servers?
Then you'll just need to do outer join. Something like:

.., domains.host as host, 'Y' as proxy_maybe, ..
from domains
outer join emails on (username = '%u')
where domain.domain = '%d'
   


Timo i've tried JOINs, but i've never really understood those crazy 
things (i'm really very far from being a SQL expert).


but seems i got the expected results using UNION and adjusting 
queries to have the same number of columns. First i tried union with 
normal queries but couldnt get it because queries must have the same 
number of rows. Then i adjusted it ... and seems its OK.


Please check resultsets when querying a LOCAL user and when 
querying with a NON-local (to be proxied) user. Do you think this query 
will make things work as i need ?



querying a LOCAL user:
http://pastebin.com/L3q6HGrA

querying a NON-local (to be proxied) user:
http://pastebin.com/fV91LB0x

querying a NON-local and NOT-to be proxied user (correctly returns 
an empty resultset)

http://pastebin.com/SBwCEVEm


--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






Re: [Dovecot] Design: Asynchronous I/O for single/multi-dbox

2010-03-13 Thread Frank Cusack

On 3/14/10 1:59 AM +0200 Timo Sirainen wrote:

The long term plan is to get all of Dovecot disk I/O asynchronous. The
first step to that direction would be to make dbox/mdbox I/O
asynchronous. This might also allow mbox/maildir to become partially
asynchronous.


Does it really need to be?  Sure, for example you might be able to return
to a client that (say) a move didn't complete but is that really useful?
A single blocked I/O is probably indicative of a systemic problem and
the next operation is going to fail as well.  A mail server is part of
a system and in this case, wouldn't it be easier to let the client handle
timeouts?

Just playing devil's advocate since you haven't presented the advantage
of async I/O.  I don't want to guess at the reasoning, but e.g. I hope
you're not planning to return success results before I/O actually
completes.


So now that all of the APIs have been designed, all that's needed to do
is to write a simple FS API implementation using kernel's async IO API,
right? Wrong. There is no usable async IO API in Linux, and probably
nowhere else either:

...

So for now the only practical way is to implement it with threads. There


Threads are simpler anyway.


are several libraries that could make this easier.. But all of them
enable (and require) full thread safety for libc calls. I don't really
like that. Dovecot isn't using threads, I shouldn't pay the penalty of
using extra locking when it's really not necessary.


You're pre-optimizing.  The overhead of an uncontested lock is essentially
zero.


So I was thinking about doing the async IO in two ways:
2) Fallback version that uses pthreads with mutexes.


I would do this version only.

-frank


Re: [Dovecot] Design: Asynchronous I/O for single/multi-dbox

2010-03-13 Thread Timo Sirainen
On 14.3.2010, at 4.40, Frank Cusack wrote:

> Just playing devil's advocate since you haven't presented the advantage
> of async I/O.  I don't want to guess at the reasoning, but e.g. I hope
> you're not planning to return success results before I/O actually
> completes.

The idea was that a single process could handle tons of connections. Maybe in 
the end the number of IMAP processes you'd have would be about 1-2 x the number 
of CPU cores.

And not just that. Also parallelism. Dovecot could issue a lot of I/O requests 
in parallel and OS can reorder those so that it gives the best performance by 
reading them from disk in the right order. And the higher the latency to disks 
is, the higher benefits there comes from parallelism (NFS, NoSQL).



Re: [Dovecot] IMAP proxy configuration

2010-03-13 Thread Leonardo Rodrigues

Em 13/03/2010 23:12, Leonardo Rodrigues escreveu:


Timo i've tried JOINs, but i've never really understood those 
crazy things (i'm really very far from being a SQL expert).


but seems i got the expected results using UNION and adjusting 
queries to have the same number of columns. First i tried union with 
normal queries but couldnt get it because queries must have the same 
number of rows. Then i adjusted it ... and seems its OK.




got it working with few tweaks  i had to return '127.0.0.1' as 
host for local users ... without that, login process was segfaulting. 
And had to return %w as password for the proxied-domains query.


query is:   (with linebreaks for easy understanding)

password_query =
select
  endereco as user,
  password,
  '/var/spool/mail/%u' as userdb_home,
  'maildir:/var/spool/mail/%u' as userdb_mail,
  8 as userdb_uid,
  12 as userdb_gid,
  concat('*:storage=', quota) as userdb_quota_rule,
  'Trash:storage=100M' as userdb_quota_rule2,
  'Y' as proxy_maybe,
  '127.0.0.1' as host
  from emails
  where
  endereco = '%u' and ativa = '1'
union
select
  NULL as user,
  '%w' as password,
  NULL as userdb_home,
  NULL as userdb_mail,
  NULL as userdb_uid,
  NULL as userdb_gid,
  NULL as userdb_quota_rule,
  NULL as userdb_quota_rule2,
  'Y' as proxy_maybe,
  imapproxy.host as host
  from imapproxy
  where
imapproxy.dominio = '%d'


that worked flawlessly  :) And i didnt had to use JOINs hehehehe

log from the main server, for a proxied user:

Mar 13 23:48:48 correio dovecot: imap-login: 
proxy(s...@proxieddomain.com.br): started proxying to 10.252.25.2:143: 
user=, method=PLAIN, rip=127.0.0.1, 
lip=127.0.0.1, secured


log from the 10.252.25.2 server:

Mar 13 23:48:31 correio dovecot: imap-login: Login: 
user=, method=PLAIN, rip=192.168.1.2, 
lip=10.252.25.2




the only minor problem is that when local users get logged in on 
the main server, logs shows that they were proxied to 127.0.0.1 


Mar 13 23:33:52 correio dovecot: pop3-login: Login: 
user=, method=PLAIN, rip=127.0.0.1, 
lip=127.0.0.1, secured
Mar 13 23:33:52 correio dovecot: pop3-login: 
proxy(localu...@localdomain.com.br): started proxying to 127.0.0.1:110: 
user=, method=PLAIN, rip=10.255.176.67, 
lip=192.168.1.2


i can easily live with that  but i would like to see local 
users logged as local connections not proxied to 127.0.0.1.


--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






Re: [Dovecot] Design: Asynchronous I/O for single/multi-dbox

2010-03-13 Thread Frank Cusack

On 3/14/10 4:48 AM +0200 Timo Sirainen wrote:

On 14.3.2010, at 4.40, Frank Cusack wrote:


Just playing devil's advocate since you haven't presented the advantage
of async I/O.  I don't want to guess at the reasoning, but e.g. I hope
you're not planning to return success results before I/O actually
completes.


The idea was that a single process could handle tons of connections.


And what's the advantage of that?  process-per-client already scales
really well, at the expense of more memory.  In both Linux and Solaris,
the cost of a process context switch is nearly the same as a thread
context switch.  I don't know about *BSD but I imagine it's similar.

There is a distinct disadvantage in complexity.


Maybe in the end the number of IMAP processes you'd have would be about
1-2 x the number of CPU cores.


I'd think many more than that (regardless of client model - multithread,
AIO or PPC), since most time is spent with the user idle and the IMAP
connection doing nothing.  I'd guess (a) you should be able to support at
least 100 simultaneous clients per CPU, if not 500, and (b) that simul
client support is I/O limited, not CPU limited.

I haven't ever run dovecot with a large user base so I don't have any
empirical data to back up that guess.  Folks here on the list must though.


And not just that. Also parallelism. Dovecot could issue a lot of I/O
requests in parallel and OS can reorder those so that it gives the best
performance by reading them from disk in the right order. And the higher
the latency to disks is, the higher benefits there comes from parallelism
(NFS, NoSQL).


The kernel already does that regardless of server implementation.

-frank


Re: [Dovecot] I need IMAP stress testing tool with SEARCH command

2010-03-13 Thread Charles Sprickman

On Fri, 12 Mar 2010, Ernesto Revilla wrote:


Hi.

Does anyone know of a good imap stress testing tool? And one which
supports SEARCH commands? I have to compare Courier and Dovecot. I
already did some tests using a modified postal/rabid package.

I would be thankfully for any hints.


"mstone" is old, but it was the only thing I found to do some testing on a 
new server that exercised smtp/pop/imap at the same time.  It scales 
pretty well too...


Look down at section 8 here:

http://mstone.sourceforge.net/doc/mstone.html

It currently does not support searching, but I'd bet you could hack that 
into the source.  In fact, it looks like someone may have and not updated 
the docs:


/* compute the search intervals  */
me->searchSchedule = 0;
me->currentSearch = me->numSearches = 0;
if (pish->imapSearchRate) {
me->numSearches = imapComputeSearchSchedule(ptcx, cmd,
&me->searchSchedule);
me->timeUntilSearch = me->searchSchedule[me->currentSearch];
}

D_PRINTF(debugfile,"computed search schedule\n");

return me;

(Not a C guy, but that sure hints at something)

Charles


Best regards.
Erny
Yaco Sistemas
Spain




Re: [Dovecot] Dovecot 2.0beta3: Auth changes in Mercurial

2010-03-13 Thread Thomas Leuxner
Core dump with all the latest changes:

Mar 14 07:22:57 spectre dovecot: master: service(auth): child 1841 killed with 
signal 11 (core dumped)

GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/dovecot/libdovecot.so.0...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/libdovecot.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot.so.0
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libpam.so.0...done.
Loaded symbols for /lib/libpam.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Core was generated by `dovecot/auth'.
Program terminated with signal 11, Segmentation fault.
[New process 1841]
#0  aqueue_count (aqueue=0x0) at aqueue.c:122
122 aqueue.c: No such file or directory.
in aqueue.c
(gdb) bt full
#0  aqueue_count (aqueue=0x0) at aqueue.c:122
area_size = 6583600
#1  0x0041010b in auth_request_handler_flush_failures (flush_all=true) 
at auth-request-handler.c:569
auth_requests = 
auth_request = 
i = 
count = 
__PRETTY_FUNCTION__ = "auth_request_handler_flush_failures"
#2  0x004101fe in auth_request_handler_deinit () at 
auth-request-handler.c:608
No locals.
#3  0x0040a136 in auth_deinit (_auth=0x0) at auth.c:229
auth = (struct auth *) 0x644df8
passdb = 
userdb = (struct auth_userdb *) 0x0
#4  0x0040a19f in auths_deinit () at auth.c:291
auth = (struct auth **) 0x642010
i = 
#5  0x004147fe in main (argc=1, argv=0x639370) at main.c:115
c = 

Regards
Thomas

[Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-13 Thread Thomas Leuxner
Latest from Mercurial. Dovecot crashes with 'mail_log' and 'notify' plugins 
enabled when deleting a message:

[08:22] root spectre:~# gdb /usr/lib/dovecot/imap /tmp/core 
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/dovecot/libdovecot-storage.so.0...Reading symbols 
from /usr/lib/debug/usr/lib/dovecot/libdovecot-storage.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /usr/lib/dovecot/libdovecot.so.0...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/libdovecot.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/dovecot/modules/lib01_acl_plugin.so...Reading 
symbols from /usr/lib/debug/usr/lib/dovecot/modules/lib01_acl_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib01_acl_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib02_imap_acl_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib10_quota_plugin.so...Reading 
symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib10_quota_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib10_quota_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib15_notify_plugin.so...Reading 
symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib15_notify_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib15_notify_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/lib20_mail_log_plugin.so...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib20_mail_log_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `dovecot/imap'.
Program terminated with signal 6, Aborted.
[New process 2151]
#0  0x7f5c79480ed5 in raise () from /lib/libc.so.6
#0  0x7f5c79480ed5 in raise () from /lib/libc.so.6
No symbol table info available.
#1  0x7f5c794823f3 in abort () from /lib/libc.so.6
No symbol table info available.
#2  0x7f5c79be62c5 in default_fatal_finish (type=, 
status=0) at failures.c:164
backtrace = 0x61f660 "/usr/lib/dovecot/libdovecot.so.0 [0x7f5c79be62b2] 
-> /usr/lib/dovecot/libdovecot.so.0 [0x7f5c79be631a] -> 
/usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f5c79be66c3] -> 
/usr/lib/dovecot/libdovecot-st"...
#3  0x7f5c79be631a in i_internal_fatal_handler (type=LOG_TYPE_PANIC, 
status=0, fmt=, args=) at 
failures.c:592
No locals.
#4  0x7f5c79be66c3 in i_panic (format=) at 
failures.c:230
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7fffd370, reg_save_area = 0x7fffd2b0}}
#5  0x7f5c79e72748 in view_lookup_uid (view=0x6614c0, seq=0, 
uid_r=0x7fffd39c) at mail-index-view.c:210
__PRETTY_FUNCTION__ = "view_lookup_uid"
#6  0x7f5c79e589c6 in mail_cache_decision_state_update (view=0x661800, 
seq=2151, field=12) at mail-cache-decisions.c:82
cache = (struct mail_cache *) 0x65e790
hdr = 
uid = 
__PRETTY_FUNCTION__ = "mail_cache_decision_state_update"
#7  0x7f5c79e5a4b0 in mail_cache_lookup_headers (view=0x661800, 
dest=0x67be28, seq=0, field_idxs=0x7fffd56c, fields_count=1) at 
mail-cache-lookup.c:484
_data_stack_cur_id = 5
ret = 
#8  0x7f5c79e88d22 in index_mail_get_raw_headers (mail=0x67b618, 
field=0x7f5c78608dc7 "Message-ID", value_r=0x7fffd5c8) at 
index-mail-headers.c:614
headers = {0x67b618 "\230?e", 0x7f5c79bfda98 "H\201??"}
value = 
headers_ctx = 
data = 
field_idx = 12
dest = (string_t *) 0x67be28
i = 
len = 
ret = 
header_values = {arr = {buffer = 0x661ec8, e