[imp] Error connecting to IMAP server. 22 : Invalid argument.

Troy Dixler troy at twisted.net
Thu Mar 23 21:06:45 PST 2006


> This is the configuration that I am using:
>
> $servers['imap'] = array(
>     'name' => 'IMAP Server',
>     'server' => 'localhost',
>     'hordeauth' => false,
>     'protocol' => 'imap/ssl/novalidate-cert',
>     'port' => 993,
>     'maildomain' => 'foo.bar.net',
>     'smtphost' => 'localhost',
>     'smtpport' => 25,
>     'realm' => '',
>     'preferred' => '',
> );
>
> I have never changed it to imap/tls/novalidate-cert and am still receiving
> this message.

You need to find out two things then in imp/lib/IMAP/Client.php. Why  
_usetls is set to true, what the wrong argument mentioned in the error  
message is, probably _host.

I just edited the default Client.php and you were correct that _usetls was
set to true. I'm not sure why it was set that way by default.  Even after I
manually set it to false in both places it's still not working properly.

   var $_usetls = false;

    /**
     * Constructor.
     *
     * @param string $host      The address/hostname of the IMAP server.
     * @param string $port      The port to connect to on the IMAP server.
     * @param string $protocol  The protocol string (See, e.g.,
servers.php).
     */
    function IMP_IMAPClient($host, $port, $protocol)
    {
        $this->_host = $host;
        $this->_port = $port;

        /* Split apart protocol string to discover if we need to use either
         * SSL or TLS. */
        $tmp = explode('/', strtolower($protocol));
        if (in_array('tls', $tmp)) {
            $this->_usetls = false;
        } elseif (in_array('ssl', $tmp)) {
            $this->_usessl = true;
        }
    }



Any other ideas what would be causing this?

-Troy





More information about the imp mailing list