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

BuddyPress Reply By Email cannot initialize. Please navigate to "BuddyPress > Reply By Email" to fill in the required fields and address the webhost warnings. #39

Closed
lcwakeman opened this issue Jul 19, 2013 · 16 comments

Comments

@lcwakeman
Copy link

BuddyPress V 1.6.1
Select BuddyPress Reply By Email V 1.0-beta1

Getting the above message when activating and saving settings, pretty much all the time in the admin pages. Did some examining and the error is coming from the bp_rbe_is_required_completed function in bp-rbe-functions.php. It ha passed the imap test and is checking for required fields in the settings. The settings array contains:

[email] => replybuddypress@foothillsustainability.org
[username] => replybuddypress
[password] => ******************
[key] => 51e70af084c7b
[keepalive] => 15

but it is looking for 'servername', 'port', 'tag', 'username', 'password', 'key', 'keepalive', 'connect'. Missing are 'servername', 'port', 'tag', and 'connect'. They are not being saved. I tried updating the record in the wp_options table and it still failed, the required settings were removed before checking them. Another point is that the password is being set to something I didn't enter.

@r-a-y
Copy link
Owner

r-a-y commented Jul 19, 2013

Hi,

Try using the bleeding version:
https://github.com/r-a-y/bp-reply-by-email/archive/master.zip

The beta version did not successfully save settings for email addresses that were not from GMail. Is the "replybuddypress" email address a GMail address? If so, did you check the GMail checkbox?

Another point is that the password is being set to something I didn't enter.

The password is encoded, which is why it's different.

@lcwakeman
Copy link
Author

Still getting the original error and a connect error.

Error: Unable to connect to inbox - Certificate failure for imap.foothillsustainability.org: Server name does not match certificate: /serialNumber=qfHXgdVE2YAofzpdeiA2pStouD6SUSix/OU=GT48113054/OU=See www.rapidssl.com/resources/cps (c)13/OU=Domain Control Validated - RapidSSL(R)/CN=*.accountsupport.com

buddypress reply by email

@r-a-y
Copy link
Owner

r-a-y commented Jul 19, 2013

Looks like we're getting somewhere!

Your error explains everything. Your server name does not match your
certificate.

You might have the wrong mail server set. Ask your host to see if you
have the right connection settings.

Also, see this Stackoverflow article for more info:
http://stackoverflow.com/questions/7891729/certificate-error-using-imap-in-php

@r-a-y
Copy link
Owner

r-a-y commented Jul 19, 2013

If you want to connect to your inbox without validating the certificate, you can try adding this code snippet to wp-content/plugins/bp-custom.php:

// allow novalidate-cert flag when connecting via IMAP
function my_rbe_novalidate( $retval ) {
    return str_replace( 'ssl', 'ssl/novalidate-cert', $retval );
}
add_filter( 'bp_rbe_mailbox', 'my_rbe_novalidate' );`

However, it's generally not a good idea to do this unless your server uses a self-signed certificate.

Once you add this snippet, try deactivating and then reactivating RBE.

@lcwakeman
Copy link
Author

That seems to have worked, at least as far as the SSL certificate. Still getting ‘BuddyPress Reply By Email cannot initialize. Please navigate to "BuddyPress > Reply By Email" to fill in the required fields and address the webhost warnings’.

From: r-a-y [mailto:notifications@github.com]
Sent: Friday, July 19, 2013 12:07 PM
To: r-a-y/bp-reply-by-email
Cc: lcwakeman
Subject: Re: [bp-reply-by-email] BuddyPress Reply By Email cannot initialize. Please navigate to "BuddyPress > Reply By Email" to fill in the required fields and address the webhost warnings. (#39)

If you want to connect to your inbox without validating the certificate, you can try adding this code snippet to wp-content/plugins/bp-custom.php http://codex.buddypress.org/developer/customizing/bp-custom-php/ :

// allow novalidate-cert flag when connecting via IMAP
function my_rbe_novalidate( $retval ) {
return str_replace( 'ssl', 'ssl/novalidate-cert', $retval );
}
add_filter( 'bp_rbe_mailbox', 'my_rbe_novalidate' );`

However, it's generally not a good idea to do this unless your server uses a self-signed certificate.


Reply to this email directly or view it on GitHub #39 (comment) . https://github.com/notifications/beacon/6dliHHxlWA7KwhtOgguEHBuXiYAawNxAZ7H8OTeGugquBYUjWdi4pS_oQkfC3WbN.gif

@r-a-y
Copy link
Owner

r-a-y commented Jul 19, 2013

Re-submit the form values on the settings page and see if any error pops below the generic message.

@lcwakeman
Copy link
Author

Still having SSL issues. Have to keep an empty bp-custom.php in the plugins directory. If I delete it I get an include error, can’t open stream.

It also worked once, well didn’t give me an error in the dashboard but now I am getting the SSL error with or without the filter. I question the need for SSL as most forums are public and the quick start only says that SSL is recommended.

As for the can’t initialize error, it is still there. I put debug in the module I mentioned above and all the fields seem to be there. Might be failing somewhere else.

From: r-a-y [mailto:notifications@github.com]
Sent: Friday, July 19, 2013 2:19 PM
To: r-a-y/bp-reply-by-email
Cc: lcwakeman
Subject: Re: [bp-reply-by-email] BuddyPress Reply By Email cannot initialize. Please navigate to "BuddyPress > Reply By Email" to fill in the required fields and address the webhost warnings. (#39)

Re-submit the form values on the settings page and see if any error pops below the generic message.


Reply to this email directly or view it on GitHub #39 (comment) . https://github.com/notifications/beacon/6dliHHxlWA7KwhtOgguEHBuXiYAawNxAZ7H8OTeGugquBYUjWdi4pS_oQkfC3WbN.gif

@r-a-y
Copy link
Owner

r-a-y commented Jul 19, 2013

Have to keep an empty bp-custom.php in the plugins directory. If I delete it I get an include error, can’t open stream.

This sounds odd. What happens when you deactivate RBE and remove bp-custom.php. Do you still get the include error? I don't think this problem is related to RBE though. BuddyPress does a file_exists() check on bp-custom.php. Are you running any caching plugins? Are you running a multi-server setup that syncs files across different servers?

I question the need for SSL as most forums are public and the quick start only says that SSL is recommended.

I would recommend SSL, but you are free to experiment with the different IMAP flags provided in imap_open(). Use the filter function I provided above as a guide and remove the 'ssl' flag if you need to. However the 'novalidate-cert' flag should stop the errors from appearing.

@lcwakeman
Copy link
Author

My client has pulled the plug on this. I do have some suggestions:

· Make it work on shared hosting. I think that the potential number of users of the plugin will increase dramatically as the vast majority of web sites run on shared hosting.

· SSL Support:

o Add a checkbox to the settings page that turns SSL on or off.

o Add a test connection function that will check the connection and allow the user to accept the provided certificate.

· Add POP support though I agree that IMAP is the way to go, potential clients don’t have it available.

From: r-a-y [mailto:notifications@github.com]
Sent: Friday, July 19, 2013 3:07 PM
To: r-a-y/bp-reply-by-email
Cc: lcwakeman
Subject: Re: [bp-reply-by-email] BuddyPress Reply By Email cannot initialize. Please navigate to "BuddyPress > Reply By Email" to fill in the required fields and address the webhost warnings. (#39)

Have to keep an empty bp-custom.php in the plugins directory. If I delete it I get an include error, can’t open stream.

This sounds odd. What happens when you deactivate RBE and remove bp-custom.php. Do you still get the include error? I don't think this problem is related to RBE though. BuddyPress does a file_exists() check on bp-custom.php. Are you running any caching plugins? Are you running a multi-server setup that syncs files across different servers?

I question the need for SSL as most forums are public and the quick start only says that SSL is recommended.

I would recommend SSL, but you are free to experiment with the different IMAP flags. Use the filter function I provided above as a guide and remove the 'ssl' flag if you need to. However the 'novalidate-cert' flag should stop the errors from appearing.


Reply to this email directly or view it on GitHub #39 (comment) . https://github.com/notifications/beacon/6dliHHxlWA7KwhtOgguEHBuXiYAawNxAZ7H8OTeGugquBYUjWdi4pS_oQkfC3WbN.gif

@r-a-y
Copy link
Owner

r-a-y commented Jul 20, 2013

Thanks for the suggestions. They all make sense in some manner.

Make it work on shared hosting. I think that the potential number of users of the plugin will increase dramatically as the vast majority of web sites run on shared hosting.

This is not really possible at the moment. One of the plugin's original goals was for immediacy. For example, if I reply by email, it should post on the site in less than a minute.

For shared hosting to work, the plugin would only connect to the inbox at a specified interval and the connection would not be kept-alive; the immediacy would then be lost. A fair bit of the code for WP-cron and inbox checking would need to be refactored in order to accomodate this. Even then, this would not be 100% reliable.

The other option is coding a script that allows server cronjobs to access the script. That would probably resolve some of the issues. But only certain hosts allow server cronjobs.

Add a checkbox to the settings page that turns SSL on or off.

Makes sense. I do have a filter available for devs to override this setting.

Add a test connection function that will check the connection and allow the user to accept the provided certificate.

A test connection button makes the most sense here. The certificate option does not. Would probably be better to have a checkbox to disable certificate checking.

Add POP support though I agree that IMAP is the way to go, potential clients don’t have it available.

This probably isn't going to happen.


Just curious, but is there a reason why you haven't tried GMail as an option yet? Is this because of a host restriction?

@lcwakeman
Copy link
Author

Thanks for the suggestions. They all make sense in some manner.

Make it work on shared hosting. I think that the potential number of users of the plugin will increase dramatically as the vast majority of web sites run on shared hosting.

This is not really possible at the moment. One of the plugin's original goals was for immediacy. For example, if I reply by email, it should post on the site in less than a minute.

For shared hosting to work, the plugin would only connect to the inbox at a specified interval and the connection would not be kept-alive; the immediacy would then be lost. A fair bit of the code for WP-cron and inbox checking would need to be refactored in order to accomodate this. Even then, this would not be 100% reliable.

The other option is coding a script that allows server cronjobs to access the script. That would probably resolve some of the issues. But only certain hosts allow server cronjobs.

Look at http://www.phpclasses.org/package/2197-PHP-Create-and-control-Unix-daemon-processes.html

Add a checkbox to the settings page that turns SSL on or off.

Makes sense. I do have a filter available for devs to override this setting.

Add a test connection function that will check the connection and allow the user to accept the provided certificate.

A test connection button makes the most sense here. The certificate option does not. Would probably be better to have a checkbox to disable certificate checking.

Even if you don’t accept the certificate, a test connection button is still useful. The user would know that the settings were correct. As for most hosting sites, the mail server is for all the sites hosted on that site, shared or dedicated. The certificate won’t be from the same domain as the email address.

Add POP support though I agree that IMAP is the way to go, potential clients don’t have it available.

This probably isn't going to happen.

Check Look at http://www.phpclasses.org/package/2197-PHP-Create-and-control-Unix-daemon-processes.html. I agree that this is probably not a big one.

@r-a-y
Copy link
Owner

r-a-y commented Jul 20, 2013

I already have a better library - PHP Daemon - starred in my Github repos that I've been wanting to include in RBE. The problem with that is the PHP 5.3+ requirement and the additional server requirements of needing POSIX and PCNTL. This, of course, raises the server requirements some more.

I'd be happy to see some improvements in RBE via a pull request.

@r-a-y
Copy link
Owner

r-a-y commented Jul 20, 2013

I have opened new issues regarding the SSL and certificate checking options on the issue tracker.

As for the main problem you had, if you are able to provide your credentials to the "replybuddypress" email account or another email account from your host, I would love to debug it locally to see if it's a problem I can duplicate.

Contact me privately here if interested.

@lcwakeman
Copy link
Author

I sent the credentials in another post.

In a prior reply you said that it is required that the email be posted within a minute. I think a better solution would be to insure the email is posted before anyone tries to read the topic it is to. The users won’t see a difference but you could hopefully hook into BuddyPress and run the email check when the forum is being entered. Worst case, in the initialize routine of the BuddyPress > Reply By Email plugin though that would fire any time a page is loaded on the site.

From: r-a-y [mailto:notifications@github.com]
Sent: Saturday, July 20, 2013 1:32 PM
To: r-a-y/bp-reply-by-email
Cc: lcwakeman
Subject: Re: [bp-reply-by-email] BuddyPress Reply By Email cannot initialize. Please navigate to "BuddyPress > Reply By Email" to fill in the required fields and address the webhost warnings. (#39)

I have opened new issues regarding the SSL and certificate checking options on the issue tracker.

As for the main problem you had, if you are able to provide your credentials to the "replybuddypress" email account or another email account from your host, I would love to debug it locally to see if it's a problem I can duplicate.

Contact me privately here http://www.google.com/recaptcha/mailhide/d?k=01gX1gzQ4YdKBkfaN4ptm0uA==&c=4yV_s_PWG3q2ez2Wf-VxNw== if interested.


Reply to this email directly or view it on GitHub #39 (comment) . https://github.com/notifications/beacon/6dliHHxlWA7KwhtOgguEHBuXiYAawNxAZ7H8OTeGugquBYUjWdi4pS_oQkfC3WbN.gif

@r-a-y
Copy link
Owner

r-a-y commented Jul 24, 2013

Thanks for the credentials. I'll look into it soon.

As for your suggestion of doing an inbox check whenever someone views a forum. This sounds good on the outset. But, if you are only communicating via email, this will not work as you could have a potential backlog that never gets sent until someone views the group forum.

Like I stated before, if I were to offer an option to help those on shared hosts, it would be to check the inbox at a specified interval and I would remove the keep connection alive functionality. You will lose some immediacy, but I feel that's the best option going forward.

@r-a-y
Copy link
Owner

r-a-y commented Jun 4, 2014

You might want to try a new operating mode that doesn't rely on connecting to an IMAP inbox. It should work better with shared hosts.

If interested, read this wiki entry:
https://github.com/r-a-y/bp-reply-by-email/wiki/Mandrill

Going to close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants