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) »
  • 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings
Pages: [1]

Author Topic: 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings  (Read 1805 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
3.4 - form parameters not passed when saving-and-testing Outbound Mail settings
June 03, 2011, 05:22:10 am
This affects 3.4.1 and 3.4.2.

In CRM/Admin/Form/Setting/Smtp.php:postProcess() the form parameters are collected into $params but not passed to the Mailer prior to calling send().

Observations

I can successfully send emails but I can't save-and-test the Outbound Mail settings.

Analysis

I tell CiviCRM to use SMTP with authentication and connecting via a non-standard port. However, when testing the Outbound Mail settings, CiviCRM uses port 25 and doesn't appear to use authentication (my port 25 doesn't offer authentication, so I can't tell whether CiviCRM is wishing to authenticate or not).

Here's the difference in my server's mail.log file between a successful email send (first line) and a failed save-and-test (second line) ...
Quote
postfix/smtpd[7592]: 48D181AA5C3: client=localhost[127.0.0.1], sasl_method=LOGIN, sasl_username=********
postfix/smtpd[7244]: connect from localhost[127.0.0.1]

Here's the start of my 7Mb (!) error log ...
Quote
Jun 03 20:36:19  [info] $Ignoring exception thrown here = PEAR_Error Object
(
    [error_message_prefix] =>
    [mode] => 16
    [level] => 1024
    [ code ] =>
    [message] => Invalid response code received from SMTP (outbound mail) server while attempting to send email.  This is often caused by a misconfiguration in the CiviCRM Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP).
    [userinfo] =>
    [backtrace] => Array
        (
            [ 0 ] => Array
                (
                    [file] => /var/www/pearl/sites/all/modules/civicrm/packages/PEAR.php
                    [line] => 566
                    [function] => PEAR_Error
                    [class] => PEAR_Error
                    [type] => ->
                    [args] => Array
                        (
                            [ 0 ] => Invalid response code received from SMTP (outbound mail) server while attempting to send email.  This is often caused by a misconfiguration in the CiviCRM Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP).
                            [1] =>
                            [2] => 16
                            [3] => Array
                                (
                                    [ 0 ] => CRM_Core_Error
                                    [1] => nullHandler
                                )

                            [4] =>
                        )

                )

            [1] => Array
                (
                    [file] => /var/www/pearl/sites/all/modules/civicrm/packages/Net/SMTP.php
                    [line] => 349
                    [function] => raiseError
                    [class] => PEAR
                    [object] => Net_SMTP Object
                        (
                            [host] => localhost
                            [port] => 25
                            [localhost] => localhost
                            [auth_methods] => Array
                                (
                                    [ 0 ] => DIGEST-MD5
                                    [1] => CRAM-MD5
                                    [2] => LOGIN
                                    [3] => PLAIN
                                )

                            [pipelining] =>
                            [_pipelined_commands] => 0
                            [_debug] =>
                            [_debug_handler] =>
                            [_socket] => Net_Socket Object
                                (
                                    [fp] => Resource id #316
                                    [blocking] => 1
                                    [persistent] =>
                                    [addr] => 127.0.0.1
                                    [port] => 25
                                    [timeout] =>
                                    [lineLength] => 2048
                                    [_debug] =>
                                    [_default_error_mode] =>
                                    [_default_error_options] =>
                                    [_default_error_handler] =>
                                    [_error_class] => PEAR_Error
                                    [_expected_errors] => Array
                                        (
                                        )

                                )

                            [_code] => 554
                            [_arguments] => Array
                                (
                                    [ 0 ] => 5.7.1 Invalid HELO Format .
                                )

                            [_greeting] => ******** ESMTP
                            [_esmtp] => Array
                                (
                                    [********] =>
                                    [SIZE] => 10240000
                                    [VRFY] =>
                                    [ETRN] =>
                                    [ENHANCEDSTATUSCODES] =>
                                    [8BITMIME] =>
                                    [DSN] =>
                                )

                        )

                    [type] => ->
                    [args] => Array
                        (
                            [ 0 ] => Invalid response code received from SMTP (outbound mail) server while attempting to send email.  This is often caused by a misconfiguration in the CiviCRM Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP).
                        )

                )

Note that CiviCRM is attempting to connect to port 25.

Also, further up the call stack, the form has collected the supplied arguments ...

Quote
           [5] => Array
                (
                    [file] => /var/www/pearl/sites/all/modules/civicrm/CRM/Core/Form.php
                    [line] => 250
                    [function] => postProcess
                    [class] => CRM_Admin_Form_Setting_Smtp
                    [object] => CRM_Admin_Form_Setting_Smtp Object
                        (
                            [_testButtonName:protected] => _qf_Smtp_refresh_test
                            [_defaults:protected] => Array
                                (
                                    [qfKey] => ********************************
                                    [outBound_option] => 0
                                    [sendmail_path] =>
                                    [sendmail_args] =>
                                    [smtpServer] => localhost
                                    [smtpPort] => ********
                                    [smtpAuth] => 1
                                    [smtpUsername] => ********
                                    [smtpPassword] => ********
                                )

The backtrace is ...
Quote
/var/www/pearl/sites/all/modules/civicrm/packages/PEAR.php, call_user_func, 931
/var/www/pearl/sites/all/modules/civicrm/packages/PEAR.php, PEAR_Error, 566
/var/www/pearl/sites/all/modules/civicrm/packages/Net/SMTP.php, raiseError, 349
/var/www/pearl/sites/all/modules/civicrm/packages/Net/SMTP.php, _parseResponse, 1004
/var/www/pearl/sites/all/modules/civicrm/packages/Mail/smtp.php, data, 313
/var/www/pearl/sites/all/modules/civicrm/CRM/Admin/Form/Setting/Smtp.php, send, 155
/var/www/pearl/sites/all/modules/civicrm/CRM/Core/Form.php, postProcess, 250
/var/www/pearl/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Refresh.php, mainProcess, 79
/var/www/pearl/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php, perform, 203
/var/www/pearl/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php, handle, 103
/var/www/pearl/sites/all/modules/civicrm/CRM/Core/Controller.php, handle, 284
/var/www/pearl/sites/all/modules/civicrm/CRM/Utils/Wrapper.php, run, 115
/var/www/pearl/sites/all/modules/civicrm/CRM/Core/Invoke.php, run, 195
/var/www/pearl/sites/all/modules/civicrm/drupal/civicrm.module, invoke, 363
, civicrm_invoke,
/var/www/pearl/includes/menu.inc, call_user_func_array, 349
/var/www/pearl/index.php, menu_execute_active_handler, 17

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings
June 08, 2011, 03:15:49 pm
Well spotted. Can you write a patch and create an issue ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

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: 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings
June 08, 2011, 04:04:11 pm

can you please file an issue for this. Can you test if this patch fixes the issue

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

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings
June 08, 2011, 07:07:57 pm
Lobo,

Your patch solves the problem for me (SMTP, both localhost and non-local host, non-standard port, authentication). Thanks!

I've created issue CRM-8272.

Ken

camber799

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 3.3.6
  • CMS version: Joomla 1.5.15
  • MySQL version: 5.0.92
  • PHP version: 5.2.11
Re: 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings
June 10, 2011, 11:22:31 am
From the patch I've added the line
$params = array( );
and
$mailer =& Mail::factory( $mailerName, $params );
already existed.

However, when I change the S M T P server I still receive the "your SMTP settings are incorrect" error message and the smtp server setting flashes corectly for a moment before the field reverts back to the admin user name (in this case "admin") rather than the S M T P server.

Using the same settings in Joomla Server Config, emails are sent successfully.

Thoughts?

Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • 3.4 - form parameters not passed when saving-and-testing Outbound Mail settings

This forum was archived on 2017-11-26.