Answer the question
In order to leave comments, you need to log in
How to get imap_open mail with Kerberos authorization?
Good time. The crux of the matter is as follows. There is a script which takes away mail and puts everything in the database. During testing, the script was running on mail from Yandex. Now it's time to transfer to the corporate server and take mail from it. Here there was a problem.
Array ( [0] => Kerberos error: Credentials cache file '/tmp/krb5cc_327275' not found (try running kinit)
$mail_login = "[email protected]";
$mail_password = "password";
$mail_imap = "{imap.ourmail.ru:993/imap/notls/ssl/debug}INBOX";
$mbox = imap_open($mail_imap, $mail_login, $mail_password);
print_r(imap_errors());
$mails = imap_search($mbox, 'UNSEEN');
Answer the question
In order to leave comments, you need to log in
Decided!
$mail_login = "mymail";
$mail_password = "mail password";
$mail_imap = "{imap.site.ru/imap/novalidate-cert/ssl/norsh/user=name_user}INBOX";
$mbox = imap_open($mail_imap, $mail_login, $mail_password, NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));
$str = imap_errors(); print_r($str);
echo $str;
$mails = imap_search($mbox, 'UNSEEN');
So do what they ask. For Kerberos, you first need to get a TGT (ticket grantering ticket) from the Kerberos server, only then you can go to the IMAP server with it and log in already on the IMAP server. TGT can be obtained using kinit.
for example, here is the instruction:
directory.apache.org/apacheds/kerberos-ug/4.1-auth...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question