bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] Can't seem to get imap4d STARTTLS working


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] Can't seem to get imap4d STARTTLS working
Date: Wed, 06 Jun 2012 08:00:56 +0300

Hi Chris,

> Jun  5 17:17:21 kaikala kernel: [8029768.775851] imap4d[1118]: segfault
> at 68 ip b76e14bf sp \
> bfe78dd0 error 4 in libmailutils.so.4.0.0[b7668000+8b000]

Most probably it is already fixed in the repo:

  commit 9f9d7b0b7cdb586b34ff08bfa7c752d05088a720
  Author: Sergey Poznyakoff <address@hidden>
  Date:   Fri Mar 23 16:52:33 2012 +0200

      Fix semantics of MU_IOCTL_SUBSTREAM.

      This also fixes e75e9123, which broke TLS support in daemons.

See below.      

> So, if I try to run a daemon, gdb says it exits normally.  I try to run
> --foreground, imap4d tries to talk to _me_, not listen for a connection.

Foreground has nothing to do with it.  Unless told otherwise, imap4d
starts in "inetd" mode, i.e. binds to stdin/stdout for communication.
This mode is also the default if it is connected to a tty.  To start
it as a daemon in foreground, do:

   imap4d --foreground -d

This however makes little sense for debugging, because imap4d will fork
off a child for each incoming connection.  There are two approaches to
debug what's going on in a child.

* Method 1

First, you can start imap4d in a single-process mode.  It is a degraded
performance mode designed expressly for debugging.  In single-process
mode imap4d serves connections one at a time, without forking
subprocesses.  This mode is enabled in the section "server" of imap4d
configuration file:

  mode daemon;           # This switches to daemon mode by default.
  server 127.0.0.1 {     # This declares a server listening on 127.0.0.1:143
     single-process yes; # ... and this forces the single-process mode.
  };   

The same can be done from the command line, as follows:

  imap4d --foreground --daemon --set .server="127\.0\.0\.1".single-process=yes

(the --set option can be used to set arbitrary configuration file parameter).

To do the same from the debugger:

(gdb) set args --foreground --daemon --set 
.server="127\.0\.0\.1".single-process=yes
(gdb) run

Now switch to another console and connect to the server.

* Method 2.

If you wish to attach to the running daemon: first, connect to the imap
port using telnet or mu (more on that below), then look into the log
(or run ps) to determine the *PID of the child process*, and then attach
to that PID. Once done, proceed with the IMAP session.

Instead of connecting using telnet, it is far more convenient to use the
"mu imap" command, which provides a simple user shell.  It becomes
especially useful if you need to work over encrypted channel,
because it handles it transparently.  For the information about this
command, visit:

  http://mailutils.org/wiki/Mu#imap


Last, but not the least: several important changes (mostly bugfixes)
have been added to the repository since 2.99.96.  So, before further
debugging, please install the recent version.  The version 2.99.97 is
now available for download from

    ftp://alpha.gnu.org/gnu/mailutils

Regards,
Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]