Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn user if IMAP SSL support is not present #196

Open
nomadicjosh opened this issue Aug 14, 2014 · 5 comments
Open

Warn user if IMAP SSL support is not present #196

nomadicjosh opened this issue Aug 14, 2014 · 5 comments

Comments

@nomadicjosh
Copy link

I am testing this plugin on a localhost install. I am trying to setup an email account using gmail but I keep getting the follow error: "Unknown error while connecting to the IMAP server. Please check your IMAP settings and try again."

This is what I retrieved from the local server error logs:

[14-Aug-2014 02:22:47 UTC] PHP Warning: imap_open(): Couldn't open stream {imap.gmail.com:993/ssl} in /Applications/MAMP/htdocs/wordpress/wp-content/plugins/supportflow/classes/class-supportflow-email-accounts.php on line 334

Can someone help me troubleshoot this? Thanks.

@nomadicjosh
Copy link
Author

Never mind. I see that imap-ssl is not installed on MAMP.

@iandunn
Copy link
Contributor

iandunn commented Aug 14, 2014

Thanks for the report @parkerj, we should probably do a better job of warning users if imap-ssl isn't installed.

@VarunAgw, can you add an error message specifically for this situation, so that they don't see the generic one?

@iandunn iandunn reopened this Aug 14, 2014
@VarunAgw
Copy link
Contributor

From what I think it might be caused by IMAP extension not build with SSL support. Because if extension was not installed it will have given fatal error.

Now the best thing I found to check if it is support SSL so far is using new ReflectionExtension('imap')->info(); But it returns the data along with other information in a table.

Opinions?

@iandunn
Copy link
Contributor

iandunn commented Aug 14, 2014

Something like this should work:

ob_start();
$imap_info = new ReflectionExtension('imap');
$imap_info->info();
$imap_info = strip_tags( ob_get_clean() );
$ssl_enabled = false !== strpos( $imap_info, 'SSL Support enabled' );

@VarunAgw
Copy link
Contributor

oh wait..I think imap_errors() must have also given the same error. So I guess it is better to use it.

But I can't reproduce it.

@iandunn iandunn changed the title Creating Email Account Warn user if IMAP SSL support is not present Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants