OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



sending mail using SMTP

Are you a Director, Presenter, Reviewer or Conference Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael

Forum rules
This forum is meant for general questions about the usability of OCS from an everyday user's perspective: conference managers, presenters, and directors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OCS 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 OCS:

1. Read the documentation. We've written documentation to cover from OCS 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 OCS 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 OCS Technical Support subforum; if you have a development question, try the OCS Development subforum.

sending mail using SMTP

Postby iluber » Mon Aug 04, 2008 3:35 am

Hi, I have installed OCS on my PC and I have to start to hack the code to begin to personalize some part of php code.
This to explain why I have to run OCS on my pc.

I have a problem sending e-mail: I have configured the SMTP use like this:

; Use SMTP for sending mail instead of mail(): comment to not use it
smtp = On

; SMTP server settings
smtp_server = out.aliceposta.it
smtp_port = 25

; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
smtp_auth = LOGIN
smtp_username = myUname
smtp_password = myPwd

When I try to generate an e-mail for recovering the password of a registered user I get no error on the user interface but in the apache log file I can find:

OJS SMTPMailer: Did not receive expected 250 (1)

Any suggestion ?
iluber
 
Posts: 30
Joined: Wed May 14, 2008 8:11 am
Location: Pisa, Italy

Re: sending mail using SMTP

Postby mcrider » Mon Aug 04, 2008 2:22 pm

Hi Ivano,

This probably means that the smtp server you are using is not configured properly, or the user you are sending the mail to has an invalid (i.e. non-existent) email address. It may be easier to test the SMTP settings if you download an email client (e.g. Thunderbird, eudora), input the SMTP settings, and send some test emails.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: sending mail using SMTP

Postby iluber » Mon Aug 04, 2008 11:50 pm

Ops mcrider, sorry: I forgot to say I had already tried it inside Thunderbird and it worked properly
iluber
 
Posts: 30
Joined: Wed May 14, 2008 8:11 am
Location: Pisa, Italy

Re: sending mail using SMTP

Postby istoyanov » Mon Oct 06, 2008 6:44 am

:!: NOTE: the below report concerns OJS (as I don't use OCS), but the problem seems related.

I generally don't have problem with e-mail from within OJS (using a working SMTP server/configuration), but a recent inspection of the log-file revealed exactly the same messages:
Code: Select all
OJS SMTPMailer: Did not receive expected 250 (3)


Strangely enough, these messages corresponded with apparently missing (i.e. never delivered) e-mail messages. Therefore I started an "investigation" to check if these messages could indicate any e-mail delivery problems.

All the tests were performed inder OJS 2.2.0.0 (running PHP 5.2.5 / MySQL 5.0.51a-community / Apache 1.3.39) while I was logged-in as "Editor" and tried to contact the author of a submission through all the possible feed-back links (i.e. envelope icons). The e-mailing system was set-up to use an external SMTP server tested to being functional by sending an message to the "Editor" from the "Journal manager".

1) Submission > #NN > SUMMARY / Submission / Authors $NAME [icon]: :!: e-mail was never delivered + accompanied message in the error-log (see above).

2) Submission > #NN > SUMMARY / Submission / Submitter $NAME [icon]: e-mail delivered OK.

3) Submission > #NN > SUMMARY / Submission / Submission Metadata / Authors / Name $NAME [icon]: e-mail delivered OK.

4) Submission > #NN > REVIEW / Submission / Authors $NAME [icon]: e-mail delivered OK.

5) Submission > #NN > REVIEW / Editor Decision / Notify Author [icon]: :!: e-mail was never delivered + corresponding message in the error-log.

6) Submission > #NN > EDITING / Submission / Authors $NAME [icon]: :!: e-mail was never delivered + corresponding message in the error-log (see below).
Code: Select all
OJS SMTPMailer: Did not receive expected 250 or 251


Summing up, the test e-mails were not delivered in three cases.

Getting more curious, I decided to disable the use of external SMTP server, replacing its functionality by the internal mailing function. As a result, all the above messaging possibilities delivered the test message successfully... :?:

I understand that the described test wasn't as exhaustive as it could be, but I suggest the results indicate a bug in the OJS SMTPMailer function, most probably related to Bug 2628[1].

[1] http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=2628?
istoyanov
 
Posts: 44
Joined: Mon Oct 29, 2007 6:04 am

Re: sending mail using SMTP

Postby otwr » Tue Oct 13, 2009 10:22 am

I just had this problem. After altering line 100 of classes/mail/SMTPMailer.inc.php (in OJS 2.2.3) to:

Code: Select all
return $this->disconnect('Did not receive expected 250 (2), sender: '.$sender);


it became obvious when reading the PHP error log that the journal manager had obfuscated his email in the preferences, so the mail class was rejecting the sender address as invalid. In this instance, a more descriptive error message would have been helpful...
otwr
 
Posts: 10
Joined: Mon Sep 15, 2008 12:44 pm

Re: sending mail using SMTP

Postby ramon » Fri Apr 30, 2010 8:01 am

Hello all!

I know this is an old topic, but a user is running into this SMTP issue.
He claims that when using 2.1 (we don't know the exact version), this didn't happen.
Only after upgrading to 2.2.3 the SMTP problem came up, and is intermittent.
Sometimes it doesn't happen, sometimes it does.
Checking the error message codes, what we manage to understand is that the SMTP is actually completing the task (250), but is "complaining" about an email address not being from the same domain, although the message will/should be forwarded (251).

How does the manager obfuscate his email address? Is this in OJS or somewhere else?

We ran into a similar issue in our hosting service. Changing the SMTP settings in ojs2/config.inc.php, enabling allow_envelope_sender and keeping default_envelope_sender commented apparently worked for us, but for this other journal it didn't. Would using regular email settings, without SMTP, i.e. with a local MTA service in the server, be a more reliable solution?
ramon
 
Posts: 929
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: sending mail using SMTP

Postby asmecher » Wed May 05, 2010 5:30 pm

Hi Ramón,

Is the email delivered in spite of the message? And when you say that the message is intermittent, do you mean that it sometimes appears and sometimes doesn't, without any variation in the message you send?

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

Re: sending mail using SMTP

Postby ramon » Mon May 17, 2010 6:37 pm

Hello Alec,

Sorry to respond so late, but I'm on vacation and I'm not checking email and forums so regularly.
In our case, some messages are not delivered at all, some get sent to the junk box.

For this other journal, apparently none of the options worked so far.
I can't confirm if the messages were received, sent to spam, trash or junk boxes or deleted.
From what I can understand, some messages get sent and received, while others don't, with no apparent pattern.
ramon
 
Posts: 929
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: sending mail using SMTP

Postby asmecher » Mon May 17, 2010 9:58 pm

Hi Ramón,

This is unfortunately very difficult to debug. If a message is caught in the spam folder, you can usually look at its headers to determine why; if nothing is received at all, the best thing to do is probably to check the server's mail sending log to see if there is any record of the messages there.

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

Re: sending mail using SMTP

Postby ramon » Wed Jun 23, 2010 6:21 am

Hello Alec,

Thanks for the response.
We haven't been able to fix our e-mail problems.
We use the following setup:
A central e-mail server receives all request for message distribution from other servers and systems.
These servers have independent MTA (Postfix) services installed, which relay to the central server.
Analyzing server logs we noticed that many messages, especially the requests for new password (which contain URLs), were not even sent out by the local MTA server to the central server.

Unfortunately, we have not been able to successfully solve this problem and we'd like to know how PKP does it for their hosting service.
Anyone with similar issues and possible solutions?
ramon
 
Posts: 929
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: sending mail using SMTP

Postby asmecher » Wed Jun 23, 2010 1:05 pm

Hi Ramón,

We use a local MTA for all our OJS/OCS installations -- exim if I recall correctly -- without any particular configuration quirks. If you've narrowed down the problem to your local MTA, that's more than half the battle. IIRC there were some quirks in the mail() function for various versions of PHP, so you might try experimenting with accented characters to see if that's what triggers the problem; alternately, you could try configuring local SMTP in config.inc.php.

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

Re: sending mail using SMTP

Postby libranto » Thu Jul 29, 2010 1:57 am

I have same problem wiht OJS. My host is win 2008 server. I tried all of stmp conf. combinations but couldn send an e-mail :(

i dont know where the problem is. Mail server and my account work properly. Can firewall block mail response traffic? Or my client's hosting company restrics stmp issues? Any idea? Another ways to send emals with OJS?

Thank you,
libranto
 
Posts: 3
Joined: Fri May 28, 2010 10:13 pm

Re: sending mail using SMTP

Postby jmacgreg » Thu Jul 29, 2010 4:11 pm

Hi Libranto,

You may have some luck contacting your service provider to see if they can offer any solutions; and also to find out how other clients handle other application mail configurations.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: sending mail using SMTP

Postby libranto » Sat Jul 31, 2010 7:49 pm

Thank you James (:

Server administrator solved issue. Now, system can send e-mails without attachmets ): (I enabled attachments on config file)

My last and very important problem is "reset password". Email works properly, when users click on reseting link, redirected page gives this error.:

Code: Select all
Notice: Undefined variable: email in D:\inetpub\vhosts\mydomain\httpdocs\pages\login\LoginHandler.inc.php on line 256

Fatal error: Call to a member function setFrom() on a non-object in D:\inetpub\vhosts\mydomain\httpdocs\pages\login\LoginHandler.inc.php on line 256


Any ideas for those problems?

Thanks,
libranto
 
Posts: 3
Joined: Fri May 28, 2010 10:13 pm

Re: sending mail using SMTP

Postby jmacgreg » Wed Aug 04, 2010 9:20 am

Hi Libranto,

Depending on which version of OJS you are using, you may be running into the following problem: viewtopic.php?f=2&t=4523. There's a bug report and patch linked to from that thread. If this doesn't look like your problem, please let me know which version of OJS you are using, and whether you have made any code changes.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Next

Return to OCS Conference Support and Discussion

Who is online

Users browsing this forum: No registered users and 1 guest