miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Problems with safe mode - sending emails fails

 
Author Karel II
Partaker
#1 | Posted: 21 May 2011 07:14 
When I try to register a new user on my forum (forum.prayer.cz), I receive the following warning (twice):

Warning: mail() [function.mail]: SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE in /data/www/htdocs/prayer.cz/forum/bb_functions.php on line 242

Some time ago I have also noticed that I no longer receive any email notifications (as admin I have read the manual and have the corresponding variables set as follows

$emailadmposts=1;
$emailadmin=1;
$genEmailDisable=0;

but I do not receive notifications about new users neither about new posts/replies. I have tried using different admin email addresses and checked spam folder more than once.

I am not aware of making any relevant changes which could potentially disable this functionality. (It is possible that my webhosting provider changed something.)

I use mail function in my PHP own scripts (unrelated to minibb, but within the same hosting) and it works fine.

Any ideas about what to check, what to ask my provider etc. to solve this problem? Should I try to remove this fifth parameter from mail function whenever it is used? Or is there some more elegant solution? Could it (safe mode) be related to not receiving the notifications?

(I use minibb for several years already and these notifications always worked great until they stopped working suddenly.)

Author Paul
Lead Developer 
#2 | Posted: 23 May 2011 03:39 
Karel II:
It is possible that my webhosting provider changed something
Most likely this is the reason.

Make sure first that the regular mail function is working. Run a simple script like this below, substituting your own email address, and check if it really works.

<?php
mail('your_email_here@your_domain', 'subject test', 'body test');
?>
Depending on your result, you have to investigate it further. If even the simple default mail() function of PHP doesn't work, surely miniBB extended function will not work, too.

Running in Safe Mode also is not perfect. You may ask your provider what is the reason of turning this option on, and is it possible to change it. In Safe Mode, sending emails may also be disabled.

Karel II:
Should I try to remove this fifth parameter from mail function whenever it is used?
This may help. It's in bb_functions.php -> sendMail() ->

if(defined('EMAIL_NO_FLAGS')) $noFlag='-r'.$errors_email; else $noFlag='';
mail($email, $subject, $msg, $from_email, $noFlag);
try to remove $noFlag in mail() function.

Also, ask your provider what MTA is used for sending emails. Is it Postfix, or Qmail or Sendmail?

Let us know the results. I am working on a new miniBB version where sendMail() function will be a bit improved regarding meeting RFC compatibility and Postfix. I could provide you updated functions, so you may try them out, may be this will help. You know my email :)

Author Karel II
Partaker
#3 | Posted: 23 May 2011 11:50 
Thank you for your reply.

Removing the 5th parameter was enough to solve the problem, now it works fine again. Sorry for bothering you, should have tried it first without asking.

Does it make all your remaining questions obsolete? (I'll ask my provider about this specific issue (using $additional_parameters in mail() function) anyway.)

Author Paul
Lead Developer 
#4 | Posted: 23 May 2011 11:54 
If removing the 5th parameter helped, still try to ask your provider why it is so - but I think, most probably it's related to Safe Mode.

I'll take this into consideration when working out the new version. Thank you for report!

Author Karel II
Partaker
#5 | Posted: 24 May 2011 03:44 
They (my provider) confirmed to me that it is so, as described in the PHP manual:

http://www.php.net/manual/en/features.safe-mode.functions.php

They use safe mode "for security reasons" and I am definitely not in a position to doubt their security reasons :).

Author Paul
Lead Developer 
#6 | Posted: 24 May 2011 04:37 
I see it now.

In safe mode, the fifth parameter is disabled. (note: only affected since PHP 4.2.3)

Thanks! I'll take it into consideration when working out the new release.

Author Vishal
Partaker
#7 | Posted: 12 Dec 2011 11:49 
Same here. Just changed hosts and someone notified me that email notifications are no longer working. Removed the fifth parameter and it's working again now.

Author Paul
Lead Developer 
#8 | Posted: 12 Dec 2011 13:46 
This will be fixed in the newest version that way:

if(!defined('EMAIL_NO_FLAGS')) mail($email, $subject, $msg, $from_email);
else mail($email, $subject, $msg, $from_email, '-r'.$errors_email);
so next time, if you move the website, or server settings change, just put or disable in setup_options.php:

define('EMAIL_NO_FLAGS', 1);
if this setting is defined, the script will send emails with the 5th parameter, as in Safe Mode.

Author Vishal
Partaker
#9 | Posted: 14 Dec 2011 12:43 
Thanks Paul!

Specific miniBB Support Forums / Specific /
 Problems with safe mode - sending emails fails
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑