Posts Tagged ‘PHPBB3’
ed. This has been tested and amended to include v3.04, v3.05, v3.06 of PHPBB3
I use PHPBB3 for my niche forums that I own. It’s powerful open source software, and I highly recommend it.
However on certain servers the emails that the PHPBB3 software sends out have incomplete header information. Now in PHPBB3 defense they do specify all the header information in their code, but it’s only on certain server configurations that you need to go one extra step further. Hopefully one day they will add this to their core code.
Here is the problem, the return-path and envelope-from fields are not marked with the forum email address. They are marked with the servers nobody email address.
Return-path: < nobody@server.com >
Envelope-to: user@forumuser.com
Delivery-date: Sat, 04 Apr 2009 22:22:21 +1000
Received: from nobody by server.com with local (Exim 4.69)
(envelope-from < nobody@server.com >)
id 1Lq4tB-0000vz-FW
for user@forumuser.com; Sat, 04 Apr 2009 22:22:21 +1000
What this means is that any bounce messages will go to the server admin (if they are even looking) and not back to the individual PHPBB3 board administrator for them to take action on it.
Unfortunately a core code hack is required to fix this, and this will need to be re-applied each time PHPBB3 has an upgrade. But it’s only a couple of lines of code, so it’s easy.
You want to edit the /includes/functions_messenger.php file…
Find this code (there are 2 instances of this code to change in v3.04, v3.05 and 1 instance of this code in v3.06)
ob_start(); $result = $config['email_function_name']($mail_to, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $headers); $err_msg = ob_get_clean();
and make it this code
ob_start(); $result = $config['email_function_name']($mail_to, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $headers, "-f" . $config['board_email']); $err_msg = ob_get_clean();
What that does is add in the 5th parameter to the PHP sendmail function which is for specifying the return-path and envelope-from fields.
Now your output will look like this
Return-path: < forumadmin@messageboard.com >
Envelope-to: user@forumuser.com
Delivery-date: Sat, 04 Apr 2009 22:33:17 +1000
Received: from nobody by server.com with local (Exim 4.69)
(envelope-from < forumadmin@messageboard.com >)
id 1Lq53l-000177-Nx
for user@forumuser.com; Sat, 04 Apr 2009 22:33:17 +1000
and any bounces or PHPBB3 sent email issues will come back to you personally and not your hosting server admin.
Aaron