[Dovecot] Dovecot 2.0.5 and BSDI 4.3 again
Right,
Changes made to dovecot-2.0.5/src/lib-master/master-service.c
conn.listen_fd = l->fd;
conn.fd = net_accept(l->fd, &conn.remote_ip, &conn.remote_port);
i_error("conn.fd: %d",conn.fd);
i_error("l->fd: %d",l->fd);
i_error("&conn.remote_ip: %d",&conn.remote_ip);
i_error("&conn.remote_port: %d",&conn.remote_port);
if (conn.fd < 0) {
struct stat st;
int orig_errno = errno;
if (conn.fd == -1)
return;
if (errno == ENOTSOCK) {
/* it's not a socket. should be a fifo. */
} else if (errno == EINVAL &&
(fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) {
/* BSDI fails accept(fifo) with EINVAL. */
} else {
errno = orig_errno;
i_error("net_accept() failed: %m");
master_service_error(service);
return;
}
/* use the "listener" as the connection fd and stop the
listener. */
conn.fd = l->fd;
conn.listen_fd = l->fd;
conn.fifo = TRUE;
io_remove(&l->io);
l->fd = -1;
}
conn.ssl = l->ssl;
net_set_nonblock(conn.fd, TRUE);
to generate below log for debugging.
Oct 10 16:30:45 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps d isabled) Oct 10 16:30:45 doctor dovecot: log: Error: l->fd: 20 Oct 10 16:30:45 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 10 16:30:45 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 10 16:30:45 doctor dovecot: log: Error: net_accept() failed: Invalid argumen t Oct 10 16:30:45 doctor dovecot: master: Error: service(imap-login): command star tup failed, throttling Oct 10 16:30:46 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling Oct 10 16:31:46 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling Oct 10 16:32:47 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling Oct 10 16:33:44 doctor dovecot: master: Error: service(imap-login): command star tup failed, throttling Oct 10 16:33:47 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling
Oct 10 16:50:21 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps d isabled) Oct 10 16:50:21 doctor dovecot: log: Error: conn.fd: -2 Oct 10 16:50:21 doctor dovecot: log: Error: l->fd: 20 Oct 10 16:50:21 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 10 16:50:21 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 10 16:50:21 doctor dovecot: log: Error: net_accept() failed: Invalid argumen t Oct 10 16:50:21 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling Oct 10 16:50:21 doctor dovecot: master: Error: service(imap-login): command star tup failed, throttling Oct 10 16:50:52 doctor dovecot: master: Error: service(anvil): Initial status no tification not received in 30 seconds, killing the process Oct 10 16:50:52 doctor dovecot: master: Error: service(anvil): child 7962 killed with signal 9 Oct 10 16:50:52 doctor dovecot: master: Error: service(anvil): command startup f ailed, throttling Oct 10 16:51:21 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling Oct 10 16:51:22 doctor dovecot: master: Error: service(imap-login): command star tup failed, throttling Oct 10 16:52:22 doctor dovecot: master: Error: service(pop3-login): command star tup failed, throttling
Configuration being used
# 2.0.0: dovecot.conf
# OS: BSD/OS 4.3 i386
auth_cache_negative_ttl = 3600 s
base_dir = /var/run/dovecot/
disable_plaintext_auth = no
first_valid_uid = 100
listen = *
##listen = 204.209.81.1
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
mail_debug=yes
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_log_prefix = %Us(%u):
mdbox_rotate_size = 2048
passdb {
args = /etc/master.passwd
driver = passwd-file
}
protocols = imap pop3
service auth {
executable = /usr/dovecot2/libexec/dovecot/auth postlogin
user = root
vsz_limit = 256
}
service imap-login {
chroot = login
client_limit = 256
executable = /usr/dovecot2/libexec/dovecot/imap-login postlogin
inet_listener imaps {
address = 204.209.81.1
}
process_limit = 128
process_min_avail = 3
service_count = 1
user = dovecot
vsz_limit = 64
}
service imap {
executable = /usr/dovecot2/libexec/dovecot/imap postlogin
process_limit = 512
vsz_limit = 256
}
service pop3-login {
chroot = login
client_limit = 256
executable = /usr/dovecot2/libexec/dovecot/pop3-login postlogin
inet_listener pop3s {
address = 204.209.81.1
}
process_limit = 128
process_min_avail = 3
service_count = 1
user = dovecot
vsz_limit = 64
}
service pop3 {
executable = /usr/dovecot2/libexec/dovecot/pop3 postlogin
process_limit = 512
vsz_limit = 256
}
ssl_cert = /etc/ssl/certs/dovecot.pem
ssl_cipher_list = ALL:!LOW:!SSLv2
ssl_key = /etc/ssl/private/dovecot.pem
userdb {
driver = passwd
}
userdb {
args = /etc/passwd
driver = passwd-file
}
protocol imap {
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
imap_idle_notify_interval = 120 s
imap_logout_format = bytes=%i/%o
imap_max_line_length = 65536
mail_max_userip_connections = 10
mail_plugin_dir = /usr/dovecot2/lib/dovecot/imap
}
protocol pop3 {
mail_max_userip_connections = 3
mail_plugin_dir = /usr/dovecot2/lib/dovecot/pop3
pop3_enable_last = no
pop3_lock_session = no
pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
pop3_no_flag_updates = no
pop3_reuse_xuidl = no
pop3_save_uidl = no
pop3_uidl_format = %08Xu%08Xv
}
plugin {
home=/usr/dovecot2
}
service postlogin {
executable = /usr/dovecot2/libexec/dovecot/script-login /usr/dovecot2/libexec/dovecot/rawlog
unix_listener postlogin {
}
}
Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
On Sun, 2010-10-10 at 17:02 -0600, The Doctor wrote:
Oct 10 16:30:45 doctor dovecot: log: Error: net_accept() failed: Invalid argument
So my check below doesn't work. Add here:
if (errno != EINVAL) i_error("errno = %d %m"); else if (fstat(l->fd, &st) < 0) i_error("fstat() failed: %m"); else i_error("mode=%o & fifo = %d", st.st_mode, S_ISFIFO(st.st_mode)); fd_debug_verify_leaks(l->fd, l->fd); // should show what it is if it's not a fifo..
if (errno == ENOTSOCK) { /* it's not a socket. should be a fifo. */ } else if (errno == EINVAL && (fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) { /* BSDI fails accept(fifo) with EINVAL. */
On Thu, Oct 14, 2010 at 04:45:00PM +0100, Timo Sirainen wrote:
On Sun, 2010-10-10 at 17:02 -0600, The Doctor wrote:
Oct 10 16:30:45 doctor dovecot: log: Error: net_accept() failed: Invalid argument
So my check below doesn't work. Add here:
if (errno != EINVAL) i_error("errno = %d %m"); else if (fstat(l->fd, &st) < 0) i_error("fstat() failed: %m"); else i_error("mode=%o & fifo = %d", st.st_mode, S_ISFIFO(st.st_mode)); fd_debug_verify_leaks(l->fd, l->fd); // should show what it is if it's not a fifo..
if (errno == ENOTSOCK) { /* it's not a socket. should be a fifo. */ } else if (errno == EINVAL && (fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) { /* BSDI fails accept(fifo) with EINVAL. */
Log reveals
Oct 14 22:38:49 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps disabled) Oct 14 22:38:49 doctor dovecot: log: Error: conn.fd: -2 Oct 14 22:38:49 doctor dovecot: log: Error: l->fd: 20 Oct 14 22:38:49 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 14 22:38:49 doctor dovecot: master: Error: service(anvil): child 7645 killed with signal 6 (core dumps disabled) Oct 14 22:38:49 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 14 22:38:49 doctor dovecot: log: Error: mode=140000 & fifo = 1 Oct 14 22:38:49 doctor dovecot: master: Error: service(anvil): command startup failed, throttling Oct 14 22:38:49 doctor dovecot: log: Panic: Leaked socket fd 20: (null):0 -> (null):0 Oct 14 22:38:49 doctor dovecot: master: Error: service(log): child 7646 killed with signal 6 (core dumps disabled) Oct 14 22:38:49 doctor dovecot: master: Error: service(log): command startup failed, throttling Oct 14 22:38:49 doctor dovecot: master: Error: service(imap-login): command startup failed, throttling Oct 14 22:38:49 doctor dovecot: master: Error: service(pop3-login): command startup failed, throttling
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
On Thu, 2010-10-14 at 22:43 -0600, The Doctor wrote:
} else if (errno == EINVAL && (fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) { /* BSDI fails accept(fifo) with EINVAL. */
Oh, the checks in this code were just wrong. http://hg.dovecot.org/dovecot-2.0/rev/3385e9028410 should finally fix that.
On Fri, Oct 15, 2010 at 04:17:25PM +0100, Timo Sirainen wrote:
On Thu, 2010-10-14 at 22:43 -0600, The Doctor wrote:
} else if (errno == EINVAL && (fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) { /* BSDI fails accept(fifo) with EINVAL. */
Oh, the checks in this code were just wrong. http://hg.dovecot.org/dovecot-2.0/rev/3385e9028410 should finally fix that.
Can you send me a diff file and I can try this out.
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
On Fri, Oct 15, 2010 at 10:19:37AM -0600, The Doctor wrote:
On Fri, Oct 15, 2010 at 04:17:25PM +0100, Timo Sirainen wrote:
On Thu, 2010-10-14 at 22:43 -0600, The Doctor wrote:
} else if (errno == EINVAL && (fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) { /* BSDI fails accept(fifo) with EINVAL. */
Oh, the checks in this code were just wrong. http://hg.dovecot.org/dovecot-2.0/rev/3385e9028410 should finally fix that.
Can you send me a diff file and I can try this out.
Never mind, just typed the link in
and make the change.
I will test later.
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
On Fri, Oct 15, 2010 at 10:34:10AM -0600, The Doctor wrote:
On Fri, Oct 15, 2010 at 10:19:37AM -0600, The Doctor wrote:
On Fri, Oct 15, 2010 at 04:17:25PM +0100, Timo Sirainen wrote:
On Thu, 2010-10-14 at 22:43 -0600, The Doctor wrote:
} else if (errno == EINVAL && (fstat(l->fd, &st) < 0 || !S_ISFIFO(st.st_mode))) { /* BSDI fails accept(fifo) with EINVAL. */
Oh, the checks in this code were just wrong. http://hg.dovecot.org/dovecot-2.0/rev/3385e9028410 should finally fix that.
Can you send me a diff file and I can try this out.
Never mind, just typed the link in
and make the change.
I will test later.
The logs still show
Oct 15 20:36:24 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps disabled) Oct 15 20:36:24 doctor dovecot: log: Error: conn.fd: -2 Oct 15 20:36:24 doctor dovecot: log: Error: l->fd: 20 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 15 20:36:24 doctor dovecot: log: Error: mode=140000 & fifo = 1 Oct 15 20:36:24 doctor dovecot: log: Panic: Leaked socket fd 20: (null):0 -> (null):0 Oct 15 20:36:24 doctor dovecot: master: Error: service(log): child 24779 killed with signal 6 (core dumps disabled) Oct 15 20:36:24 doctor dovecot: master: Error: service(log): command startup failed, throttling Oct 15 20:36:24 doctor dovecot: master: Error: service(anvil): child 24778 killed with signal 6 (core dumps disabled) Oct 15 20:36:24 doctor dovecot: master: Error: service(anvil): command startup failed, throttling Oct 15 20:36:25 doctor dovecot: master: Error: service(imap-login): command startup failed, throttling Oct 15 20:36:25 doctor dovecot: master: Error: service(pop3-login): command startup failed, throttling
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
On 16.10.2010, at 3.41, The Doctor wrote:
The logs still show
Oct 15 20:36:24 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps disabled) Oct 15 20:36:24 doctor dovecot: log: Error: conn.fd: -2 Oct 15 20:36:24 doctor dovecot: log: Error: l->fd: 20 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 15 20:36:24 doctor dovecot: log: Error: mode=140000 & fifo = 1 Oct 15 20:36:24 doctor dovecot: log: Panic: Leaked socket fd 20: (null):0 -> (null):0
Remove the fd_verify_leaks function call, because it always panics here.
On Sat, Oct 16, 2010 at 11:43:05AM +0100, Timo Sirainen wrote:
On 16.10.2010, at 3.41, The Doctor wrote:
The logs still show
Oct 15 20:36:24 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps disabled) Oct 15 20:36:24 doctor dovecot: log: Error: conn.fd: -2 Oct 15 20:36:24 doctor dovecot: log: Error: l->fd: 20 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 15 20:36:24 doctor dovecot: log: Error: mode=140000 & fifo = 1 Oct 15 20:36:24 doctor dovecot: log: Panic: Leaked socket fd 20: (null):0 -> (null):0
Remove the fd_verify_leaks function call, because it always panics here.
That works, but now the login is not working.
Let me remove postlogin and see if the problem persists.
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
On Sat, Oct 16, 2010 at 6:21 PM, The Doctor doctor@doctor.nl2k.ab.cawrote:
On Sat, Oct 16, 2010 at 11:43:05AM +0100, Timo Sirainen wrote:
On 16.10.2010, at 3.41, The Doctor wrote:
The logs still show
Oct 15 20:36:24 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps disabled) Oct 15 20:36:24 doctor dovecot: log: Error: conn.fd: -2 Oct 15 20:36:24 doctor dovecot: log: Error: l->fd: 20 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 15 20:36:24 doctor dovecot: log: Error: mode=140000 & fifo = 1 Oct 15 20:36:24 doctor dovecot: log: Panic: Leaked socket fd 20: (null):0 -> (null):0
Remove the fd_verify_leaks function call, because it always panics here.
That works, but now the login is not working.
Let me remove postlogin and see if the problem persists.
TheDoctor, why must you run BSDI? :-)
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223
Damn!!
On Sat, Oct 16, 2010 at 11:43:05AM +0100, Timo Sirainen wrote:
On 16.10.2010, at 3.41, The Doctor wrote:
The logs still show
Oct 15 20:36:24 doctor dovecot: master: Dovecot v2.0.5 starting up (core dumps disabled) Oct 15 20:36:24 doctor dovecot: log: Error: conn.fd: -2 Oct 15 20:36:24 doctor dovecot: log: Error: l->fd: 20 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_ip: 134511880 Oct 15 20:36:24 doctor dovecot: log: Error: &conn.remote_port: 134511900 Oct 15 20:36:24 doctor dovecot: log: Error: mode=140000 & fifo = 1 Oct 15 20:36:24 doctor dovecot: log: Panic: Leaked socket fd 20: (null):0 -> (null):0
Remove the fd_verify_leaks function call, because it always panics here.
All fixed,
I think the change to the BSDI code is confirmed.
Next I see from log
egrep POP3 /var/log/maillog | egrep dovecot | egrep popuser Oct 16 09:27:11 doctor dovecot: POP3(popusereys):Debug: Effective uid=2404, gid=100, home=/usr/home/popusereys Oct 16 09:27:11 doctor dovecot: POP3(popusereys):Debug: fs: root=/usr/home/popusereys/mail, index=, control=, inbox=/var/mail/popusereys Oct 16 09:27:11 doctor dovecot: POP3(popusereys):Debug: Namespace : Permission lookup failed from /usr/home/popusereys/mail Oct 16 09:27:11 doctor dovecot: POP3(popusereys):Debug: Namespace : Using permissions from /usr/home/popusereys/mail: mode=0700 gid=-1 Oct 16 09:27:11 doctor dovecot: POP3(popusereys):Error: user popusereys: Initialization failed: Initializing mail storage from mail_location setting failed: mkdir(/usr/home/popusereys/mail) failed: Permission denied (euid=2404(popusereys) egid=100(user) missing +w perm: /usr/home/popusereys, euid is not dir owner) Oct 16 09:27:11 doctor dovecot: POP3(popusereys):Error: Invalid user settings. Refer to server log for more information. Oct 16 09:28:09 doctor dovecot: POP3(popusereys):Debug: Effective uid=2404, gid=100, home=/usr/home/popusereys Oct 16 09:28:09 doctor dovecot: POP3(popusereys):Debug: fs: root=/usr/home/popusereys/mail, index=, control=, inbox=/var/mail/popusereys Oct 16 09:28:09 doctor dovecot: POP3(popusereys):Debug: Namespace : Permission lookup failed from /usr/home/popusereys/mail Oct 16 09:28:09 doctor dovecot: POP3(popusereys):Debug: Namespace : Using permissions from /usr/home/popusereys/mail: mode=0700 gid=-1 Oct 16 09:28:09 doctor dovecot: POP3(popusereys):Error: user popusereys: Initialization failed: Initializing mail storage from mail_location setting failed: mkdir(/usr/home/popusereys/mail) failed: Permission denied (euid=2404(popusereys) egid=100(user) missing +w perm: /usr/home/popusereys, euid is not dir owner) Oct 16 09:28:09 doctor dovecot: POP3(popusereys):Error: Invalid user settings. Refer to server log for more information.
Anything wrong here?
-- Member - Liberal International This is doctor@nl2k.ab.ca Ici doctor@nl2k.ab.ca God, Queen and country! Never Satan President Republic! Beware AntiChrist rising! http://twitter.com/rootnl2k http://www.facebook.com/dyadallee Are you a real human: http://www.cuttingedge.org/news/n1334.cfm
participants (4)
-
Charles Marcus
-
Odhiambo Washington
-
The Doctor
-
Timo Sirainen