Skip to content

imap_open() - timeout not working with ssl #17510

@Elompenta

Description

@Elompenta

Description

imap timeout ist not working if ssl is used in the connection.
In case you dont use used ssl then after 10s it will be aborted by timeout but its not working with ssl.

<?php
imap_timeout(IMAP_READTIMEOUT, 10);
imap_timeout(IMAP_OPENTIMEOUT, 10);
$imap_connect = imap_open("{mail.yahoo.com:993/ssl/novalidate-cert}", $user, $pwd);

Resulted in this output:

If i have used ssl then imap_open takes hell lot of time to return a response. timeout is ignored.

But I expected this output instead:

After 10s imap_open show show timeout even server address having ssl.

New Github isse from old bugreport: https://bugs.php.net/bug.php?id=61846

There was a note from cmb@php.net but nothing else happens.

It seems to me that ext/imap does the right thing, by calling
mail_parameters() to set the respective timeouts, and by calling
mail_open() to open the IMAP stream. If the timeout is not heeded
for some kinds of connections, that would appear to be a bug in
libc-client, but not in PHP.

PHP Version

PHP 8..15

Operating System

Debian 12.8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions