Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-02-14 13:09:53

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

mail(): Policy restriction in effect. The fifth parameter is disabled

I get this error when I try to add new users.

Notice “mail(): Policy restriction in effect. The fifth parameter is disabled on this system”
in mysite/textpattern/vendors/Textpattern/Mail/Adapter/Mail.php at line 236.

adminErrorHandler()
textpattern/vendors/Textpattern/Mail/Adapter/Mail.php:236 mail()
textpattern/lib/txplib_misc.php:2785 Textpattern\Mail\Adapter\Mail->send()
textpattern/lib/txplib_admin.php:70 txpMail()
textpattern/include/txp_admin.php:163 send_account_activation()
textpattern/include/txp_admin.php:55 author_save_new()
textpattern/index.php:255 include()

My hosting provider is One.com. When I ask them about this “policy restriction”, they say no such restriction exists, and I should contact the developer of my cms.

This is a new thing, I’ve been using one.com for dozens of clients since 2007, and it’s always been fine.

Has anybody else had this issue?

Offline

#2 2019-02-14 13:44:04

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

helsinkifrostbites wrote #316593:

My hosting provider is One.com. When I ask them about this “policy restriction”, they say no such restriction exists, and I should contact the developer of my cms.

This is a new thing, I’ve been using one.com for dozens of clients since 2007, and it’s always been fine.

Has anybody else had this issue?

Many people on one.com seem to have this problem. Why has it appeared all of a sudden? PHP version upgrade, SMTP envelope sender address preference set, open_basedir switched on, -f flag lacking a space after it in txp Mail.php file? If you can check some of these, please share.

Offline

#3 2019-02-14 13:58:44

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

They did recently upgrade to PHP 7.2, and it’s after that that this started.

I tried setting the SMTP envelope sender address, it didn’t make any difference.

where can I see if open_basedir is on or off?

Mail.php has this on line 234:

$additional_headers = ($this->smtpFrom ? '-f'.$this->smtpFrom : null);

Doesn’t look like there’s a space there, where is it supposed to go? After the -f but inside or outside the single quotes?

Offline

#4 2019-02-14 14:02:57

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

The users do get added to the txp_users table, and I can change their password via phpMyAdmin, but that’s not going to be great when my client wants to add new users themselves…

Offline

#5 2019-02-14 14:14:27

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

Try to replace '-f' with '-f ', though I’m purely googling here. And since it’s just a notice, you can try to prepend mail(...) with @ to disable the warning. Or simply remove its fifth , $additional_headers argument.

Thanks for testing :-)

Offline

#6 2019-02-14 16:20:18

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

Putting a space in '-f ' didn’t have any effect.

Removing the , $additional_headers argument did something, because the original error message and all the adminErrorHandler() stuff doesn’t show up anymore. But I still get Could not send email only now with no explanation.

Offline

#7 2019-02-14 16:28:57

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

And yes, one.com says:

One.com’s servers run with safe mode set to off and with open basedir set to on.

Offline

#8 2019-02-14 17:01:22

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: mail(): Policy restriction in effect. The fifth parameter is disabled

No clue, maybe this:

Note that the “To” or “From” address must be an active email account on your domain with One.com.

Offline

Board footer

Powered by FluxBB