OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Potential bug in the outgoing mail function

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.

Potential bug in the outgoing mail function

Postby cewing » Fri Jun 29, 2007 10:50 am

Hi all,

I think I may have discovered a bug in the functions that handle outgoing mail. Not sure if it is specific to OJS or if it is a PHP problem

Here's the setup.

Create two users with the following parameters:

user1
username: 'joeblow'
first Name: 'Joe'
last name: 'Blow MD'
email address: 'some.address@email.com'
user2
username: 'joeblow'
first name: 'Joe'
last name: 'Blow, MD'
email address: 'some.address@email.com'

Next, try to send email from this user to yourself.

At least on my server, the email goes out, but in the second case the 'From' header gets mangled on the way.

From user1, the header looks like this:
Code: Select all
From: Joe Blow MD <some.address@email.com>


From user2, the header looks like this:
Code: Select all
From: Joe@d-NNN.NNN.NNN.NNN@dhcp.myschool.edu,
         Blow@d-NNN.NNN.NNN.NNN@dhcp.myschool.edu,
         MD <some.address@email.com>


It appears that the presence of the comma in the name portion of the outgoing from address is causing the address parsing function to flail about and attempt to treat each individual word as a separate entity. In my case, the outcome seems to be that since the first two 'entities' do not have email addresses of their own, PHP or OJS tries to generate one for them relative to the local machine, and thus the dhcp-based domain part.

I have not taken the time to investigate if this is a PHP problem or an OJS problem, but I can say that our configuration has us using the PHP mail function rather than SMTP mail.

I can also state that in the email editing page (where I get to write the text I want for the email I'm sending) the 'from' information shows up correctly. The field is not editable, and appears to be contructed from user->getFullName and user->getEmail.

The obvious, and easy workaround is to not put commas in name fields, but I can't imagine being able to convince all my registered users (600 and counting) that that is a bad idea. Many will do so anyway.

Perhaps the name fields could be validated to not contain commas?

Any ideas on what the culprit might be?

Cris
cewing
 
Posts: 16
Joined: Tue Jun 26, 2007 12:09 pm

Postby asmecher » Fri Jun 29, 2007 7:13 pm

Hi Cris,

This has already been corrected in CVS; see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=2407. You can try patching your installation with http://pkp.sfu.ca/cvs/cvsweb.cgi/ojs2/classes/mail/Mail.inc.php.diff?r1=1.34;r2=1.35.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8910
Joined: Wed Aug 10, 2005 12:56 pm

Postby cewing » Fri Jun 29, 2007 10:13 pm

Thanks again, Alec.

Is there an established method to check for bug reports before I post this kind of thing? I hadn't found any posts in these forums about this when I searched. Just want to make sure I'm contributing and not just kicking up dust. :wink:

Cris
cewing
 
Posts: 16
Joined: Tue Jun 26, 2007 12:09 pm

Postby asmecher » Sat Jun 30, 2007 1:50 am

Hi Cris,

It's no problem -- if you're running the most recent release (i.e. 2.1.1) and want to know what's been changed in CVS, do a search in Bugzilla for all closed bugs with the next version number (e.g. 2.2). Otherwise I'd be happy to answer questions here.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8910
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 2 guests