[Dovecot] Missing quotes in dovecot-config causes pigeonhole to failed.

2012-11-29 Thread nanashi

I had to manually quote in dovecot-config
LIBDOVECOT_LOGIN='-ldovecot-login -lssl -lcrypto  '
by default was
LIBDOVECOT_LOGIN=-ldovecot-login -lssl -lcrypto

That cause pigeonhole to failed.

Regards
nanashi


Re: [Dovecot] Missing quotes in dovecot-config causes pigeonhole to failed.

2012-11-29 Thread Timo Sirainen
On 29.11.2012, at 11.00, nanashi wrote:

> I had to manually quote in dovecot-config
> LIBDOVECOT_LOGIN='-ldovecot-login -lssl -lcrypto  '
> by default was
> LIBDOVECOT_LOGIN=-ldovecot-login -lssl -lcrypto
> 
> That cause pigeonhole to failed.

Oh, annoying :( I guess I'll release 2.1.12 with this one change.. or maybe 
wait a few more hours to see if people find anything else.

http://hg.dovecot.org/dovecot-2.1/rev/f77e87298a66



[Dovecot] Problem with mail_location and INDEX location

2012-11-29 Thread Matt Jones

HI,

I'm pulling my hair out a little trying to get dovecot to save it's 
index locally rather than in the NFS mount. No matter what I do it seems 
to save the indices in the Maildir on the NFS.


I'm using dovecot 2.0.18 on CentOS 6.3.

The relevant config I'm using:


mmap_disable = no
dotlock_use_excl = no # only needed with NFSv2, NFSv3+ supports O_EXCL and it's 
faster
mail_fsync = always
mail_nfs_storage = yes
mail_nfs_index = no
lock_method = dotlock

# Mail location and mailbox format.
mail_location = maildir:/%Lh/Maildir/:INDEX=/var/indexes/%Ld/%Lu/



Dovecot runs under the user:group vmail:vmail, and the user has write 
access to those directories.


[root@tay var]# ls -al
total 96
drwxr-xr-x. 24 root   root   4096 Nov 29 09:36 .
dr-xr-xr-x. 23 root   root   4096 Nov 28 15:26 ..
drwxr-x---   5 amavis amavis 4096 Nov 29 09:21 amavis
drwxr-xr-x. 10 root   root   4096 Nov 28 15:14 cache
drwxr-xr-x.  2 clamav clamav 4096 Nov 29 03:49 clamav
drwxr-xr-x.  3 root   root   4096 Nov 28 14:21 db
drwxr-xr-x.  3 root   root   4096 Nov 28 13:35 empty
drwxr-xr-x.  2 root   root   4096 Sep 23  2011 games
drwx--   2 vmail  vmail  4096 Nov 29 10:42 indexes
drwxr-xr-x. 25 root   root   4096 Nov 28 15:15 lib
drwxr-xr-x.  2 root   root   4096 Sep 23  2011 local
drwxrwxr-x.  5 root   lock   4096 Nov 29 03:49 lock
drwxr-xr-x.  5 root   root   4096 Nov 29 04:10 log
lrwxrwxrwx.  1 root   root 10 Nov 28 13:34 mail -> spool/mail
drwxr-xr-x.  2 root   root   4096 Sep 23  2011 nis
drwxr-xr-x.  2 root   root   4096 Sep 23  2011 opt
drwxr-xr-x.  2 root   root   4096 Sep 23  2011 preserve
drwxr-xr-x. 20 root   root   4096 Nov 29 09:51 run
drwxr-xr-x.  9 root   root   4096 Nov 28 15:14 spool
drwxrwxrwt.  3 root   root   4096 Nov 29 09:22 tmp
drwxr-x---   2 amavis amavis 4096 Jun  8 15:39 virusmails
drwx--.  5 vmail  vmail  4096 Nov 29 09:35 vmail
drwx--.  3 root   bin4096 Nov 29 09:22 webmin
drwxr-xr-x. 12 root   root   4096 Nov 28 15:17 www
drwxr-xr-x.  2 root   root   4096 Sep 23  2011 yp


After restarting dovecot, and logging in via imap, I see the following 
under the Maildir:


[root@tay Maildir]# ls -al 
/var/vmail/vmail1/orphans.co.uk/m/a/t/matt-2011.07.06.09.41.05/Maildir
total 56
drwx-- 9 vmail vmail 4096 Nov 29 10:57 .
drwx-- 3 vmail vmail 4096 Nov 29 10:17 ..
drwx-- 2 vmail vmail 4096 Nov 29 10:41 cur
-rw--- 1 vmail vmail  248 Nov 29 10:41 dovecot.index.log
-rw--- 1 vmail vmail  120 Nov 29 10:41 dovecot.mailbox.log
-rw--- 1 vmail vmail   51 Nov 29 10:41 dovecot-uidlist
-rw--- 1 vmail vmail8 Nov 29 10:41 dovecot-uidvalidity
-r--r--r-- 1 vmail vmail0 Nov 29 10:41 dovecot-uidvalidity.50b73be3
drwx-- 5 vmail vmail 4096 Nov 29 10:41 .Drafts
drwx-- 5 vmail vmail 4096 Nov 29 10:41 .Junk
drwx-- 2 vmail vmail 4096 Nov 29 10:41 new
drwx-- 5 vmail vmail 4096 Nov 29 10:41 .Sent
-rw--- 1 vmail vmail   29 Nov 29 10:41 subscriptions
drwx-- 2 vmail vmail 4096 Nov 29 10:41 tmp
drwx-- 5 vmail vmail 4096 Nov 29 10:41 .Trash


[root@tay Maildir]# ls -al /var/indexes/
total 8
drwx--   2 vmail vmail 4096 Nov 29 10:42 .
drwxr-xr-x. 24 root  root  4096 Nov 29 09:36 ..


Any ideas?

Matt


[Dovecot] Maildir hardlinks with sieve

2012-11-29 Thread Benedetto Vassallo

Hi all,
First of all, excuse me for my previous posts (Maildir hardlinks).
Today I realized the following issue.
Maildir hardlinks works OK on dovecot 2.1.10 without sieve.
If set sieve plugin in dovecot-lmtp hardlinks stop working.
Is there a way to have both sieve and hardlinks working?
Thank you
--
Benedetto Vassallo
Sistema Informativo di Ateneo
Settore Gestione Reti Hardware e Software
U.O.B. Sviluppo e manutenzione dei sistemi
Università degli studi di Palermo

Phone: +3909123860056
Fax: +390916529124

-
This message was sent using the University of Palermo web mail interface.



Re: [Dovecot] Problem with mail_location and INDEX location

2012-11-29 Thread Charles Marcus

On 2012-11-29 6:02 AM, Matt Jones  wrote:

The relevant config I'm using:


mmap_disable = no 


Please only/always post full output of doveconf -n, not copy/pastes from 
the config file... this is the only way to be sure that you are using 
the config you *think* you are using...


--

Best regards,

Charles



Re: [Dovecot] Missing Messages on IOS device

2012-11-29 Thread David Morsberger
I checked again and I did not see any log entries on the server or client. Not 
sure how to debug iPhone/iPad.

I'm sure this isn't a bug in dovecot per se because the behavior is different 
on the different client types. I was just wondering if someone else has seen 
similar behavior before and worked through it.

Thanks,
David

On Nov 28, 2012, at 12:49 AM, Stan Hoeppner  wrote:

> On 11/27/2012 9:21 PM, David Morsberger wrote:
>> Resending because I didn't get any responses from my first post:
>> 
>> I just converted my old server running UW/Panda to a Mac Mini Server running 
>> Mountain Lion (ML) Server. I'm using the postfix / dovecot setup provided by 
>> Apple.
>> 
>> My IMAP clients are not showing all my emails. The Mail App on my iPhone and 
>> iPad is behaving the worse. I can see the emails that are not showing up in 
>> the cur directory.
>> 
>> The ML Mail App is stating there are 3854 emails in my INBOX. There are 3948 
>> files in the 'cur' directory ('ls cur | wc -l' returns 3948). Other 
>> mailboxes and directories have the same behavior. I'm not sure what to 
>> expect here.
>> 
>> My method of conversion was to bulk copy (drag and drop) all the messages 
>> from one the UW server to the Dovecot server using the Apple Desktop Mail 
>> App in Mountain Lion. 
>> 
>> Any idea why these messages are not showing up on my devices and how I can 
>> get them to show up?
> 
> Not really.  Problem reports are typically accompanied by errors in log
> files.  You've provided none.  You've provided only subjective
> observation which is rarely useful in troubleshooting.  If you provide
> some Dovecot logging related to the problem we may be able to help.
> Short of that we can only make wild ass guesses.
> 
> Are your clients subscribing all IMAP folders?  Are your clients
> checking all folders for new mail?
> 
> -- 
> Stan
> 



Re: [Dovecot] Dovecot director doveadm with switch "-A" error

2012-11-29 Thread Ramon Frontera
Hi,

we have installed dovecot version 2.1.11


Now we have found 3 problems with doveadm on proxy server:

1 problem:
In our configuration we have:
protocol doveadm {
auth_socket_path = director-userdb
}
 
I have executed this:
# doveconf -m doveadm -f service=doveadm auth_socket_path
auth_socket_path = director-userdb

Now when We execute doveadm quota get -A
we have this error: 
doveadm(user1): Error: /var/run/dovecot//auth-userdb: Proxy is missing 
destination host (maybe set auth_socket_path=director-userdb)
doveadm: Error: Failed to iterate through some users

with "-o auth_socket_path=director-userdb " it works for the early users.


2 problem
when we execute doveadm -o auth_socket_path=director-userdb quota get -A it 
works for the early users and then return this error on proxy:

doveadm(userabc): Fatal: table formatter doesn't support multi-line values


3 problem
I have tested other doveadm command on proxy wich also fails:

# doveadm -o auth_socket_path=director-userdb  search -u user  mailbox Trash 
savedbefore 1d

on proxy we have this error: " doveadm(user): Error: xx.xx.xx.xx:24245: 
Internal failure for user"
on mailserver we have this error: "doveadm: Fatal: master: service(doveadm): 
child 22171 killed with signal 11 (core dumps disabled)"

I put the gdm bt output hope it help you. (mailserver)

Core was generated by `dovecot/doveadm-server'.
Program terminated with signal 11, Segmentation fault.
#0  auth_master_user_list_next (ctx=0x0) at auth-master.c:680
680 auth-master.c: No such file or directory.
in auth-master.c
Missing separate debuginfos, use: debuginfo-install 
dovecot-2.1.11-1_136.el6.x86_64
(gdb) bt full
#0  auth_master_user_list_next (ctx=0x0) at auth-master.c:680
No locals.
#1  0x7f2dfe414f23 in mail_storage_service_all_next (ctx=0xf92900, 
username_r=0x7fff4306cab8) at mail-storage-service.c:1215
__FUNCTION__ = "mail_storage_service_all_next"
#2  0x7f2dfd0b0ed2 in doveadm_expire_mail_init (ctx=0xf89020)
at doveadm-expire.c:420
ectx = 0xf89198
dict = 0xf93110
query = 
expire_dict = 
username = 0x0
value = 
username_dup = 
#3  0x0040aa1a in doveadm_mail_single_user ()
No symbol table info available.
#4  0x004121b9 in client_connection_input ()
No symbol table info available.
#5  0x7f2dfe14f2c6 in io_loop_call_io (io=0xf8e7a0) at ioloop.c:379
ioloop = 0xf84690
t_id = 2
#6  0x7f2dfe1502ef in io_loop_handler_run (ioloop=)
at ioloop-epoll.c:213
---Type  to continue, or q  to quit--- 
ctx = 0xf874c0
events = 
event = 0xf87530
list = 0xf8e7f0
io = 
tv = {tv_sec = 2147483, tv_usec = 0}
msecs = 
ret = 1
i = 
call = 
#7  0x7f2dfe14f268 in io_loop_run (ioloop=0xf84690) at ioloop.c:398
No locals.
#8  0x7f2dfe13ac73 in master_service_run (service=0xf84540, 
callback=) at master-service.c:544
No locals.
#9  0x004128f1 in main ()
No symbol table info available.

Thanks in advance

--
--
  Ramon Frontera Gallardo
  Universitat de les Illes Balears





El 28/11/2012, a las 23:45, Timo Sirainen escribió:

> On 28.11.2012, at 16.50, Ramon Frontera wrote:
> 
>> Dovecot -n show the correct configuration like you explain.
>> The command doveadm -o auth_socket_path=director-userdb quota get -A works 
>> fine on the proxy and now assigns host.
> 
> Then doveadm isn't seeing the same configuration as what you're looking at. 
> For example did you restart dovecot since the change? Does this return the 
> correct path? :
> 
> doveconf -m doveadm -f service=doveadm auth_socket_path
> 
>> Now, the problem is that when we execute doveadm -A or doveadm -u 
>> *something* the command fails in the mailserver with this error:
>> 
>> dovecot: doveadm: Fatal: master: service(doveadm): child 13482 killed with 
>> signal 11 (core dumps disabled)
> 
> I fixed several bugs related to this in hg. I think you hit one of them.
> 
>> This errors occurs when the search finds more than one user.
>> When we execute doveadm -u user it works fine
>> 
>> 
>> I send attached the strace of the mailserver
> 
> strace isn't very useful in debugging crashes. gdb backtraces are: 
> http://dovecot.org/bugreport.html
> 



[Dovecot] cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory && ./configure: line 11410: -lssl: command not found

2012-11-29 Thread Tobias Hachmer
Hello Timo,

Building 2.1.11 was ok, but rebuilding pigeonhole 0.3.3 for dovecot 2.1.11 
show up the following errors:

checking for dovecot-config in "/usr/lib/dovecot"... /usr/lib/dovecot/dovecot-
config
./configure: line 11410: -lssl: command not found
checking whether OS supports plugin dependencies... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating doc/man/Makefile
config.status: creating doc/example-config/Makefile
config.status: creating doc/example-config/conf.d/Makefile
config.status: creating doc/rfc/Makefile
config.status: creating src/Makefile
config.status: creating src/lib-sieve/Makefile
config.status: creating src/lib-sieve/plugins/Makefile
config.status: creating src/lib-sieve/plugins/vacation/Makefile
config.status: creating src/lib-sieve/plugins/subaddress/Makefile
config.status: creating src/lib-sieve/plugins/comparator-i-ascii-
numeric/Makefile
config.status: creating src/lib-sieve/plugins/relational/Makefile
config.status: creating src/lib-sieve/plugins/regex/Makefile
config.status: creating src/lib-sieve/plugins/imap4flags/Makefile
config.status: creating src/lib-sieve/plugins/copy/Makefile
config.status: creating src/lib-sieve/plugins/include/Makefile
config.status: creating src/lib-sieve/plugins/body/Makefile
config.status: creating src/lib-sieve/plugins/variables/Makefile
config.status: creating src/lib-sieve/plugins/enotify/Makefile
config.status: creating src/lib-sieve/plugins/enotify/mailto/Makefile
config.status: creating src/lib-sieve/plugins/notify/Makefile
config.status: creating src/lib-sieve/plugins/environment/Makefile
config.status: creating src/lib-sieve/plugins/mailbox/Makefile
config.status: creating src/lib-sieve/plugins/date/Makefile
config.status: creating src/lib-sieve/plugins/spamvirustest/Makefile
config.status: creating src/lib-sieve/plugins/ihave/Makefile
config.status: creating src/lib-sieve/plugins/editheader/Makefile
config.status: creating src/lib-sieve/plugins/vnd.dovecot/Makefile
config.status: creating src/lib-sieve/plugins/vnd.dovecot/debug/Makefile
config.status: creating src/lib-sieve/plugins/vnd.dovecot/duplicate/Makefile
config.status: creating src/lib-sieve-tool/Makefile
config.status: creating src/lib-sievestorage/Makefile
config.status: creating src/lib-managesieve/Makefile
config.status: creating src/plugins/Makefile
config.status: creating src/plugins/lda-sieve/Makefile
config.status: creating src/sieve-tools/Makefile
config.status: creating src/managesieve/Makefile
config.status: creating src/managesieve-login/Makefile
config.status: creating src/testsuite/Makefile
config.status: creating stamp.h
config.status: creating dummy-config.h
config.status: creating pigeonhole-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
dh_testdir
# Add here commands to compile the package.
/usr/bin/make
make[1]: Entering directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3'
/usr/bin/make  all-recursive
make[2]: Entering directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3'
Making all in src
make[3]: Entering directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3/src'
Making all in lib-sieve
make[4]: Entering directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3/src/lib-sieve'
Making all in plugins
make[5]: Entering directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3/src/lib-sieve/plugins'
Making all in vacation
make[6]: Entering directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3/src/lib-sieve/plugins/vacation'
/bin/bash ../../../../libtool --tag=CC   --mode=compile x86_64-linux-gnu-gcc -
DHAVE_CONFIG_H -I. -I../../../..  -I./../../  -D_FORTIFY_SOURCE=2  -std=gnu99 
-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -
Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-
subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime -Wstrict-
aliasing=2  -MT cmd-vacation.lo -MD -MP -MF .deps/cmd-vacation.Tpo -c -o cmd-
vacation.lo cmd-vacation.c
libtool: compile:  x86_64-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../../.. -
I./../../ -D_FORTIFY_SOURCE=2 -std=gnu99 -g -O2 -fstack-protector --param=ssp-
buffer-size=4 -Wformat -Wformat-security -Wall -W -Wmissing-prototypes -
Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-
function-cast -fno-builtin-strftime -Wstrict-aliasing=2 -MT cmd-vacation.lo -
MD -MP -MF .deps/cmd-vacation.Tpo -c cmd-vacation.c  -fPIC -DPIC -o .libs/cmd-
vacation.o
cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory
compilation terminated.
make[6]: *** [cmd-vacation.lo] Error 1
make[6]: Leaving directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3/src/lib-sieve/plugins/vacation'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/tobias/pighole_test/dovecot-2.1-
pigeonhole-0.3.3/src/lib-sieve/plugins'
make[4]: *** 

Re: [Dovecot] cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory && ./configure: line 11410: -lssl: command not found

2012-11-29 Thread Gilles Chauvin
On 29/11/2012 15:57, Tobias Hachmer wrote:> Hello Timo,
>
> Building 2.1.11 was ok, but rebuilding pigeonhole 0.3.3 for dovecot
2.1.11
> show up the following errors:
>
> [...]
>

Hi,

Just have a look at:
http://www.dovecot.org/list/dovecot/2012-November/069722.html ;).



Regards,
Gilles.--
=
Gilles CHAUVIN
Pôle Système
Direction des Systèmes d'information et de l'Informatique
Université de Rouen
Bâtiment 16 - IRESE-B
Place Émile Blondel
76821 MONT-SAINT-AIGNAN CEDEX
→ http://goo.gl/cYgtX

Tél: +33 (0)2 35 14 82 92
Fax: +33 (0)2 35 14 64 64
Mail fonc: syst...@univ-rouen.fr
Mail pers: gilles.chau...@univ-rouen.fr
=


Re: [Dovecot] cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory && ./configure: line 11410: -lssl: command not found

2012-11-29 Thread Tobias Hachmer
On Thursday 29 November 2012 16:09:35 Gilles Chauvin wrote:
> Just have a look at:
> http://www.dovecot.org/list/dovecot/2012-November/069722.html ;).

Yeah, I saw your post. But Timo asked for another possible errors. I don't 
know if this error belongs to your error:

cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory 

That's why I posted this.

Greetz,
Tobias Hachmer


Re: [Dovecot] cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory && ./configure: line 11410: -lssl: command not found

2012-11-29 Thread Gilles Chauvin
On 29/11/2012 16:14, Tobias Hachmer wrote:
> On Thursday 29 November 2012 16:09:35 Gilles Chauvin wrote:
>> Just have a look at:
>> http://www.dovecot.org/list/dovecot/2012-November/069722.html ;).
> 
> Yeah, I saw your post. But Timo asked for another possible errors. I don't 
> know if this error belongs to your error:
> 
> cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory 
> 
> That's why I posted this.
> 
> Greetz,
> Tobias Hachmer
> 

Tobias,

The post I linked above wasn't my post but I had the exact same problem
this morning while trying to compile pigeonhole against dovecot 2.1.11.
Manually adding the quotes in the dovecot-config file fixed the issue
for me.


Regards,
Gilles.


Re: [Dovecot] cmd-vacation.c:4:17: fatal error: lib.h: No such file or directory && ./configure: line 11410: -lssl: command not found

2012-11-29 Thread Tobias Hachmer
On Thursday 29 November 2012 16:18:14 Gilles Chauvin wrote:
> The post I linked above wasn't my post but I had the exact same problem
> this morning while trying to compile pigeonhole against dovecot 2.1.11.
> Manually adding the quotes in the dovecot-config file fixed the issue
> for me.

Oh, sorry, I will test, thanks!

Regards,
Tobias Hachmer


Re: [Dovecot] imap-login hanging when firewall blocks ssl handshaking

2012-11-29 Thread Erik A Johnson
No, the test to bug out doesn't work because net_geterror(proxy->fd_ssl) 
returns 0 in the statement

   if (!proxy->client_proxy &&
   net_geterror(proxy->fd_ssl) == ENOTCONN) {

However, errno is indeed ENOTCONN.  Changing the test to

   if (!proxy->client_proxy &&
   errno == ENOTCONN) {

does do the job (i.e., stopping the process with the "syscall failed" error 
message), though I'm sure I don't understand the ins and outs well enough to 
know if that is an appropriate test.  The full log line is:

Nov 29 07:39:14 SERVER dovecot[24362]: imap-login: Disconnected 
(disconnected before greeting, waited 0 secs): user=<>, rip=CLIENTIP, 
lip=SERVERIP, TLS handshaking: SSL_accept() syscall failed: Socket is not 
connected, session=

Thoughts?

On Nov 28, 2012, at 10:18PM PST, Timo Sirainen  wrote:
> This is either OSX bug or OpenSSL bug.. Apparently what happens is:
> 
> 1. Client sends SYN packet to Dovecot
> 2. Dovecot accept()s the connection (sends SYN-ACK) and goes into OpenSSL code
> 3. Client doesn't send ACK to Dovecot. Does it send RST or nothing or 
> something else? I don't know.
> 4. OSX notices anyway that something is wrong with the socket, and kqueue 
> says that the socket is ready for reading
> 5. OpenSSL read()s, which fails with ENOTCONN. But OpenSSL thinks this is a 
> non-fatal error and simply asks to be notified again when something can be 
> read
> 6. goto 4
> 
> So, whose bug is it? OpenSSL's ENOTCONN handling probably makes sense for 
> client connections where connect() hasn't finished yet. But then again, this 
> is accept()ed connection where it typically should fail like that. Except I 
> guess it might be correct behavior if read() is done after SYN-ACK but before 
> receiving ACK.
> 
> While OSX is receiving ACK from the client, it shouldn't say that the fd is 
> readable. It probably doesn't. But after it receives  it realizes 
> that the socket is disconnected. So read() probably shouldn't be returning 
> ENOTCONN anymore at this point, but instead ECONNRESET or ETIMEDOUT.
> 
> See if the attached patch helps.
> 
> 
> On 29.11.2012, at 7.45, Erik A Johnson wrote:
>> Here's the log:
>> 
>> Nov 28 21:28:11 macbookpro-e17d.home dovecot[54139]: master: Dovecot v2.1.10 
>> starting up (core dumps disabled)
>> Nov 28 21:30:19 macbookpro-e17d.home dovecot[54141]: imap-login: Debug: 
>> ssl_step()
>> Nov 28 21:30:19 macbookpro-e17d.home dovecot[54141]: imap-login: Debug: 
>> ssl_handshake: SSL_accept()=-1
>> Nov 28 21:30:19 macbookpro-e17d.home dovecot[54141]: imap-login: Debug: 
>> SSL_get_error() = 2
>> Nov 28 21:30:19 macbookpro-e17d.home dovecot[54141]: imap-login: Debug:  - 
>> want_read
>> Nov 28 21:30:19 macbookpro-e17d.home dovecot[54141]: imap-login: Debug: 
>> ssl_set_io(0)
>> [last 5 lines are repeated until process is killed]
>> 
>> On Nov 26, 2012, as 11:38PM PST, Timo Sirainen  wrote:
>>> 
>>> Could you try with the attached patch, and with only the problematic
>>> client running? What does it log (the beginning of the session until it
>>> starts repeating the same lines)?
>>> 
>>> On 10.11.2012, at 12.44, Erik A Johnson wrote:
 imap-login processes are hanging (using 100% of CPU) when connected from a 
 client that is partially blocked by a firewall.  It appears that 
 imap-login is stuck in a loop trying to complete an ssl handshake.  
 imap-login is working fine for other clients not blocked by the firewall 
 (including localhost).
 
 This is dovecot 2.1.10 under Mac OS X 10.8.2 (compiled from sources); the 
 firewall is Little Snitch 3.0.1 blocking port 993, which appears to let 
 the connection initiate but then squashes and disconnects the socket 
 during ssl handshaking.
 
 gdb backtrace and Activity Monitor's "Sample Process" show that imap-login 
 is stuck calling ioloop-kqueue's io_loop_handler_run -> io_loop_call_io -> 
 ssl_step repeatedly; dtruss shows that it is repeatedly making system 
 calls to kevent and read, the latter returning -1 with errno 
 57=ENOTCONN="Socket is not connected".  (I also tried ./configure 
 --with-ioloop=poll and --with-iopoll=select instead of the default best = 
 kqueue but the results were the same; --with-iopoll=epoll didn't work 
 because epoll is not available on this machine.)  The client, initiated by 
 the command "openssl s_client -connect SERVER:993", first responds 
 "CONNECTED(0003)" but then immediately the error 
 "60278:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake 
 failure:/SourceCache/OpenSSL098/OpenSSL098-44/src/ssl/s23_lib.c:182:".  
 The infinite loop is in src/lib/ioloop.c in the function "io_loop_run" 
 where the statement "while (ioloop->running) io_loop_handler_run(ioloop)" 
 is executed.
> 
> 


Re: [Dovecot] imap-login hanging when firewall blocks ssl handshaking

2012-11-29 Thread Timo Sirainen
On 29.11.2012, at 17.42, Erik A Johnson wrote:

> No, the test to bug out doesn't work because net_geterror(proxy->fd_ssl) 
> returns 0 in the statement
> 
>   if (!proxy->client_proxy &&
>   net_geterror(proxy->fd_ssl) == ENOTCONN) {
> 
> However, errno is indeed ENOTCONN.  Changing the test to
> 
>   if (!proxy->client_proxy &&
>   errno == ENOTCONN) {

This change isn't very reliable, since the previous call might not have been 
read().. I wonder if something like would work:

if (!proxy->client && read(proxy->fd_ssl, &err, 0) < 0 && errno == ENOTCONN) {




Re: [Dovecot] imap-login hanging when firewall blocks ssl handshaking

2012-11-29 Thread Ben Morrow
At 10PM +0200 on 29/11/12 Timo Sirainen wrote:
> On 29.11.2012, at 17.42, Erik A Johnson wrote:
> 
> > No, the test to bug out doesn't work because net_geterror(proxy->fd_ssl) 
> > returns 0 in the statement
> > 
> >   if (!proxy->client_proxy &&
> >   net_geterror(proxy->fd_ssl) == ENOTCONN) {
> > 
> > However, errno is indeed ENOTCONN.  Changing the test to
> > 
> >   if (!proxy->client_proxy &&
> >   errno == ENOTCONN) {
> 
> This change isn't very reliable, since the previous call might not
> have been read().. I wonder if something like would work:
> 
> if (!proxy->client && read(proxy->fd_ssl, &err, 0) < 0 && errno == ENOTCONN) {

How about calling getpeername on fd_ssl? That should reliably tell you
if the socket is connected or not. http://cr.yp.to/docs/connect.html
suggests that read is not always a reliable test for that.

Ben



Re: [Dovecot] imap-login hanging when firewall blocks ssl handshaking

2012-11-29 Thread Timo Sirainen
On 30.11.2012, at 0.12, Ben Morrow wrote:

>> This change isn't very reliable, since the previous call might not
>> have been read().. I wonder if something like would work:
>> 
>> if (!proxy->client && read(proxy->fd_ssl, &err, 0) < 0 && errno == ENOTCONN) 
>> {
> 
> How about calling getpeername on fd_ssl? That should reliably tell you
> if the socket is connected or not. http://cr.yp.to/docs/connect.html
> suggests that read is not always a reliable test for that.

Yes, that sounds like it would work better:

if (!proxy->client && net_getpeername(proxy->fd_ssl, NULL, NULL)  < 0 && errno 
== ENOTCONN) {



Re: [Dovecot] Dovecot director doveadm with switch "-A" error

2012-11-29 Thread Timo Sirainen
On 29.11.2012, at 16.22, Ramon Frontera wrote:

> Now we have found 3 problems with doveadm on proxy server:
> 
> 1 problem:
> In our configuration we have:
> protocol doveadm {
> auth_socket_path = director-userdb
> }
> 
> I have executed this:
> # doveconf -m doveadm -f service=doveadm auth_socket_path
> auth_socket_path = director-userdb
> 
> Now when We execute doveadm quota get -A
> we have this error: 
> doveadm(user1): Error: /var/run/dovecot//auth-userdb: Proxy is missing 
> destination host (maybe set auth_socket_path=director-userdb)
> doveadm: Error: Failed to iterate through some users
> 
> with "-o auth_socket_path=director-userdb " it works for the early users.

That's strange. I don't really have any ideas left how to debug it easily.

> 2 problem
> when we execute doveadm -o auth_socket_path=director-userdb quota get -A it 
> works for the early users and then return this error on proxy:
> 
> doveadm(userabc): Fatal: table formatter doesn't support multi-line values

Oh. Hmm. I see the problem.. I'll fix it later. For now you could change the 
formatter with doveadm -f tab or -f flow

> 3 problem
> I have tested other doveadm command on proxy wich also fails:
> 
> # doveadm -o auth_socket_path=director-userdb  search -u user  mailbox Trash 
> savedbefore 1d
> 
> on proxy we have this error: " doveadm(user): Error: xx.xx.xx.xx:24245: 
> Internal failure for user"
> on mailserver we have this error: "doveadm: Fatal: master: service(doveadm): 
> child 22171 killed with signal 11 (core dumps disabled)"
> 
> I put the gdm bt output hope it help you. (mailserver)
> 
> #0  auth_master_user_list_next (ctx=0x0) at auth-master.c:680
> No locals.
> #1  0x7f2dfe414f23 in mail_storage_service_all_next (ctx=0xf92900, 
>username_r=0x7fff4306cab8) at mail-storage-service.c:1215
>__FUNCTION__ = "mail_storage_service_all_next"
> #2  0x7f2dfd0b0ed2 in doveadm_expire_mail_init (ctx=0xf89020)
>at doveadm-expire.c:420

This should fix it: http://hg.dovecot.org/dovecot-2.1/rev/75dc4cb4bfe0



Re: [Dovecot] Tcpflow capture

2012-11-29 Thread Daniel L. Miller

On 11/29/2012 12:49 PM, Timo Sirainen wrote:

On 29.11.2012, at 18.06, Daniel L. Miller wrote:


On 11/28/2012 10:37 PM, Timo Sirainen wrote:

On 29.11.2012, at 7.47, Daniel L. Miller wrote:


doveadm fetch text -u amil...@amfes.com mailbox-guid 
a47e4e264aa1c94cc3513bc41c5f uid 12891


The result of that, when adding a "> test", generates a 11 byte file.

Hexedit shows me that as:
74 65 78 74  3A 0A 1F 8B  08 0C 0A

Otherwise a simple 'less' give me:
text:
^_<8B>^H^L

Does this tell you anything?

First of all it tells me that you either have some very corrupted messages in 
your mailbox, or you have some compressed messages but without zlib plugin 
enabled.

10-mail.conf - mail_plugins = fts fts_solr acl
15-lda.conf - mail_plugins = $mail_plugins sieve
20-imap.conf - mail_plugins = $mail_plugins zlib imap_acl
20-lmtp.conf - mail_plugins = $mail_plugins sieve

OK, so all of the compressed mails will be indexed as garbage.


My intent was to be able to read zlib mails, but not write new ones.  I may 
change this to just have zlib in 10-mail and start writing compressed.  Unless 
this is/will cause corruption.

Enabling zlib plugin doesn't enable compression on writing. plugin { 
zlib_save=yes } is required for that.

I (hopefully) fixed my config - put 'zlib' into 10-mail.conf and removed 
it from the others.  Re-indexing is now good on some mailboxes that were 
broken before - but I still have a fault on others.


--
Daniel


Re: [Dovecot] Tcpflow capture

2012-11-29 Thread Daniel L. Miller

On 11/29/2012 9:32 PM, Daniel L. Miller wrote:


I (hopefully) fixed my config - put 'zlib' into 10-mail.conf and 
removed it from the others.  Re-indexing is now good on some mailboxes 
that were broken before - but I still have a fault on others.


Using the tcpflow dump, I found a couple bad messages that I didn't care 
about storing - so I deleted them.  Then, after no change - I remembered 
to do a "compact" in my MUA.  That cleared up one mailbox - then dovecot 
complained about various errors & corruption on another mailbox.   So 
I'll start a new thread for that as it looks like the solr interface is 
now good!


--
Daniel


[Dovecot] mdbox corruption

2012-11-29 Thread Daniel L. Miller
Trying to clean up the last of the corruption caused by my own 
stupidity.  I now have two mailboxes for one user that give errors such as:


doveadm(f...@amfes.com): Error: 
zlib.read(/var/mail/amfes.com/fax/mdbox/storage/m.9): gz trailer has 
wrong CRC value at 20065618
doveadm(f...@amfes.com): Error: 
read(/var/mail/amfes.com/fax/mdbox/storage/m.9) failed: Invalid argument 
(uid=238)
doveadm(f...@amfes.com): Error: 
zlib.read(/var/mail/amfes.com/fax/mdbox/storage/m.9): corrupted data at 
20145217

[...]
doveadm(f...@amfes.com): Error: 
read(/var/mail/amfes.com/fax/mdbox/storage/m.20) failed: Invalid 
argument (uid=5155)
doveadm(f...@amfes.com): Error: 
zlib.read(/var/mail/amfes.com/fax/mdbox/storage/m.20): corrupted data at 
24779604
doveadm(f...@amfes.com): Error: Cached message size smaller than expected 
(1259 < 1260)
doveadm(f...@amfes.com): Error: Corrupted index cache file 
/var/mail/amfes.com/fax/mdbox/mailboxes/INBOX/2010/dbox-Mails/dovecot.index.cache: 
Broken physical size for mail UID 5158


'doveadm force-resync' does not appear to fix these.  There appear to be 
only the two mdbox files affected and I see about 40 errors. I would 
prefer to salvage as much as possible of these.  What options do I 
have?  Do a dsync to another location and take whatever I get?

--
Daniel


Re: [Dovecot] Tcpflow capture

2012-11-29 Thread Timo Sirainen
On 30.11.2012, at 7.57, Daniel L. Miller wrote:

> On 11/29/2012 9:32 PM, Daniel L. Miller wrote:
>> 
>> I (hopefully) fixed my config - put 'zlib' into 10-mail.conf and removed it 
>> from the others.  Re-indexing is now good on some mailboxes that were broken 
>> before - but I still have a fault on others.
>> 
> Using the tcpflow dump, I found a couple bad messages that I didn't care 
> about storing - so I deleted them.  Then, after no change - I remembered to 
> do a "compact" in my MUA.  That cleared up one mailbox - then dovecot 
> complained about various errors & corruption on another mailbox.   So I'll 
> start a new thread for that as it looks like the solr interface is now good!

Well, there is still bug somewhere if Dovecot can cause Solr to fail.. I just 
can't figure out how that could happen.



Re: [Dovecot] mdbox corruption

2012-11-29 Thread Timo Sirainen
On 30.11.2012, at 8.03, Daniel L. Miller wrote:

> Trying to clean up the last of the corruption caused by my own stupidity.  I 
> now have two mailboxes for one user that give errors such as:
> 
> doveadm(f...@amfes.com): Error: 
> zlib.read(/var/mail/amfes.com/fax/mdbox/storage/m.9): gz trailer has wrong 
> CRC value at 20065618
> doveadm(f...@amfes.com): Error: 
> read(/var/mail/amfes.com/fax/mdbox/storage/m.9) failed: Invalid argument 
> (uid=238)
> doveadm(f...@amfes.com): Error: 
> zlib.read(/var/mail/amfes.com/fax/mdbox/storage/m.9): corrupted data at 
> 20145217
> [...]
> doveadm(f...@amfes.com): Error: 
> read(/var/mail/amfes.com/fax/mdbox/storage/m.20) failed: Invalid argument 
> (uid=5155)
> doveadm(f...@amfes.com): Error: 
> zlib.read(/var/mail/amfes.com/fax/mdbox/storage/m.20): corrupted data at 
> 24779604
> doveadm(f...@amfes.com): Error: Cached message size smaller than expected 
> (1259 < 1260)
> doveadm(f...@amfes.com): Error: Corrupted index cache file 
> /var/mail/amfes.com/fax/mdbox/mailboxes/INBOX/2010/dbox-Mails/dovecot.index.cache:
>  Broken physical size for mail UID 5158
> 
> 'doveadm force-resync' does not appear to fix these.  There appear to be only 
> the two mdbox files affected and I see about 40 errors. I would prefer to 
> salvage as much as possible of these.  What options do I have?  Do a dsync to 
> another location and take whatever I get?

There are no tools to fix broken compressed mails. I guess if dsync doesn't 
stop in the middle that would work. If it does stop, you'd need to figure out 
which messages those are (with doveadm dump) and delete them.



Re: [Dovecot] Tcpflow capture

2012-11-29 Thread Daniel L. Miller

On 11/29/2012 10:09 PM, Timo Sirainen wrote:

On 30.11.2012, at 7.57, Daniel L. Miller wrote:


On 11/29/2012 9:32 PM, Daniel L. Miller wrote:

I (hopefully) fixed my config - put 'zlib' into 10-mail.conf and removed it 
from the others.  Re-indexing is now good on some mailboxes that were broken 
before - but I still have a fault on others.


Using the tcpflow dump, I found a couple bad messages that I didn't care about storing - so I 
deleted them.  Then, after no change - I remembered to do a "compact" in my MUA.  
That cleared up one mailbox - then dovecot complained about various errors & corruption 
on another mailbox.   So I'll start a new thread for that as it looks like the solr interface 
is now good!

Well, there is still bug somewhere if Dovecot can cause Solr to fail.. I just 
can't figure out how that could happen.

At this moment, after your last bugfix and my correct plugin config - 
Solr no longer crashes.  Dovecot complains about the corruption - but it 
never hits solr.


Now, I suppose I could break my config again to see if reading 
compressed mails without zlib enabled still outputs garbage to Solr...

--
Daniel


Re: [Dovecot] v2.1.11 released

2012-11-29 Thread Christian Felsing
Hi,

seems v2.1.11 has broken Pigeonhole 0.3.3

Christian

Am 29.11.2012 07:44, schrieb Timo Sirainen:
> http://dovecot.org/releases/2.1/dovecot-2.1.11.tar.gz
> http://dovecot.org/releases/2.1/dovecot-2.1.11.tar.gz.sig
> 
> * lmtp/lda: dovecot.index.cache file is no longer fully mapped to
>   memory, allowing mail deliveries to work even if the file is huge.
> * auth: userdb passwd lookups are now done by auth worker processes
>   instead of auth master process (as it was documented, but
>   accidentally didn't work that way).
> 
> + lmtp: lmtp_rcpt_check_quota=yes setting checks quota on RCPT TO.
> - lmtp: After successful proxying RCPT TO, the next one to a
>   nonexistent user gave tempfail error instead of "user not found".
> - lmtp proxy: Fixed hanging if remote server was down.
> - imap: Fixed crash when SEARCH contained multiple KEYWORD parameters.
> - doveadm: Various fixes to handling doveadm-server connections.
> - -i  parameter for Dovecot tools didn't work 
> correctly.
> - director was somewhat broken in v2.1.10. This version also includes
>   various reliability enhancements.
> - auth: passdb imap was broken in v2.1.10.
> 
> 
> 



[Dovecot] v2.1.12 released

2012-11-29 Thread Timo Sirainen
http://dovecot.org/releases/2.1/dovecot-2.1.12.tar.gz
http://dovecot.org/releases/2.1/dovecot-2.1.12.tar.gz.sig

The dovecot-config file installed by v2.1.11 was missing quotes, which
broke building Pigeonhole. This release fixes that.