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) »
  • Useful cron jobs: sending and receiving CiviMails
Pages: 1 2 [3] 4

Author Topic: Useful cron jobs: sending and receiving CiviMails  (Read 10683 times)

Alan.Guggenheim

  • Guest
Re: Useful cron jobs: sending and receiving CiviMails
March 03, 2010, 07:43:12 pm
Ken,

Great. Perfect. Thanks.

Alan.Guggenheim

  • Guest
Re: Useful cron jobs: sending and receiving CiviMails
March 31, 2010, 10:39:59 am
Ken,

Thanks again for your scripts and support. Everything is running pretty smooth now, with 5,000+ emails daily and bounce processed.
I left the cron email messages on to monitor them, and I have a question:
I get always an error message:
Line 5 - Message ignored by CMailact
--------------------
connecting to mail.xxx.com, authenticating as cmailact@xxx.com and selecting INBOX mailboxes found: INBOX.cmailact.processed, INBOX.Trash, INBOX.Drafts, INBOX.Sent, INBOX, INBOX.CMailact.ignored, INBOX.Junk fetching 50 messages retrieving message 3656 setting 3656 as seen and moving it to the ignored mailbox got to the end of the mailbox

Is there still something wrong in the script somewhere?

Thanks

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: Useful cron jobs: sending and receiving CiviMails
March 31, 2010, 03:06:53 pm
Not at all.

The script's function is to invoke the CiviCRM script that receives and processed emails, and only tells the administrator about errors and warnings from CiviCRM.

The script is advising you that CiviMail has ignored one of the messages it received. So it's telling you that human intervention is required to process that message. Whether you do or not is up to you.

Ken

Alan.Guggenheim

  • Guest
Re: Useful cron jobs: sending and receiving CiviMails
April 06, 2010, 07:31:32 am
Ken,
The Line 5 - Message ignored by CiviMail is strange and repeating always, but now, suddenly I have the following errors:
Line 5 - Unexpected line: <br />
Line 6 - Unexpected line: <b>Fatal error</b>:  Call to a member function __toString() on a non-object in <b>.../public_html/sites/all/modules/civicrm/CRM/Mailing/Event/BAO/Reply.php</b> on line <b>124</b><br /> After line 6 - Unexpected end-of-file. Expected 'got to end of mailbox' message
--------------------
connecting to mail...., authenticating as ... and selecting INBOX mailboxes found: INBOX.....processed, INBOX.Trash, INBOX.Drafts, INBOX.Sent, INBOX, INBOX.....ignored, INBOX.Junk fetching 50 messages retrieving message 3804 <br /> <b>Fatal error</b>:  Call to a member function __toString() on a non-object in <b>/home/.../public_html/sites/all/modules/civicrm/CRM/Mailing/Event/BAO/Reply.php</b> on line <b>124</b><br />

Alan.Guggenheim

  • Guest
Re: Useful cron jobs: sending and receiving CiviMails
April 06, 2010, 04:43:57 pm
Ken,

I went into the mailbox to look, and it seems that one message was creating the problem:
Date:  Tue, 06 Apr 2010 02:27:03 -0500 [02:27:03 AM CDT]
From:  Gateway@
To:  civimail+r.215.231640.689c8b4cbaa1d024@xxxxxxxx.com
Subject:  NDN:
Headers:  Show All Headers 

This message was written in a character set (utf-8) other than your own.
If it is not displayed correctly, click here to open it in a new window.

Sorry. Your message could not be delivered to:

swestcott,fc (The name was not found at the remote site. Check that the name
has been entered correctly.) 

I am not sure at what level this should have been trapped.
Thanks

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: Useful cron jobs: sending and receiving CiviMails
April 06, 2010, 06:56:35 pm
Alan,

Questions about the behaviour of CiviMail, and the errors it throws up, really ought to addressed generally to the forums rather than tacked on to this thread. I can't help you, and other readers might not see your post.

Ken

Alan.Guggenheim

  • Guest
Re: Useful cron jobs: sending and receiving CiviMails
April 06, 2010, 06:58:59 pm
Ken,

You are right. Sorry. I did not know though if the issue was with your scripts or with CiviMail.

Thanks again for great scripts.

ps: can i move a message?

PaulVanLil

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
    • VanLil.be
  • CiviCRM version: civicrm 4.0.6
  • CMS version: Joomla 1.6
  • MySQL version: 5.1.52
  • PHP version: 5.3.3
Re: Useful cron jobs: sending and receiving CiviMails
February 27, 2011, 12:19:10 pm
Dear Ken,

First of all, I applaus you and your scripts. Congratulations!

It took me some time, but I have the mail-send.sh running.

I encounter problems with the mail-receive.sh.

The e-mail returned says:
awk: /my_path/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing/mail-receive-status.awk:5:
awk: /my_path/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing/mail-receive-status.awk:5: ^ invalid char '
' in expression

I had the variables printed out and they specify:
$Directory = /my_path/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing
$Document = /my_path/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing/temp/mail-receive.sh.29601.document
$Log = /my_path/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing/temp/mail-receive.sh.29601.log
$Result = 0

/Mailing being the folder where I have put the scripts.
/Mailing/temp the temporary folder. 

Question: what about the <invalid char '' in expression>?
It seems as if this is comming from the command: awk -f $Directory/mail-receive-status.awk $Document > $StatusLog
and that $Document is empty although that it has the value '/my_path/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing'

Also strange, I cannot find back the log files in the temp-directory although it is chmod at 777. The prog mail-receive.sh did not execute, so the log files should still be there. Nevertheless, the /Mailing/temp directory is empty.

Any idea what is happening?

Thanks in advance,
Paul
« Last Edit: February 27, 2011, 01:57:17 pm by PaulVanLil »

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: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 02:50:38 am
Paul,

Can you please post the contents of the email you received? (Sanitise URLs etc with '****' and use the "Insert Quote" button so I can see exactly what the machine spits out).

I've just posted more modern scripts at http://forum.civicrm.org/index.php/topic,18816

They might solve your problem!

Ken

PaulVanLil

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
    • VanLil.be
  • CiviCRM version: civicrm 4.0.6
  • CMS version: Joomla 1.6
  • MySQL version: 5.1.52
  • PHP version: 5.3.3
Re: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 03:17:47 am
Hello Ken,

This is the mail I received:
Code: [Select]
awk: /****/****/public_html/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing/mail-receive-status.awk:5:
awk: /****/****/public_html/joomla/administrator/components/com_civicrm/civicrm/bin/Mailing/mail-receive-status.awk:5: ^ invalid char '
' in expression


I will give your new code a try.

Thanks for looking into this.

Paul

PaulVanLil

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
    • VanLil.be
  • CiviCRM version: civicrm 4.0.6
  • CMS version: Joomla 1.6
  • MySQL version: 5.1.52
  • PHP version: 5.3.3
Re: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 03:55:45 am
Hello Ken,

I tried out the new scripts. They give the same result.
It's like there is somewhere a carriage return. Although, I cannot find it back.

 

PaulVanLil

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
    • VanLil.be
  • CiviCRM version: civicrm 4.0.6
  • CMS version: Joomla 1.6
  • MySQL version: 5.1.52
  • PHP version: 5.3.3
Re: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 05:37:46 am
Hello Ken,

I intercepted one of the documents produced by EmailProcessor.php. It does not give the result what it should be:

Code: [Select]
connecting to mail.****.be and authenticating as return+*****.be
got to the end of the mailbox

So, there we have our carriage return!
I guess this is a EmailProcessor.php problem and has nothing to see with your scripts.

Thanks anyhow,
Paul

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 05:43:40 am
Hi Paul,

Might be a configuration issue indeed. You should read the chapter on how to configure civimail, you config seems odd (return+... the + shouldn't be part of the login account IMO).

Definitely before running the scripts automatically, you should have them running manually, easier to debug.

And if you have php-cli, you should try running from the shell instead of the awk.

http://en.flossmanuals.net/civicrm

See you at the next Benelux meetup in NL ?

X+


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

PaulVanLil

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
    • VanLil.be
  • CiviCRM version: civicrm 4.0.6
  • CMS version: Joomla 1.6
  • MySQL version: 5.1.52
  • PHP version: 5.3.3
Re: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 06:06:58 am
Hey Xavier,

Thanks for the advice.
I have been reading those chapters from front to end and back again.
I am working with alfahosting. For one reason or another they replace "@" by "+" in their e-mail naming.

I have ran the EmailProcessor.php script manually with the following result:
Code: [Select]
connecting to mail.****.be and authenticating as return+****.be creating /****/****/public_html/joomla/media/civicrm/custom//CiviMail.ignored/2011/02/28/cur creating /****/****/public_html/joomla/media/civicrm/custom//CiviMail.ignored/2011/02/28/new creating /****/****/public_html/joomla/media/civicrm/custom//CiviMail.ignored/2011/02/28/tmp creating /****/****/public_html/joomla/media/civicrm/custom//CiviMail.processed/2011/02/28/cur creating /****/****/public_html/joomla/media/civicrm/custom//CiviMail.processed/2011/02/28/new creating /****/****/public_html/joomla/media/civicrm/custom//CiviMail.processed/2011/02/28/tmp got to the end of the mailbox
This seems OK for me. It created some files in the /joomla/media/civicrm/custom folder.

It took me some time to figure out that I did not have php-cli.
Civimail.cronjob.php stopped at: <require_once ("bin/cli.php");> as it could not find cli.php
When I changed it to <require_once ("cli.php");>, it found cli.php, but got lost afterwards.
Next I commented out the call to cli as in the following:

Code: [Select]
/ you can run this program either from an apache command, or from the cli
//
// comment Paul: cli is not installed on alfahosting server
//
//if (isset($argv)) {
//  require_once ("bin/cli.php");

//  $cli=new civicrm_cli ();
  //if it doesn't die, it's authenticated
//  require_once 'CRM/Core/Config.php';

//  $config =& CRM_Core_Config::singleton();
//  processQueue( $config->mailerJobSize);
//} else  { //from the webserver
  run( );
//}

This made my Civimail.cronjob.php run as should.

Now it it is up to EmailProcessor.php.

When is the next Benelux meetup in NL?

Cheers,
Paul

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Useful cron jobs: sending and receiving CiviMails
February 28, 2011, 06:40:57 am
Hi,

The error is because you are running the cron from the bin directory instead of the civicrm_root directory

(check the examples, should be php5 bin/EmailProcessor.php ... not php EmailProcessor.php

Ah ok, tought the + was the separator as in the + notation, my mistake, should work indeed

Meetup described there, you can register:
http://civicrm.org/civicrm/event/info?reset=1&id=123
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: 1 2 [3] 4
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Useful cron jobs: sending and receiving CiviMails

This forum was archived on 2017-11-26.