browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

bbpress plugin for SMTP Auth

Posted by on June 25, 2008

SMTP Relay:
Many hosting providers (including the one I work for) no longer allowing open relay from their web servers. Open relay allows for spammers to find holes and bugs in code and then inject mail via a vulnerable website to the service providers mail server. This mail gets accepted and sent on to various recipients as the mail is assumed to have come from a valid/trusted source.

This motivated me to created a plugin for bbpress to enable SMTP Authentication by using PEAR Mail.php
If you would like to make use of this plugin, please feel free to grab a copy.

The plugin:
Download the file (below) and copy it into the bb-plugins folder.
Edit this file and enter your email address and password.

Next, edit the bb-includes/pluggables.php and make the following changes.

Locate the end of the “bb_mail function” (About line 536).
Find the line that reads “return @mail($to, $subject, $message, $headers);”
and replace it with the following 2 lines:

if ( !function_exists( ‘pear_mailer’ ) ) { return @mail($to, $subject, $message, $headers);}
else { return pear_mailer($to, $subject, $message, $headers); }

Now, log into bbpress as admin, and go to the plugins section to activate the plugin.

Download the plugin here

I found that on some servers, the /usr/share/php is often not accessible. While not 100% sure, it may be related to settings in your php.ini, php_safemode or even file system permissions.
If you add /usr/share/php to the setting open_basedir your php.ini, it will solve the problem.
You can also use “php_admin_value open_basedir” in your vhost.conf or your .htaccess file, depending on what your server allows.

This is a problem with pear / php / apache (actually mostly just php settings), not the plugin.

Comments are closed.