OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



OJS 2 Email (safe mode) problem

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

OJS 2 Email (safe mode) problem

Postby pashton » Mon Jul 11, 2005 7:06 am

Hi

Whenever I try to use the email function function in the site it fails (that is when I try to send any email). The 'fifth parameter' seems to be poping up in a number of place. Any ideas of a solution if you can't change SAFE MODE. (This is probably linked to my last post)

Regards
Paul

Warning: mail(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in/home/cosmosan/public_html/classes/core/String.inc.php on line 155

Warning: Cannot modify header information - headers already sent by (output started at /home/cosmosan/public_html/classes/core/String.inc.php:155) in/home/cosmosan/public_html/classes/core/Request.inc.php on line 32
pashton
 
Posts: 38
Joined: Fri Dec 17, 2004 5:51 pm

Postby kevin » Mon Jul 11, 2005 8:52 am

Assuming that mail is still getting send out, you could "fix" this by editing classes/core/String.inc.php and changing "return mail(...)" to "return @mail(...)". That would suppress the warning message.

The only functionality lost by not being able to pass the additional parameter is the ability to set the envelope sender in outgoing mail (useful for bounces).
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

emails not being sent

Postby pashton » Fri Jul 15, 2005 11:06 pm

Thanks Kevin,

Yes this has removed the error but the email itsef is not being sent. I have an operational version of 1.x and it sends emails o.k. so it is unlikely the server configuration.

Any ideas?

Regards
Paul
pashton
 
Posts: 38
Joined: Fri Dec 17, 2004 5:51 pm

Postby kevin » Fri Jul 15, 2005 11:56 pm

Does removing the actual parameter from the mail() call work?
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

Postby pashton » Sat Jul 16, 2005 12:18 am

I am not sure exactly what you mean by this.

But if you mean

1) to remove the line 'return mail....' Then no it does not

or

2) to remove the contents of the () after the word mail then no it does not eiher

Sorry to be a bit vague.

Regards

Paul
pashton
 
Posts: 38
Joined: Fri Dec 17, 2004 5:51 pm

Postby kevin » Sat Jul 16, 2005 12:26 am

I've tested this now and removing the last parameter does indeed do the trick.

The most appropriate fix seems to be something like:

Code: Select all
Index: classes/core/String.inc.php
===================================================================
RCS file: /cvs/ojs2/classes/core/String.inc.php,v
retrieving revision 1.3
diff -u -r1.3 String.inc.php
--- classes/core/String.inc.php 16 Jun 2005 20:28:05 -0000      1.3
+++ classes/core/String.inc.php 16 Jul 2005 07:24:13 -0000
@@ -151,8 +151,11 @@
        function mail($to, $subject, $message, $additional_headers = '', $additional_parameters = '') {
                // Cannot use mb_send_mail as it base64 encodes the whole body of the email,
                // making it useless for multipart emails
-
-               return mail($to, $subject, $message, $additional_headers, $additional_parameters);
+               if (empty($additional_parameters)) {
+                       return mail($to, $subject, $message, $additional_headers);
+               } else {
+                       return mail($to, $subject, $message, $additional_headers, $additional_parameters);
+               }
        }
 
        //


So this will work correctly in safe mode (so long as allow_envelope_sender is not enabled in config.inc.php) and also work correctly in non-safe mode.
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

Postby pashton » Sat Jul 16, 2005 1:04 am

Thanks again (again) Kevin,

That worked well.

Just one other thing that may or may not be related. The emails sent have the following code:

{$journalName}
{$indexUrl}/{$journalPath}

Is this a call to some data or are you supposed to edit step 1.4 of the journal setup to 'real' names.

Regards Paul
pashton
 
Posts: 38
Joined: Fri Dec 17, 2004 5:51 pm

Postby kevin » Sat Jul 16, 2005 12:12 pm

Check the "Email Identification" field in Journal Setup step 1. Those variables should have been replaced with the real values when the journal was created.
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 3 guests