CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • SMTP time out
Pages: [1]

Author Topic: SMTP time out  (Read 760 times)

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
SMTP time out
July 23, 2010, 10:44:33 am
We been having some issues with SMTP time out,

We have a SMTP server for bulk mailing and it requires authentication.


We been running into the following issues:

1. We get a 30 seconds time out during step 4 of a mailing (send test email)
2. Time out when trying to access the SMTP server settings (outbound email settings)
3. Sending an email from contact -> new email


This problem has largely affected our donation process which has to send out an email at the end.


In comparison, another deployment we have which uses localhost for SMTP server (The web host email server, without authentication) has been running smoothly without any time out issue.


I would guess this is a handshake, authentication time out related to the SMTP server, is there anyone else having the same problem. Or if the SMTP code has some flaws.

Also I just wanted to float the idea that if it is possible to have 2 sets of email settings, 1 for bulk mailing in CiviMail which mostly will be an external SMTP server (service) and 1 for administrative emails which can use the web host emails.



Any thoughts?


Chang

xcf33

  • I post frequently
  • ***
  • Posts: 181
  • Karma: 7
  • CiviCRM version: 3.3.2
  • CMS version: Drupal 6.19/6.20
  • MySQL version: 5.x
  • PHP version: 5.2.6
Re: SMTP time out [kinda solved :)]
July 26, 2010, 02:21:49 pm
I've checked out the code a little bit and tracked down the

email receipt call to

CRM/Utils/Mail.php
line 135
Code: [Select]
<?php
$mailer 
=& CRM_Core_Config::getMailer( );
?>


When I isolated and only called this one line in a standard along script, this took around 15 seconds to just get the mailer, in comparison when it is changed to

Code: [Select]
<?php
$mailer 
= CRM_Core_Config::getMailer( );
?>


Without the reference it is shaved to around 1 second, i know the =& is a lot of PHP 4 standard especially with object instantiation, is it necessary?

I've found from a few instances that with the reference =& in some civicrm code has caused memory leak and now timing out. I understand part of it is using code that are more than 5 or 6 years old.


Best


Chang

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: SMTP time out
July 26, 2010, 06:08:23 pm

that seems like a PHP bug / optimizer bug more than anything else

however since the mailer is an object, we can return it as is (and PHP will use references). wanna find all the places where we use getMailer( ) and fix them. Please file an issue along with a patch

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • SMTP time out

This forum was archived on 2017-11-26.