r-a-y / bp-reply-by-email

Reply to BuddyPress items from the comfort of your email inbox. Currently in pre-release.
GNU General Public License v2.0
63 stars 9 forks source link

SparkPost not working after following set up instructions #92

Closed junkjunker closed 7 years ago

junkjunker commented 7 years ago

Hi r-a-y, After successfully using RBE with Postmark, but then realizing their 25K email limitation, I set out to use SparkPost instead. I followed the instructions at https://github.com/r-a-y/bp-reply-by-email/wiki/SparkPost. I used Postman and the SparkPost collection to issue the POST commands in the API to create an Inbound Domain and SMTP Relay Webhook.

Yet posts I create by email, or comments I reply to by email are never received. Looking at the SparkPost dashboard, it doesn't appear that the messages are even sent (there are 0 hits).

It looks like SparkPost may have a new GUI to set up accounts, is it now possible to do the setup through the GUI instead of issuing commands through the API?

Thank you!

r-a-y commented 7 years ago

Last time I checked, SparkPost doesn't log activity for inbound events in their dashboard, nor do they allow configuration in their dashboard, which is why I mention SparkPost is suited for developers only.

Check to see if your inbound domain is resolving to SparkPost correctly. You can use this site to test: https://mxtoolbox.com/

Also, follow SparkPost's own debug guide located under the "Troubleshooting and FAQ" section of this page: https://support.sparkpost.com/customer/portal/articles/2039614-enabling-inbound-email-relaying-relay-webhooks

If you are still running into problems after this, I'll take a look later in the week.

You could also try SendGrid. Even though they have a limited free account, inbound processing doesn't appear to count towards the email total (though this could change in the future).

junkjunker commented 7 years ago

It does appear to be resolving correctly:

mx:reply.lscp.org Pref Hostname 10 rx1.sparkpostmail.com 10 rx2.sparkpostmail.com 10 rx3.sparkpostmail.com

And I can send a test email from SparkPost, if that's relevant.

Thanks!

On 2/26/2017 10:38 AM, r-a-y wrote:

Last time I checked, SparkPost doesn't log activity for inbound events in their dashboard.

Check to see if your inbound domain is resolving to SparkPost correctly. You can use this site to test: https://mxtoolbox.com/

If you are still running into problems after this, I'll take a look into this later in the week.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-282572543, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E852cyj-Z50HlxK1BgH5b_T7XU2fVks5rgbiugaJpZM4MMSjZ.

r-a-y commented 7 years ago

Just tested SparkPost and it's working for me.

The problem probably lies in when you were interacting with the SparkPost API.

Ensure that your inbound domain and relay webhook is registered with SparkPost. If you're using PostMan, use the "Inbound Domains > List All Inbound Domains" and the "Relay Webhooks > List All Relay Webhooks" API calls to see if you configured SparkPost correctly.

I'm going to close this for now, but feel free to keep replying.

junkjunker commented 7 years ago

Hmm. Here's what I get from Postman:

Inbound Domains > List All Inbound Domains

{ "results": [ { "domain": "reply.lscp.org" } ] }

Relay Webhooks > List All Relay Webhooks

{ "results": [ { "id": "88974672366525190", "name": "LSCP Replies Webhook", "target": "http://lscp.org/wordpress", "auth_token": "", "match": { "protocol": "SMTP", "domain": "reply.lscp.org" } } ] }

Does this all look correct?

Thanks

On 2/28/2017 11:50 AM, r-a-y wrote:

Just tested SparkPost and it's working for me.

The problem probably lies in when you were interacting with the SparkPost API.

Ensure that your inbound domain and relay webhook is registered with SparkPost. If you're using PostMan, use the "Inbound Domains > List All Inbound Domains" and the "Relay Webhooks > List All Relay Webhooks" API calls to see if you configured SparkPost correctly.

I'm going to close this for now, but feel free to keep replying.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283127872, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E87z2bCCto-yNWcPbek7wJe0YXFHNks5rhGxZgaJpZM4MMSjZ.

r-a-y commented 7 years ago

Your problem is with your target parameter in your Relay Webhook call. lscp.org/wordpress doesn't appear to be a valid WordPress website. Change this URL to your real WordPress URL.

Also, if you are developing locally, you can only use a real-world website URL and not a localhost development site.

junkjunker commented 7 years ago

Actually, I just changed my actual URL to the made up one you got in the email as a bit of security (since I didn't know how much of this will end up in a public place on Github).

Probably doesn't matter, so here is the response with the actual URL:

{ "results": [ { "id": "88974672366525190", "name": "LSCP Replies Webhook", "target": "http://lscp.org/lscpwp", "auth_token": "", "match": { "protocol": "SMTP", "domain": "reply.lscp.org" } } ] }

On 2/28/2017 12:17 PM, r-a-y wrote:

Your problem is with your |target| parameter in your Relay Webhook call. |lscp.org/wordpress| doesn't appear to be a valid WordPress website. Change this URL to your real WordPress URL.

Also, if you are developing locally, you can only use a real-world website URL and not a localhost development site.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283135272, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E80C1PUMqrFHFgA6TYnpaK-AuazUZks5rhHLRgaJpZM4MMSjZ.

junkjunker commented 7 years ago

Hi r-a-y, Just to try, I deleted the original Relay Webhook and recreated it. Here is the response from Relay Webhooks > List All Relay Webhooks: { "results": [ { "id": "84543052225497130", "name": "LSCP Replies Webhook", "target": "http://lscp.org/lscpwp", "auth_token": "", "match": { "protocol": "SMTP", "domain": "reply.lscp.org" } } ] }

From the front end I can @ mention someone and they receive the notification in their email, but I still cannot start a new topic by email, or respond by email to any topics and have them show up on the web site. Let me know if you need any other details from me at all.

Thanks! Matt

r-a-y commented 7 years ago

See if SparkPost is sending any responses back to the site by checking the wp-content/bp-rbe-debug.log file. Do you see anything from SparkPost there? If you do, that means SparkPost is at least sending something back to the site. Can you list the debug messages?

If not, you'll have to look into debugging SparkPost some more. Follow SparkPost's own debug guide located under the "Troubleshooting and FAQ" section of this page: https://support.sparkpost.com/customer/portal/articles/2039614-enabling-inbound-email-relaying-relay-webhooks

Particularly, adding the Event Webhooks part. It could be that your host is blocking particular POST responses.

You could also try SendGrid. Even though they have a limited free account, inbound processing doesn't appear to count towards the email total (though this could change in the future).

junkjunker commented 7 years ago

Hm, I don't see the debug file. I'm looking at wp-content/ but there is no bp-rbe-debug.log file there. Do I need to enable this in the admin somewhere?

From the SparkPost Troubleshooting and FAQ:

If your webhook doesn’t seem to be working, you can try these steps:

Also, it appears that SendGrid no longer has a free tier, just a 30-day free trial. Here are some that appear to still be free: https://www.metachris.com/2016/03/free-transactional-email-services-the-best-alternatives-to-mandrill/

Thanks

On 3/2/2017 11:25 AM, r-a-y wrote:

See if SparkPost is sending any responses back to the site by checking the |wp-content/bp-rbe-debug.log| file. Do you see anything from SparkPost there? If you do, that means SparkPost is at least sending something back to the site. Can you list the debug messages?

If not, you'll have to look into debugging SparkPost some more. Follow SparkPost's own debug guide located under the "Troubleshooting and FAQ" section of this page: https://support.sparkpost.com/customer/portal/articles/2039614-enabling-inbound-email-relaying-relay-webhooks

Particularly, adding the Event Webhooks part. It could be that your host is blocking particular POST responses.

You could also try SendGrid. Even though they have a limited free account, inbound processing doesn't appear to count towards the email total (though this could change in the future).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283736760, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E80FUBMumXJ4Q_F4rrBIcQwTFARyyks5rhwm1gaJpZM4MMSjZ.

r-a-y commented 7 years ago

About SparkPost debugging, you'll have to help yourself or you'll have to contact SparkPost.

About the bp-rbe-debug.log file, it doesn't look like your filesystem has the correct permissions.

Try adding the following to wp-config.php: define( 'BP_RBE_DEBUG_LOG_PATH', WP_CONTENT_DIR . '/uploads/bp-rbe-debug.log' );

Add it before the /* That's all, stop editing! Happy blogging. */ line.

Also, it appears that SendGrid no longer has a free tier, just a 30-day free trial.

The SendGrid trial account converts to a free account after 30 days. It should be sufficient since they do not count inbound processing towards the email total at the moment, but like I said, this could change in the future.

Here are some that appear to still be free

I already have compiled a list. See #77.

junkjunker commented 7 years ago

Thanks!

I have already contacted SparkPost and am awaiting a reply.

My wp-content and subfolders (including uploads) all had 705 permissions, so I changed them to 775. I've made the edit to wp-config but still don't see any log file (in either location). What should I do to trigger the creation of the log file?

Thanks for the SendGrid tip! It wasn't clear from their website, I didn't realize that it would revert to a free account. I thought it was all going the way of paid subscriptions.

On 3/2/2017 1:44 PM, r-a-y wrote:

About SparkPost debugging, you'll have to help yourself or you'll have to contact SparkPost.

About the |bp-rbe-debug.log| file, it doesn't look like your filesystem has the correct permissions.

Try adding the following to |wp-config.php|: |define( 'BP_RBE_DEBUG_LOG_PATH', WP_CONTENT_DIR . '/uploads/bp-rbe-debug.log' );|

Add it before the |/ That's all, stop editing! Happy blogging. /| line.

Also, it appears that SendGrid no longer has a free tier, just a
30-day free trial.

The SendGrid trial account converts to a free account after 30 days. It should be sufficient since they do not count inbound processing at the moment, but like I said, this could change in the future.

Here are some that appear to still be free

I already have compiled a list. See #77 https://github.com/r-a-y/bp-reply-by-email/issues/77.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283774528, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E84Vcl5c5fdoZjeaWh2wuwgphew_Yks5rhypIgaJpZM4MMSjZ.

r-a-y commented 7 years ago

Try replying by email, which should trigger a response from SparkPost to your website callback and create a new log entry if successful.

The log file should be generated in your /wp-content/uploads/ folder.

junkjunker commented 7 years ago

I've tried replying to emails, and even starting a new post from email, to no avail. I've triple checked my server and there is still no log file.

I've even switched over to SendGrid (thought that would be easier, but now there's a big "whitelabeling" process that you need to do before you can enter your subdomain and target URL). No joy there either.

It's very strange, emails sent seem to just disappear. There's no RBE log file generated, or any indication from SendGrid or SparkPost that anything is happening.

Are there some BuddyPress or BBpress settings that need to be en/disabled for emails to work as expected?

Thanks

On 3/2/2017 2:37 PM, r-a-y wrote:

Try replying by email, which should trigger a response from SparkPost to your website callback and create a new log entry if successful.

The log file should be generated in your |/wp-content/uploads/| folder.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283789983, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E81wimyzQnwfwkcIx37VVUZT2jyY1ks5rhzaZgaJpZM4MMSjZ.

r-a-y commented 7 years ago

Silly thing, but maybe you forgot to change RBE's settings to use the correct Inbound Provider after switching to SparkPost?

If not, you said everything was working when you used Postmark. Maybe go back to using that? Their free allotment is still quite a bit and would probably get you through many years depending on your email volume.

r-a-y commented 7 years ago

To check if any log writing is successful, deactivate RBE and reactivate it from the WordPress admin dashboard.

This should log a message into the log file.

junkjunker commented 7 years ago

Strangely, that didn't trigger anything either.

I went to the Commons in a Box > Plugins. When I deactivated BP Reply By Email it did crash to a white screen with these two errors:

"Warning: error_log(WP_CONTENT_DIR/uploads/bp-rbe-debug.log): failed to open stream: No such file or directory in /homepages/15/d12345678/htdocs/lscp/lscpwp/wp-content/plugins/bp-reply-by-email/includes/bp-rbe-functions.php on line 471

Warning: Cannot modify header information - headers already sent by (output started at /homepages/15/d12345678/htdocs/lscp/lscpwp/wp-content/plugins/bp-reply-by-email/includes/bp-rbe-functions.php:471) in /homepages/15/d12345678/htdocs/lscp/lscpwp/wp-includes/pluggable.php on line 1179"

A refresh of the page brought me back to Commons in a Box dashboard, and I could verify that RBE was deactivated. Reactivating it produced no errors, but it didn't produce a log file either.

When I comment out the line that you gave me earlier for wp-config.php, and then deactivate RBE it doesn't crash and suddenly the log file is in the wp-content folder. Progress!

But that's where it ends. Re-enabling RBE and sending emails don't result in any log file activity. Seems the only thing that gets logged is deactivation:

[03-Mar-2017 01:23:15] Plugin deactivated! [03-Mar-2017 01:34:27] Plugin deactivated!

On 3/2/2017 5:59 PM, r-a-y wrote:

To check if any log writing is successful, deactivate RBE and reactivate it from the WordPress admin dashboard.

This should log a message into the log file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283832793, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E80P5rSYdgwacHU5EkCac4gY1kyN2ks5rh2XsgaJpZM4MMSjZ.

junkjunker commented 7 years ago

Infuriating. I completely wiped the site, deleted the database, and did a fresh install of Wordpress. I only have Askimet, Commons in a Box, and Improved Cron (to fake web activity every minute) installed.

I followed the full setup wiki for bbPress, Starter Guide, Postmark, SendGrid, SparkPost, and Troubleshooting Guide.

Now I don't even get new topics or replies sent to the emails of any of the subscribers. I do get the @ mention notices from Wordpress, but no other emails.

The RBE debug log was created, but the only thing it logs is deactivations. No other activity at all.

Maybe there's something simple I've overlooked, but I've been over it so many time, it's driving me nuts.

The worst part is, I've got another testing site with the same setup that everything works on!

I'm at a loss...

On 3/2/2017 5:59 PM, r-a-y wrote:

To check if any log writing is successful, deactivate RBE and reactivate it from the WordPress admin dashboard.

This should log a message into the log file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-283832793, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E80P5rSYdgwacHU5EkCac4gY1kyN2ks5rh2XsgaJpZM4MMSjZ.

r-a-y commented 7 years ago

The worst part is, I've got another testing site with the same setup that everything works on!

You never said that you were testing on another site. It sounds to me that your webhost on your new site is blocking incoming POST responses, which would prevent inbound mode from working correctly. You'll have to contact your host and ask them if that is the case or not.

junkjunker commented 7 years ago

I have several sites all hosted on the same web host package (I can FTP into my web host and see all of my sites in different subfolders. The domain names then point to those various subfolders). Could they be blocking POST responses on one folder and not the other even if it's all in the same hosting package?

I assume that RBE just handles the incoming emails and turns them into topics and replies. If that's the case, shouldn't I be getting emails from Wordpress from topics and replies that are made on the website? I thought it was BP Group Email that handled that part. Yet I'm not getting those emails either.

Thinking of the debug log, will it record settings changes made in RBE admin? I guess what I'm looking for is, what changes can I make in admin that will get recorded in the debug log so that I can test if that part is working without having to rely on events coming from Postmark, etc. So far, all I can see in the debug log is deactivations.

Some successes:

  1. I deactivated RBE (log recorded),
  2. uploaded the latest master archive of RBE from github
  3. created a new subdomain, updated MX records, registered the new subdomain and webhook in SparkPost.
  4. reactivated RBE, and changed the inbound to the SparkPost subdomain.

I sent an @mention from the website and received an email letting me know that I had been mentioned. I then replied to that email with another @mention. The posts showed up on the website, and each email user was notified that they'd been mentioned. I was also able to post a new topic via email! Whew, thanks for all your help with this.

What's still not happening is that group members are not getting the topics and replies in their email when posts are made, only @mentions.
Does RBE handle this part or is that something else?

Thanks!

On 3/3/2017 11:12 AM, r-a-y wrote:

The worst part is, I've got another testing site with the same
setup that everything works on!

You never said that you were testing on another site. It sounds to me that your webhost on your new site is blocking incoming POST responses, which would prevent inbound mode from working correctly. You'll have to contact your host and ask them if that is the case or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-284028307, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E8-SfSkH0jqyYWbINdsifKTHYL-LGks5riFgMgaJpZM4MMSjZ.

r-a-y commented 7 years ago

The BP Group Email Subscription plugin sends emails from groups.

In order for members to receive group email notifications from forums, they need to be subscribed to the "All Mail" option.

This information is available on the wiki: https://github.com/r-a-y/bp-reply-by-email/wiki/Frequently-Asked-Questions#how-do-i-reply-to-group-forum-topics--posts-via-email-

junkjunker commented 7 years ago

That's what I thought.

I've confirmed that each of the members is set up for All Mail, as is the group. As an admin I can send a test message to the whole group from the Manage > Email Options menu and they receive it, but somehow topics and posts aren't sent.

After confirming the following:

  1. Go to the front end and set your email options for each of your groups
    1. All users have email options set to All Email.
  2. On the group admin settings, set the default subscription status of existing groups
    1. MyGroup > Manage > Settings >Email Subscription Defaults = All Email
  3. For groups with existing members, go to the bottom of the manage members tab to set all members to the default subscription.
    1. Members were already at All Email, but reset them all anyway.
  4. If emails are not being sent ensure that the activity component is turned on.
    1. Settings > BuddyPress Settings > Components > Activity Streams enabled.

it seems emails are still not being sent. Strange.

On 3/3/2017 12:57 PM, r-a-y wrote:

The BP Group Email Subscription plugin sends emails from groups.

In order for members to receive group email notifications from forums, they need to be subscribed to the "All Mail" option.

This information is available on the wiki: https://github.com/r-a-y/bp-reply-by-email/wiki/Frequently-Asked-Questions#how-do-i-reply-to-group-forum-topics--posts-via-email-

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-a-y/bp-reply-by-email/issues/92#issuecomment-284054811, or mute the thread https://github.com/notifications/unsubscribe-auth/AX6E8zQ1YmTcnHmNCwAVbuJgFhXzsNpsks5riHCxgaJpZM4MMSjZ.