Skip to:
Content

bbPress.org

Opened 9 years ago

Closed 8 years ago

Last modified 5 weeks ago

#2822 closed defect (bug) (fixed)

email notification bug on sublevel domains

Reported by: skyynet's profile skyynet Owned by: thebrandonallen's profile thebrandonallen
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.8
Component: API - Subscriptions Keywords: has-patch
Cc: robkk17@…

Description

Ever since I installed BBpress I have this bug: Everytime an email is about to be sent I get an error message from my server like <noreplyATubdomain.domain.com>… Deferred: Connection refused by ubdomain.domain.com.

You might have seen that the subdomain is being put into the email sender and the first letter of it is killed. In my opinion the sender should be noreplyATdomain.com instead of noreplyATubdomain.domain.com. (I had to change the AT sign to "AT" a otherwise the domain is shown as ... in this ticket system.)

wp: 4.2.2
bbpress: 2.5.7
wp-url: subdomain.domain.com

Attachments (1)

2822.01.tests.patch (1.3 KB) - added by thebrandonallen 8 years ago.

Download all attachments as: .zip

Change History (10)

#1 @Robkk
9 years ago

  • Cc robkk17@… added

#2 @thebrandonallen
8 years ago

  • Keywords reporter-feedback added

@skyynet

Are you still seeing this issue? I can't seem to reproduce this. What version of PHP are you running? Who is your host? Are you running any other plugins that deal with email?

#3 @skyynet
8 years ago

  • Version set to 2.5.8

Hi @thebrandonallen,

Yes, I still experience this problem. I'm currently running Wordpress 4.3.1 with BBpress 2.5.8-5815 an "bbPress auto subscribe for new topics and replies" plugin 1.0.
My PHP Version is 5.6.

I think the problem is caused by me using a subleveldomain. I assume when I use it on www.example.com the messages are sent from noreply@…. In my case the messages for (lets say) wordpress.example.com are sent from noreply@… which causes the error.

Maybe you can lead me to the class or module that figures out the sender based on the domain. There seems to be an error in that routine.

#4 @thebrandonallen
8 years ago

  • Keywords has-unit-tests added

The code, if you're interested in looking, is in the bbp_get_do_not_reply_address() function. However, the code is solid. I've written a unit test to check it, which I will attach to this ticket. The test passes on both single and multisite WP from 3.8 to trunk (what will soon be 4.4), and on PHP 5.2 to PHP 7.0.

Are you running any other plugins that deal with email? Maybe something in your theme's functions.php?

Also, because the test is passing, I will likely close this ticket move this conversation back into the support forums pretty soon unless we come across what is causing this quickly.

#5 @skyynet
8 years ago

  • Owner set to thebrandonallen

Sorry for the long delay. You led me to the position where I was able to fix the problem for my site. I don't know why it doesn't occur on other sites.

My site is named like schule.sitename.de and always accessed via SSL.

When I extend functions.php to

<?php
function bbp_get_do_not_reply_address() {
        $sitename = strtolower( $_SERVER['SERVER_NAME'] );
        if ( substr( $sitename, 0, 4 ) === 'www.' ) {
                $sitename = substr( $sitename, 4 );
        }
        // begin workaround subdomain always sent as noreply@chule.sitename.de
        elseif ( substr( $sitename, 0, 7 ) === 'schule.' ) {
                $sitename = substr( $sitename, 7 );
        }
        // end workaround
        return apply_filters( 'bbp_get_do_not_reply_address', 'noreply@' . $sitename );
}

it works. Is it somehow possible that the problem is caused by accessing the site via ssl? Thus there is one character more in https://schule.sitename.de than in http://schule.sitename.de
Just guessing...

Ingo

#6 @thebrandonallen
8 years ago

  • Component changed from Component - Forums to API - Subscriptions
  • Keywords has-patch added; reporter-feedback has-unit-tests removed
  • Milestone changed from Awaiting Review to 2.6

Moving this to 2.6, so the test can be committed. Then, I suggest we close.

#7 @skyynet
8 years ago

Did you find anything to address my problem or does it only occur on my system?
If there is anything I should test just drop me a note.

#9 @netweb
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6048:

Tests: Add test_bbp_get_do_not_reply_address() common functions reply email address test

Props thebrandonallen
Fixes #2822

Note: See TracTickets for help on using tickets.