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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Outgoing mail trying to use localhost instead of SMTP server
Pages: [1]

Author Topic: Outgoing mail trying to use localhost instead of SMTP server  (Read 2849 times)

nmphil

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Outgoing mail trying to use localhost instead of SMTP server
May 17, 2011, 10:22:21 am
This one is driving me nuts and I'm only a day from launch!

In the outbound mail settings, I have it set to SMTP, with the proper server settings. When I press Save & Send Test E-mail it failed. First with an "Relaying Denied" message.

I checked the postfix logs on the same server and saw that it was trying to use localhost instead of mail.mydomain.org which resides on a different server. So I killed postfix on the local machine (don't need it anymore anyway), and now get "Failed to connect to localhost:25 [SMTP: Failed to connect socket: Connection refused (code: -1, response: )]"... which I would expect.

But it's still trying to use localhost instead of mail.mydomain.org.

CiviCRM 4.0, Drupal 7.

Any thoughts on this one?

Thanks in advance!

nmphil

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Re: Outgoing mail trying to use localhost instead of SMTP server
May 17, 2011, 10:59:13 am
OK, Update -- it's using localhost, period. After I shut off postfix on the local machine I tried to use mail() and none of those went through. Until I started postfix again.

nmphil

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Re: Outgoing mail trying to use localhost instead of SMTP server
May 17, 2011, 11:25:30 am
Bug? Badd install? Settings seem to work just fine if you send mail from another section -- i.e. headers show message coming from correct server. If you try to send a test it always tries to use localhost smtp and fails. I think it's failing because it's trying to authenticate a non-existent user -- so the authentication settings work, but it's hitting the wrong server.

Moving on...

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: Outgoing mail trying to use localhost instead of SMTP server
May 17, 2011, 11:36:31 am

i tried this on my local D7 install and switched between an external smtp server and localhost and it worked fine

not sure why u r seeing that behavior. Would help a lot if u can check the code here and figure out whats happening:

CRM/Admin/Form/Setting/Smtp.php, function postProcess search for "test button"

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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Outgoing mail trying to use localhost instead of SMTP server
May 17, 2011, 12:05:56 pm
With postfix running does mail() work?

I wonder if you have local /etc/hosts or some other DNS setting that is mapping your desired SMTP destination to localhost?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

nmphil

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Re: Outgoing mail trying to use localhost instead of SMTP server
May 18, 2011, 02:00:01 pm
mail() does work with postfix running.

Now I'm testing with CiviMail and it's not sending either... can't find a trace of where it's going... mail() doesn't even work.

?????

nmphil

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.0.77
  • PHP version: 5.2.10
Re: Outgoing mail trying to use localhost instead of SMTP server
May 18, 2011, 02:01:01 pm
Oh, and hosts file is OK. All name lookups map correct properly.

kmas

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: drupal 6.22
  • MySQL version: 5.1.41
  • PHP version: 5.3.2
Re: Outgoing mail trying to use localhost instead of SMTP server
June 10, 2011, 10:22:35 pm
I'm facing the same problem. I even tried versions 3.4.1 and 4.0.2 with exact same behavior.

mail(): works fine if local sendmail/postfix is available.
smtp: apparently doesn't look at the smtp server configuration.

I guess we need a "howto" link to figure out how to configure it in the first place as it seems that it's a more basic configuration issue rather than a bug. I've been searching for the right configuration for a week now, with no luck so far!

Any help will be highly appreciated.

Thanks!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Outgoing mail trying to use localhost instead of SMTP server
June 11, 2011, 02:20:43 am
Hi,

That's what I did try to do there.

http://forum.civicrm.org/index.php/topic,16430.0.html

Any suggestion on how to make it more visible and useful more than welcome.

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

kmas

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 3.4.2
  • CMS version: drupal 6.22
  • MySQL version: 5.1.41
  • PHP version: 5.3.2
Re: Outgoing mail trying to use localhost instead of SMTP server
June 11, 2011, 03:52:38 am
Thanks a lot Xavier for your reply!

Well, I've read thoroughly the CiviCRM manuals on flossmanuals (especially the CiviMail configuration). Seems that the smtp option is not the recommended way per here: http://en.flossmanuals.net/civicrm/ch042_system-configuration/

It recommends mail() instead. That's fine with me.

I created a contact called "Return Mail" in the civicrm with a drupal user so that I can run the cron job, now I'm getting the error:

"Sorry. A non-recoverable error has occurred.
No clue about the ezcMailDeliveryStatus
Return to home page."

The mail server is supporting + tags, but not - tags. I tried it for the return@<domain.tld> email and is delivering them normally.

Please note the I've used the site key written in the civicrm.settings.php file.

Any clue what that could be?

Again, thanks a lot for the valuable link that you shared, I never came across it, but I read the flossmanuals several times, and thought that there should be a way configuring SMTP, but looks like this isn't the recommended way that you are using.

Anyway, any help on the cronjob issue will be highly appreciated.

Thanks!

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Outgoing mail trying to use localhost instead of SMTP server
June 11, 2011, 04:42:04 am
Quote from: kmas on June 11, 2011, 03:52:38 am

Well, I've read thoroughly the CiviCRM manuals on flossmanuals (especially the CiviMail configuration). Seems that the smtp option is not the recommended way per here: http://en.flossmanuals.net/civicrm/ch042_system-configuration/

It recommends mail() instead. That's fine with me.

For the record: I recommended using mail() when using the same server for mail and civicrm.
I took a bit of a shortcut in the book as that's the most common configuration, and the ones having a separate and dedicated mail server are aware of the pros and cons ;)

Quote from: kmas on June 11, 2011, 03:52:38 am
"Sorry. A non-recoverable error has occurred.
No clue about the ezcMailDeliveryStatus
Return to home page."


Err. can you start debugging and trying to get more info ? Should be around

Code: [Select]
CRM/Utils/Mail/Incoming.php
75:        CRM_Core_Error::fatal( ts( "No clue about the %1",
101:        CRM_Core_Error::fatal( ts( "No clue about the %1",

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Outgoing mail trying to use localhost instead of SMTP server

This forum was archived on 2017-11-26.