OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



email log ok but emails not sent

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

email log ok but emails not sent

Postby inesgj » Fri Feb 01, 2013 1:57 am

After some months of proper working, emails are not sent out from the journal.

We are using the default email settings (mail(), not smtp), and the email log is correct within the system. No error message is shown. But the emails never reach the recipients. It was working ok until some days ago. We didn't change anything in the config.inc.php regarding email settings.
We did change the database password and added a second admin user, who is the main one now.

Any idea of where the problem could be?

Thank you very much
inesgj
 
Posts: 6
Joined: Tue Aug 28, 2012 9:38 am

Re: email log ok but emails not sent

Postby asmecher » Fri Feb 01, 2013 9:04 am

Hi inesgj,

I'd suggest attempting to send yourself an email and checking whether the email comes through (or gets trapped in a spam filter). Each mail service will have its own quirks and policies (e.g. some may have pickier spam filters than others) but that will at least confirm that your mail delivery configuration is sound. Then do some reading on Sender Policy Framework and consider trying the patch at http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=8085. More and more mail servers are starting to use this and it limits what kinds of email OJS can send.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: email log ok but emails not sent

Postby inesgj » Fri Feb 01, 2013 11:38 am

Thank you Alec
I had checked that it was not a spam problem; emails are not received (I have confirmed that with different users and different emails: institutional accounts, yahoo, gmail, the one provided by our server, ...).
I will check the patch, but I don't think it will solve the problem. I know it is very strange because it worked very well before, and even now the email log is correct in each submission history, but the emails don't get out. Any idea?

Thank you very much for your help
inesgj
 
Posts: 6
Joined: Tue Aug 28, 2012 9:38 am

Re: email log ok but emails not sent

Postby asmecher » Fri Feb 01, 2013 12:17 pm

Hi inesgj,

If you have access to the server's mail delivery logs, that would be a good place to look. The mail delivery agent may be accepting the messages for delivery from OJS and then binning them for some reason; in that case OJS will log them as sent even though they won't be received.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: email log ok but emails not sent

Postby inesgj » Mon Feb 04, 2013 3:28 am

Thank you Alec
you were right, the emails were blocked by the server, now it is ok, thank you very much
Cordially
Inés
inesgj
 
Posts: 6
Joined: Tue Aug 28, 2012 9:38 am

Re: email log ok but emails not sent

Postby kennymatthew » Thu Sep 12, 2013 3:25 am

Hi,

I am also using the default mail and not SMTP. I am using godaddy linux server and suddenly today I cannot sent emails from OJS. Please advice. but the ojs email logs are saying that the emails are sent.
I uploaded the php file to the go daddy server and ran it and I received an email. so could the issue be with ojs ?

Code: Select all
<?php
 $to = "kennymatthew@gmail.com";
 $subject = "Hi!";
 $body = "Hi,\n\nHow are you?";
 if (mail($to, $subject, $body)) {
   echo("<p>Email successfully sent!</p>");
  } else {
   echo("<p>Email delivery failed…</p>");
  }
 ?>



update:: I checked with go daddy and they also said that they cant find anything wrong from their side they loaded a custom mail script and it ran without a problem. I sent him the function.mailto.php file hoping he could find something out. Said that maybe I need to update smarty .

I am running OJS ver 2.3.8.0 and my server PHP version is 5.3 FYI
Please advice. This is very urgent

Kenny
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: email log ok but emails not sent

Postby asmecher » Thu Sep 12, 2013 8:53 am

Hi Kenny,

The call to php's mail() function is in lib/pkp/classes/core/String.inc.php; I'd suggest modifying that function to dump out what's being passed to the mail() function and testing with those values until you can identify the problem.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: email log ok but emails not sent

Postby kennymatthew » Fri Sep 13, 2013 1:12 am

IS this the part you are talking about

Code: Select all
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
      if (empty($additional_parameters)) {
         return mail($to, $subject, $message, $additional_headers);
      } else {
         return mail($to, $subject, $message, $additional_headers, $additional_parameters);
      }
   }


could you please tell me what should I change. I don't know what to do. returning call to the same function? Will it not go into a infinite loop?


UPDATE: i tried this code
Code: Select all
/**
    * @see http://ca.php.net/manual/en/function.mail.php
    */
   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
        echo "to:    ".$to."<br><br>";
        echo "subject:      ".$subject."<br><br>";
        echo "message:      ".$message."<br><br>";
        echo "add_head:     ".$additional_headers."<br><br>";
        echo "Add_para:     ".$additional_parameters."<br><br>";
       
      if (empty($additional_parameters)) {
         return mail($to, $subject, $message, $additional_headers);
      } else {
         return mail($to, $subject, $message, $additional_headers, $additional_parameters);
      }
   }


output:

to: kennymatthew@gmail.com

subject: test subject

message: test body ________________________________________________________________________ Journal of Engineering Research http://www.kuwaitjournals.org/jer Email: jer@ku.edu.kw - jerkuwait@gmail.com P.O.Box 17225, Khaldiyah 72453, KUWAIT Tel: (+965) 2481 6261 (Dir), (+965) 24984625, 24984414, 24984456 Fax: (+965) 2484 6725

add_head: Content-Type: text/plain; charset="utf-8" X-Mailer: Public Knowledge Project Suite v2 X-Originating-IP: 50.23.113.245 Date: Fri, 13 Sep 2013 05:58:39 -0700 From: "Kenny Mathew"

Add_para:
Attachments
email.png
snapshot of email
email.png (13.16 KiB) Viewed 1687 times
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: email log ok but emails not sent

Postby asmecher » Fri Sep 13, 2013 8:17 am

Hi Kenny,

Now try a test script as you did above, gradually adapting it to the values you got from OJS one step at a time until the email stops being received. That'll narrow down to what part of the email was causing it to be rejected. (This would be easier if you had access to the server's mail logs, as they usually indicate this kind of thing.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: email log ok but emails not sent

Postby kennymatthew » Sat Sep 14, 2013 1:25 am

gradually adapting it to the values you got from OJS one step at a time until the email stops being received.


I did not understand what you said. Like i said before I have not been able to send emails from OJS for last 2 days. Even when i sent the test email to my gmail account. I still haven't received that email
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: email log ok but emails not sent

Postby kennymatthew » Sat Sep 14, 2013 10:03 pm

Hi,

Dont know how, but after reading somewhere I created a php5.ini file with line
Code: Select all
cgi.fix_pathinfo=1
in the root folder and for now the emails started working. Is it ok to have php.ini and php5.ini files together in the root directory?



UPdate: is there a char limit when sending emails ? today i noticed that all emails which had very few lines (4-5 max) are being sent. But emails with hig number of char. are not send. Please advice
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: email log ok but emails not sent

Postby asmecher » Mon Sep 16, 2013 7:09 am

Hi kennymatthew,

The fix_pathinfo directive is not related to emails, so I suspect it's a coincidence. There is no character limit. If you have access to your mail server log, it'll help a lot in debugging; I don't think OJS is the issue here.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: email log ok but emails not sent

Postby kennymatthew » Mon Sep 16, 2013 7:16 am

Hi,

since i am using a shared server, godaddy is not letting me see the logs. But when i tried to send the emails b4 the php5.ini change they were checking the logs and asked me to send a few emails. I tried and they said they could not see any emails in the log. Currently whatz happening is that few emails are going through .... like maybe 1 in every 4 emails will not go. any idea what could be the issue ? when i made a test php mail ( ) function i sent around 10-20 emails to different people and there was never an issue.
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Re: email log ok but emails not sent

Postby asmecher » Mon Sep 16, 2013 7:25 am

Hi kennymatthew,

I would suggest using the error_log function to record what's getting sent to the mail() function in OJS, then sending the GoDaddy folks the resulting record. If they can correlate against the server email log, that will help. However, without access to the logs, you're shooting blind.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8470
Joined: Wed Aug 10, 2005 12:56 pm

Re: email log ok but emails not sent

Postby kennymatthew » Mon Sep 16, 2013 7:38 am

Dont we already know whatz being sent when we tried the below code
Code: Select all
/**
    * @see http://ca.php.net/manual/en/function.mail.php
    */
   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
        echo "to:    ".$to."<br><br>";
        echo "subject:      ".$subject."<br><br>";
        echo "message:      ".$message."<br><br>";
        echo "add_head:     ".$additional_headers."<br><br>";
        echo "Add_para:     ".$additional_parameters."<br><br>";
       
      if (empty($additional_parameters)) {
         return mail($to, $subject, $message, $additional_headers);
      } else {
         return mail($to, $subject, $message, $additional_headers, $additional_parameters);
      }
   }
or you talking about some other function?
kennymatthew
 
Posts: 127
Joined: Wed Jan 09, 2013 11:49 pm

Next

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests