Mailing List Archive

imap error
Hi All,

I just downloaded and installed
dbmail-2.0rc1.tgz with Jan 30th 2004 release date.

Compiled/Installed into LFS (linux from scratch) 5.0 system, with:
gcc 3.3.1
glibc 2.3.2
binutils 2.14
Exim 4.30
MySQL 4.0.17
iptables is accepting everything on port 143 and allowing everything out
on any port...

SMTP from Exim to dbmail seemed to work based on exim logs and manual
queries of the dbmail database in mysql. I see the text of the message
in the messageblks table...

dbmail.conf - IMAP section

[IMAP]
EFFECTIVE_USER=root
EFFECTIVE_GROUP=nogroup
BINDIP=*
PORT=143
NCHILDREN=50
MAXCONNECTS=10000
TIMEOUT=4000
RESOLVE_IP=yes
IMAP_BEFORE_SMTP=no
TRACE_LEVEL=5

Using another machine on the network, I make a IMAP client connection
with Red Hat 9.0 - Ximian Evolution 1.2.2[(1.2.2-5)]

Ximian reports the following error while trying to Receive:
Error while 'Scanning folders in "IMAP server build.kaskiles.org"':
Server unexpectedly disconnected: Operation now in progress

Back on the server, my mail.log file shows this long output that seems
to indicate the imap4d process getting a signal 11 right after executing
some sql to return the mailbox names for the user (same user I'm trying
to download mail for...).

Thanks, Kenneth

Here is the log dump:
Jan 31 23:24:35 build dbmail/imap4d[193]: PerformChildTask(): incoming
connection from [68.156.23.40 (fire.kaskiles.org)]
Jan 31 23:24:35 build dbmail/imap4d[193]: PerformChildTask(): client
info init complete, calling client handler
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
for PID 193
Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00000 CAPABILITY]
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
command capability...
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
command capability
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
for PID 193
Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00001 LOGIN myuser
mypasswd]
Jan 31 23:24:35 build dbmail/imap4d[193]: arg[0]: 'myuser'
Jan 31 23:24:35 build dbmail/imap4d[193]: arg[1]: 'mypasswd'
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
command login...
Jan 31 23:24:35 build dbmail/imap4d[193]: _ic_login(): trying to
validate user
Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
query [SELECT user_idnr, passwd, encryption_type FROM users WHERE userid
= 'myuser']
Jan 31 23:24:35 build dbmail/imap4d[193]: authsql.c,auth_validate:
validating using cleartext passwords
Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
query [UPDATE users SET last_login = '2004-01-31 23:24:35' WHERE
user_idnr = '1']
Jan 31 23:24:35 build dbmail/imap4d[193]: _ic_login(): user (id:1, name
myuser) tries login^M
Jan 31 23:24:35 build dbmail/imap4d[193]: _ic_login(): user (id 1, name
myuser) login accepted @ 2004-01-31 23:24:35^M
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
command login
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
for PID 193
Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00002 NAMESPACE]
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
command namespace...
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
command namespace
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
for PID 193
Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00003 LSUB "" "*"]
Jan 31 23:24:35 build dbmail/imap4d[193]: arg[0]: ''
Jan 31 23:24:35 build dbmail/imap4d[193]: arg[1]: '*'
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
command lsub...
Jan 31 23:24:35 build dbmail/imap4d[193]: ic_list(): build the pattern:
[^.*$]
Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
query [.SELECT mbx.name, mbx.mailbox_idnr, mbx.owner_idnr FROM mailboxes
mbx LEFT JOIN acl ON acl.mailbox_id = mbx.mailbox_idnr JOIN subscription
sub ON sub.user_id = '1' AND sub.mailbox_id = mbx.mailbox_idnr WHERE
mbx.owner_idnr = '1' OR (acl.user_id = '1' AND acl.lookup_flag = '1')
GROUP BY mbx.name,
mbx.mailbox_idnr, mbx.owner_idnr]
Jan 31 23:24:35 build dbmail/imap4d[193]: db.c,db_findmailbox_by_regex:
found [0] mailboxes
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
command lsub
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
for PID 193
Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00004 LIST ""
INBOX]
Jan 31 23:24:35 build dbmail/imap4d[193]: arg[0]: ''
Jan 31 23:24:35 build dbmail/imap4d[193]: arg[1]: 'INBOX'
Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
command list...
Jan 31 23:24:35 build dbmail/imap4d[193]: ic_list(): build the pattern:
[^INBOX$]
Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
query [.SELECT mbx.name, mbx.mailbox_idnr, mbx.owner_idnr FROM mailboxes
mbx LEFT JOIN acl ON mbx.mailbox_idnr = acl.mailbox_id WHERE
(acl.user_id = '1' AND acl.lookup_flag = '1') OR mbx.owner_idnr = '1']
Jan 31 23:24:35 build dbmail/imap4d[193]:
db.c,db_list_mailboxes_by_regex: comparing mailbox [INBOX] to regular
expression
Jan 31 23:24:35 build dbmail/imap4d[193]:
db.c,db_list_mailboxes_by_regex: regex match INBOX
Jan 31 23:24:35 build dbmail/imap4d[193]: db.c,db_findmailbox_by_regex:
found [1] mailboxes
Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
query [SELECT owner_idnr FROM mailboxes WHERE mailbox_idnr = '1']
Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
query [SELECT name FROM mailboxes WHERE mailbox_idnr
= '1']
Jan 31 23:24:35 build dbmail/imap4d[193]: ChildSighandler(): got signal
[11]
Jan 31 23:24:35 build dbmail/imap4d[193]: ChildSighandler(): cannot
ignore this. Terminating
Jan 31 23:24:35 build dbmail/imap4d[189]: ParentSigHandler(): got signal
[17]
Jan 31 23:24:35 build dbmail/imap4d[189]: StartServer(): child [193] has
exited
Jan 31 23:24:35 build dbmail/imap4d[189]: StartServer(): creating new
child
Jan 31 23:24:35 build dbmail/imap4d[344]: CreateChild(): signal handler
placed, going to perform task now
Jan 31 23:24:35 build dbmail/imap4d[344]: PerformChildTask(): waiting
for connection
Re: imap error [ In reply to ]
Hi,

After some looking through the code, I've found the error. In
db_getmailboxname() in db.c, there were some strncpy with a third
argument that was to big. strncpy then tries to fill the target string
with '\0's, which results in a segfault. Strange thing is, is does not
segfault on OpenBSD. I tried it on a Linux machine, and indeed, it
segfaulted :).

Anyway, the code is fixed, and it works. Kenneth, thanks for the useful
info. Nice to see a list of your software, the conf-file, the
circumstances of the crash and the trace file. This is how all
bug-reports should be :)

Ilja

Kenneth Skiles wrote:

> Hi All,
>
> <snip>
>
> Here is the log dump:
> Jan 31 23:24:35 build dbmail/imap4d[193]: PerformChildTask(): incoming
> connection from [68.156.23.40 (fire.kaskiles.org)]
> Jan 31 23:24:35 build dbmail/imap4d[193]: PerformChildTask(): client
> info init complete, calling client handler
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
> for PID 193
> Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00000 CAPABILITY]
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
> command capability...
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
> command capability
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
> for PID 193
> Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00001 LOGIN myuser
> mypasswd]
> Jan 31 23:24:35 build dbmail/imap4d[193]: arg[0]: 'myuser'
> Jan 31 23:24:35 build dbmail/imap4d[193]: arg[1]: 'mypasswd'
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
> command login...
> Jan 31 23:24:35 build dbmail/imap4d[193]: _ic_login(): trying to
> validate user
> Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
> query [SELECT user_idnr, passwd, encryption_type FROM users WHERE userid
> = 'myuser']
> Jan 31 23:24:35 build dbmail/imap4d[193]: authsql.c,auth_validate:
> validating using cleartext passwords
> Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
> query [.UPDATE users SET last_login = '2004-01-31 23:24:35' WHERE
> user_idnr = '1']
> Jan 31 23:24:35 build dbmail/imap4d[193]: _ic_login(): user (id:1, name
> myuser) tries login^M
> Jan 31 23:24:35 build dbmail/imap4d[193]: _ic_login(): user (id 1, name
> myuser) login accepted @ 2004-01-31 23:24:35^M
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
> command login
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
> for PID 193
> Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00002 NAMESPACE]
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
> command namespace...
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
> command namespace
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
> for PID 193
> Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00003 LSUB "" "*"]
> Jan 31 23:24:35 build dbmail/imap4d[193]: arg[0]: ''
> Jan 31 23:24:35 build dbmail/imap4d[193]: arg[1]: '*'
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
> command lsub...
> Jan 31 23:24:35 build dbmail/imap4d[193]: ic_list(): build the pattern:
> [^.*$]
> Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
> query [.SELECT mbx.name, mbx.mailbox_idnr, mbx.owner_idnr FROM mailboxes
> mbx LEFT JOIN acl ON acl.mailbox_id = mbx.mailbox_idnr JOIN subscription
> sub ON sub.user_id = '1' AND sub.mailbox_id = mbx.mailbox_idnr WHERE
> mbx.owner_idnr = '1' OR (acl.user_id = '1' AND acl.lookup_flag = '1')
> GROUP BY mbx.name,
> mbx.mailbox_idnr, mbx.owner_idnr]
> Jan 31 23:24:35 build dbmail/imap4d[193]: db.c,db_findmailbox_by_regex:
> found [0] mailboxes
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Finished
> command lsub
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): line read
> for PID 193
> Jan 31 23:24:35 build dbmail/imap4d[193]: COMMAND: [A00004 LIST ""
> INBOX]
> Jan 31 23:24:35 build dbmail/imap4d[193]: arg[0]: ''
> Jan 31 23:24:35 build dbmail/imap4d[193]: arg[1]: 'INBOX'
> Jan 31 23:24:35 build dbmail/imap4d[193]: IMAPClientHandler(): Executing
> command list...
> Jan 31 23:24:35 build dbmail/imap4d[193]: ic_list(): build the pattern:
> [^INBOX$]
> Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
> query [.SELECT mbx.name, mbx.mailbox_idnr, mbx.owner_idnr FROM mailboxes
> mbx LEFT JOIN acl ON mbx.mailbox_idnr = acl.mailbox_id WHERE
> (acl.user_id = '1' AND acl.lookup_flag = '1') OR mbx.owner_idnr = '1']
> Jan 31 23:24:35 build dbmail/imap4d[193]:
> db.c,db_list_mailboxes_by_regex: comparing mailbox [INBOX] to regular
> expression
> Jan 31 23:24:35 build dbmail/imap4d[193]:
> db.c,db_list_mailboxes_by_regex: regex match INBOX
> Jan 31 23:24:35 build dbmail/imap4d[193]: db.c,db_findmailbox_by_regex:
> found [1] mailboxes
> Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
> query [SELECT owner_idnr FROM mailboxes WHERE mailbox_idnr = '1']
> Jan 31 23:24:35 build dbmail/imap4d[193]: dbmysql.c,db_query: executing
> query [SELECT name FROM mailboxes WHERE mailbox_idnr
> = '1']
> Jan 31 23:24:35 build dbmail/imap4d[193]: ChildSighandler(): got signal
> [11]
> Jan 31 23:24:35 build dbmail/imap4d[193]: ChildSighandler(): cannot
> ignore this. Terminating
> Jan 31 23:24:35 build dbmail/imap4d[189]: ParentSigHandler(): got signal
> [17]
> Jan 31 23:24:35 build dbmail/imap4d[189]: StartServer(): child [193] has
> exited
> Jan 31 23:24:35 build dbmail/imap4d[189]: StartServer(): creating new
> child
> Jan 31 23:24:35 build dbmail/imap4d[344]: CreateChild(): signal handler
> placed, going to perform task now
> Jan 31 23:24:35 build dbmail/imap4d[344]: PerformChildTask(): waiting
> for connection
>
>
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev

--
IC&S
Stadhouderslaan 57
3583 JD Utrecht

PGP-key:
http://www.ic-s.nl/keys/ilja.txt