Php-imap: Kerberos-Fehler bei Verbindung

Erstellt am 16. Mai 2013  ·  3Kommentare  ·  Quelle: barbushin/php-imap

PHP zeigt einen Hinweis an, wenn der IMAP-Server Kerberos-Tickets erfordert, auch wenn er auf klassische Anmeldeinformationen (Login/Passwort) zurückgreift.

PHP Notice:  Unknown: Kerberos error: No credentials cache found (try running kinit) for imap.example.com (errflg=1) in Unknown on line 0

Hilfreichster Kommentar

Um mein Problem zu beheben, könnte es möglich sein, die GSSAPI-Authentifizierung zu deaktivieren, wenn die Verbindung zum Server hergestellt wird:

$imapStream = @imap_open($this->imapPath, $this->login, $this->password, 0, 0, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));

Alle 3 Kommentare

Um mein Problem zu beheben, könnte es möglich sein, die GSSAPI-Authentifizierung zu deaktivieren, wenn die Verbindung zum Server hergestellt wird:

$imapStream = @imap_open($this->imapPath, $this->login, $this->password, 0, 0, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));

Danke @tchemineau , 7 Jahre später hast du mir den Arsch gerettet vor ich weiß nicht wie viele Stunden noch!!! 🥳

Sie können diese Parameter mit der Funktion setConnectionArgs($options = 0, $retriesNum = 0, $params = null) einstellen:

<?php

    require_once __DIR__ . '/../vendor/autoload.php';
    use PhpImap\Mailbox;
    use PhpImap\Exceptions\ConnectionException;
    use PhpImap\Exceptions\InvalidParameterException;

    $mailbox = new Mailbox(
        '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder
        '[email protected]', // Username for the before configured mailbox
        '*********', // Password for the before configured username
        __DIR__, // Directory, where attachments will be saved (optional)
        'US-ASCII' // Server encoding (optional)    
    );

    try {
        $mailbox->setConnectionArgs(0, 0, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));
    } catch(InvalidParameterException $ex) {
        die("Failed to set connection arguments: " . $ex->getMessage());
    }

    try {
        $mail_ids = $mailbox->searchMailbox('UNSEEN');
    } catch(ConnectionException $ex) {
        die("IMAP connection failed: " . $ex->getMessage());
    } catch (Exception $ex) {
        die("An error occured: " . $ex->getMessage());
    }

    foreach ($mail_ids as $mail_id) { ... }
War diese Seite hilfreich?
0 / 5 - 0 Bewertungen