سؤال

I'm trying to open the non-secure (port 143) IMAP connection (I am using PHP):

imap_open('{localhost:143/imap}INBOX', USERNAME, PASS);

and I get the next error: Certificate failure for localhost: self signed certificate ...

Ok. I've tried to use /novalidate-cert mailbox param. Then I get another error: Can not authenticate to IMAP server.

I've also tried to combine all possible non-secure connection params like /notls,/norsh and /secure. But I always get errors.

This is the Dovecot configuration I'm using:

* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=LOGIN] Dovecot ready.

The certificate is really self-signed and generated with openssl.

The questions are:

  1. Why does the certificate error occurs when I am using non-secure connection?
  2. What is wrong with the mail server configuration?
هل كانت مفيدة؟

المحلول

STARTTLS of course uses the certificate to start the TLS channel, hence why you saw a self-signed cert error. Can not authenticate, however, implies your username and password are wrong. Try logging in using telnet to verify your user and password are correct

نصائح أخرى

Use this code

   imap_open('{localhost:143/imap/novalidate-cert/debug}INBOX', USERNAME, PASS);

Instead of this

    imap_open('{localhost:143/imap}INBOX', USERNAME, PASS); 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top