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) »
  • Fix to make EmailProcessor handle activities and bounces
Pages: [1]

Author Topic: Fix to make EmailProcessor handle activities and bounces  (Read 1213 times)

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Fix to make EmailProcessor handle activities and bounces
April 02, 2011, 03:30:57 pm
I have struggled for a long time to get bounce handling working in Civimail [3.2.2 on Joomla].  I have had incoming emails going into activities working fine, but could not get bounces working.

The documentation is really tough, but I spent some time going through it today and discovered that EmailProcessor.php is supposed to handle both, but not on the same incoming email account.  It appears that you are supposed to set up two email accounts (in Administer -> CiviMail -> Mail Accounts) setting the bounce handling email account as "Default" and the activities handling email account as not default (ie not ticked).

I did this as I think I am supposed to do, and still not working.

I think there is a bug in 'components/com_civicrm/civicrm/bin/EmailProcessor.php'.  In the function "Process", it is supposed to "Process the mailbox for all the settings from civicrm_mail_settings" but it is actually ignoring the Default setting in the Mail Settings.
I have changed this function as follows and it is now doing exactly as I expected:

    static function process( $civiMail = true ) {
        require_once 'CRM/Core/DAO/MailSettings.php';
        $dao = new CRM_Core_DAO_MailSettings;
        $dao->domain_id = CRM_Core_Config::domainID( );
        $dao->find( );

        while ( $dao->fetch() ) {
        /**  EmailProcessor::_process($civiMail,$dao); */
         EmailProcessor::_process($dao->is_default,$dao);

        }

Basically, this tells the "_process" function to use the setting you have defined.

Have I got this right?  Do others see this change as useful?

Lionel.

malks

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
  • CiviCRM version: 3.4.x 4.x
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.x
  • PHP version: 5.3.x
Re: Fix to make EmailProcessor handle activities and bounces
April 02, 2011, 04:12:51 pm
I struggled a bit with this too... my understanding of it would be that you need two cron jobs set up, one for the bounces and one for activity creation.  Is this how you've got it set up?

*two cron jobs, not to cron jobs.
« Last Edit: April 02, 2011, 08:12:59 pm by malks »

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Re: Fix to make EmailProcessor handle activities and bounces
April 02, 2011, 04:22:18 pm
No, in the past, the option can be selected from the cron job, but I don't believe this works anymore.  I just use this in cron:

http://www.MyDomain.com/administrator/components/com_civicrm/civicrm/bin/EmailProcessor.php?name=MyUser&pass=MyPassword&key=MyKey

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Fix to make EmailProcessor handle activities and bounces
April 02, 2011, 08:03:01 pm
Lionel,

So if you look at _process() function there is code like -

Code: [Select]
    static function _process ($civiMail,$dao) {
  // 0 = activities; 1 = bounce;
$usedfor = $dao->is_default;
......
    }

which is equivalent of what u trying to do, i.e is_default is considered. And therefore i don't see the difference in what you trying to do vs the code that already exist,  assuming you using 3.3 version. You might want to debug a bit further to figure our the difference.

This is the issue - http://issues.civicrm.org/jira/browse/CRM-6959 which introduced the related change, in case you need more info / context.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

malks

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
  • CiviCRM version: 3.4.x 4.x
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.x
  • PHP version: 5.3.x
Re: Fix to make EmailProcessor handle activities and bounces
April 02, 2011, 08:29:13 pm
Sorry to confuse.  I'm using CLI to call EmailProcessor.php and had to pass "activities" as a parameter to get it to process the activities rather than bounces.  I thought I was clued into that by the url that I found in the doco somewhere, but I can't lay my hands on it at the moment.

lsmithgo

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 2
    • Soirees at Breinton
  • CiviCRM version: 4.5 beta 7
  • CMS version: Joomla 3.3.3
  • MySQL version: MySQLi 5.5.37-percona-sure1-log
  • PHP version: PHP 5.3.28
Re: Fix to make EmailProcessor handle activities and bounces
April 03, 2011, 02:35:13 pm
Thanks Deepak

You are right - that is in 3.3.  But I'm only on 3.2.  So I wasted my time fixing something that was already fixed!  Teach me for being out of date!


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Fix to make EmailProcessor handle activities and bounces

This forum was archived on 2017-11-26.