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 »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • SMTP settings good, CiviMail settings bad?
Pages: [1]

Author Topic: SMTP settings good, CiviMail settings bad?  (Read 5162 times)

dustbin111

  • Guest
SMTP settings good, CiviMail settings bad?
May 18, 2009, 03:11:20 pm
I can't get CiviMail to send scheduled emails.

I can always send the test emails from 'http://<site>/civicrm/admin/setting/smtp?reset=1' so I presume those settings are correct (SMTP, port 25, no authentication).  I always get the obligatory "SMTP settings are correct.' message.

So I'm thinking the problem is with cron...

I putty in and 'crontab -e' brings up this entry:

  • "48 * * * * php /var/www/html/sites/all/modules/civicrm/bin/civimail.cronjob.php" (/var/www/html) is the hosting provider's structure; DNS points to this directory for all web requests.

So cron is running the script, but the email is not sending.  I understand I do not need to specify user/pass/key here because cron runs under the system account (true/false?).  There are two entries in my error log for this cron job:

  • [18-May-2009 15:48:03] PHP Warning:  require_once(../civicrm.config.php): failed to open stream: No such file or directory in /var/www/html/sites/all/modules/civicrm/bin/civimail.cronjob.php on line 44
  • [18-May-2009 15:48:03] PHP Fatal error:  require_once(): Failed opening required '../civicrm.config.php' (include_path='.:/php/includes:/usr/local/lib/php:/usr/local/php/lib/php') in /var/www/html/sites/all/modules/civicrm/bin/civimail.cronjob.php on line 44

so cron is triggering, but I may have a script problem...

I went back to line 44 in civimail.cronjob.php and changed the relative path "../civicrm.config.php" to the absolute path "/var/www/html/sites/all/modules/civicrm/civicrm.config.php," to no avail.  It doesn't give me the errors above, but i don't get the emails either. I changed it back...  CiviMail wouldn't ship with this big of a flaw, right?

So I tried manually forcing the send both with and without keys configured using both:

  • http://<site>/civicrm/bin/civimail.cronjob.php?name=<name>&pass=<pass>&key=<key>
  • http://<site>/civicrm/mailing/queue?reset=1

But nothing.  No error or the page or in a log, but no emails either.

Anything else i should try? Oh, pray ye, the gods of Lobo, hear our cries...
« Last Edit: May 18, 2009, 03:17:34 pm by dustbin111 »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: SMTP settings good, CiviMail settings bad?
May 18, 2009, 03:48:01 pm
Quote
I understand I do not need to specify user/pass/key here because cron runs under the system account (true/false?).

That sounds wrong - I'll just check what I have set up in my cron
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: SMTP settings good, CiviMail settings bad?
May 18, 2009, 04:23:38 pm
entering this in my browser (looks the same as yours) gives me a blank page but the mailing is transformed from scheduled to completed. When you say no e-mails - does is still say scheduled? Or does it say completed but the e-mails didn't work?

http://myDomain/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=<name>&pass=<pass>&key=<key>
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

dustbin111

  • Guest
Re: SMTP settings good, CiviMail settings bad?
May 18, 2009, 05:46:21 pm
Okay, Okay, Okay, That worked!

Using my original URL, it still said 'scheduled.'

I recreated a key and tried this url:

  • http://<site>/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=<name>&pass=<pass>&key=<key>

Instead of this one:

  • http://<site>/civicrm/bin/civimail.cronjob.php?name=<name>&pass=<pass>&key=<key>

And it works peachy.  Question:  why does this work?  shouldn't the $civicrm_root in the civicrm.settings.php file take care of "/sites/all/modules"?

hmmm... So it works manually, let's fiddle with cron...
« Last Edit: May 18, 2009, 05:48:10 pm by dustbin111 »

dustbin111

  • Guest
Re: SMTP settings good, CiviMail settings bad?
May 18, 2009, 06:00:56 pm
Sure enough,

  • 56 * * * * wget 'http://<site>/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=<name>&pass=<pass>&key=<key>'

Works like a champ!

So, is wget the best way to call this or would php be better?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: SMTP settings good, CiviMail settings bad?
May 18, 2009, 09:08:54 pm
I use wget with

wget -q --spider

(I can't remember what the options were but something to do with not creating .html files in the process)

For the return path cron I run

wget -O - -o /dev/null -t 1 -T 1200 'http://domain.com/sites/all/modules/civicrm/bin/CiviMailProcessor.php?name=###&pass=###&key=###' >/dev/null 2>&1
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

yogibear

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
    • Byron Yoga
  • CiviCRM version: 4.1
  • CMS version: 6.2
  • MySQL version: 5.0
  • PHP version: 5.2
Re: SMTP settings good, CiviMail settings bad?
May 26, 2009, 01:01:11 am
Hey Eileen, I was just going to post that every time cron runs the following two jobs

wget 'http://domain.com/drupal/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=user&pass=password&key=longstring' > /dev/null 2>&1
wget 'http://domain.com/drupal/sites/all/modules/civicrm/bin/CiviMailProcessor.php?name=user&pass=password&key=longstring' > /dev/null 2>&1

I get a file created in /root directory called 'CiviMailProcessor.php?name=user&pass=password!&key=longstring.12'
Note the .p12 appended, this is an incrementing number for each time the job runs (happens for both jobs, file gets created)

I see you have some other options there on your wget, I tried wget -q (for quiet) but that doesn’t seem to stop the file getting output to /root directory either... quickly builds up to thousands of files...

Any tips on this one?

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: SMTP settings good, CiviMail settings bad?
May 26, 2009, 11:49:08 pm
YogiBear,

Can I point you to some scripts I posted here the other day? See http://forum.civicrm.org/index.php/topic,8124.0.html

Ken

dustbin111

  • Guest
Re: SMTP settings good, CiviMail settings bad?
August 12, 2009, 06:41:35 pm
I just checked, and I am having the same problem as yogibear:  multiple files in root that look like the cronjob.  I took the cronjob out of crontab and still get them.  what gives?

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 settings good, CiviMail settings bad?
August 12, 2009, 06:52:21 pm

please spend some time and take a look at the scripts ken published and/or look at the cron man pages to see how to redirect cron output. Alternatively you can ask your friendly sys admin for help/assistance

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

yogibear

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
    • Byron Yoga
  • CiviCRM version: 4.1
  • CMS version: 6.2
  • MySQL version: 5.0
  • PHP version: 5.2
Re: SMTP settings good, CiviMail settings bad?
August 13, 2009, 01:49:21 am
Hey dustbin, I have other cron jobs outputting to /dev/null 2>&1 no problem without creating extraneous files like the civimail jobs above do, I couldn’t resolve it that way despite trying quite hard and so chose a rather messy option of another couple of cron jobs as follows:
(note Ken kindly posted some steps to resolve this situation here http://forum.civicrm.org/index.php/topic,8124.0.html but at that point in my implementation I was unable to mentally process (overloaded :)) the suggestions he made so went with my simple one below, but thankyou Ken :))

*/2 * * * * find /root -type f -name "CiviMailProcessor.php*" -exec rm -f {} \; >> /dev/null 2>&1
*/2 * * * * find /root -type f -name "civimail.cronjob.php*" -exec rm -f {} \; >> /dev/null 2>&1

What this does is find all files starting with civimailprocessor.php and civimail.cronjob.php and deletes them. The tricky -exec rm option is so that if you have thousands of files in a directory it will delete them efficiently, a simple rm file command didn’t work well when there were lots of files (if I recall correctly).

Something must be odd with my setup though as it doesent seem like everyone has this issue.
Using VPS Centos 4.1 (Redhat)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • SMTP settings good, CiviMail settings bad?

This forum was archived on 2017-11-26.