Elasticemail, bounces & complaints

I think this is my bad....
In apps/frontend/DswhController.php, processElasticemail() should look like:
PHP:
protected function processElasticemail()
    {
        $request     = Yii::app()->request;
        $category    = trim($request->getQuery('category'));
        $transaction = trim($request->getQuery('transaction'));
       
        if (empty($transaction) || empty($category)) {
            Yii::app()->end();
        }
       
        $deliveryLog = CampaignDeliveryLog::model()->findByAttributes(array(
            'email_message_id' => $transaction,
            'status'           => CampaignDeliveryLog::STATUS_SUCCESS,
        ));
       
        if (empty($deliveryLog)) {
            $deliveryLog = CampaignDeliveryLogArchive::model()->findByAttributes(array(
                'email_message_id' => $transaction,
                'status'           => CampaignDeliveryLogArchive::STATUS_SUCCESS,
            ));
        }
       
        if (empty($deliveryLog)) {
            Yii::app()->end();
        }
       
        $campaign = Campaign::model()->findByPk($deliveryLog->campaign_id);
        if (empty($campaign)) {
            Yii::app()->end();
        }
       
        $subscriber = ListSubscriber::model()->findByAttributes(array(
            'list_id'          => $campaign->list_id,
            'subscriber_id'    => $deliveryLog->subscriber_id,
            'status'           => ListSubscriber::STATUS_CONFIRMED,
        ));
       
        if (empty($subscriber)) {
            Yii::app()->end();
        }
       
        $bounceLog = CampaignBounceLog::model()->findByAttributes(array(
            'campaign_id'   => $campaign->campaign_id,
            'subscriber_id' => $subscriber->subscriber_id,
        ));
       
        if (!empty($bounceLog)) {
            Yii::app()->end();
        }
       
        if (in_array($category, array('Ignore', 'NoMailbox', 'AccountProblem', 'ConnectionTerminated', 'ContentFilter'))) {
            $softBounce = in_array($category, array('AccountProblem', 'ConnectionTerminated', 'ContentFilter'));
            $bounceLog = new CampaignBounceLog();
            $bounceLog->campaign_id     = $campaign->campaign_id;
            $bounceLog->subscriber_id   = $subscriber->subscriber_id;
            $bounceLog->message         = 'BOUNCED BACK';
            $bounceLog->bounce_type     = $softBounce ? CampaignBounceLog::BOUNCE_SOFT : CampaignBounceLog::BOUNCE_HARD;  
            $bounceLog->save();  
           
            if ($bounceLog->bounce_type == CampaignBounceLog::BOUNCE_HARD) {
                $subscriber->addToBlacklist($bounceLog->message);
            }
            Yii::app()->end();
        }
       
        if ($category == 'Spam') {
            if (Yii::app()->options->get('system.cron.process_feedback_loop_servers.subscriber_action', 'unsubscribe') == 'delete') {
                $subscriber->delete();
                Yii::app()->end();
            }
           
            $subscriber->status = ListSubscriber::STATUS_UNSUBSCRIBED;
            $subscriber->save(false);
           
            $trackUnsubscribe = new CampaignTrackUnsubscribe();
            $trackUnsubscribe->campaign_id   = $campaign->campaign_id;
            $trackUnsubscribe->subscriber_id = $subscriber->subscriber_id;
            $trackUnsubscribe->note          = 'Unsubscribed via Web Hook!';
            $trackUnsubscribe->save(false);
           
            Yii::app()->end();
        }
       
        Yii::app()->end();
    }

Once you change it like so, it'll start working.
Thanks.
 
Hi

I've changed that code, removed everything from line 584 through 668 and inserted code from above and still not receiving the bounce error.

Apache log showing same as before:

37.187.248.20 10.189.246.4 - - [30/Mar/2015:15:21:05 +0000] "GET /dswh/20?transaction=2101042a-d4ce-4016-a6ef-6a2e3b3d12ff&to=bounce-test%40sdfghjuytdfghjhgf.com&date=3%2f30%2f2015+3%3a20%3a59+PM&status=Error&channel=HTTP+API&account=XXXX%40XXXXXXXXX.com&category=DNSProblem&subject=EE+Bounce+Test+Code+Change HTTP/1.1" 200 398 "-" "-"
 
@Rob - Include DNSProblem in the if statement at line 631, from:
PHP:
if (in_array($category, array('Ignore', 'NoMailbox', 'AccountProblem', 'ConnectionTerminated', 'ContentFilter'))) {
to
PHP:
if (in_array($category, array('Ignore', 'DNSProblem', 'NoMailbox', 'AccountProblem', 'ConnectionTerminated', 'ContentFilter'))) {
 
So here is what i did,

I went to EE dashboard, took the credentials and created a new delivery server then i took it's notifications url and put it into the EE dashboard in the field "Notification URL". I tried to save it several times and it failed. But i kept refreshing the page and saved till it worked and the new url has been saved.
Then i have sent a test campaign and fair enough the bounced email was there, so i can say that this works 100%.
 
OK, so I still can't get this to work I'm sure it's something to do with my setup as I can't get the activity map to work either with www.locatorhq.com.

Where in the database would the bounce info be placed? I need to see if the app isn't picking thedata up or if the data just isn't being accepted once EE hit my server (apache logs show the GET response correctly).

Cheers

Rob
 
@Rob and @twisted1919 I've tried hard... I believe that I've found a way. To process and to get completely lost.

I'll try to explain (all logs, debug info I'll send only to you @twisted1919 - security)

1) deleted all my EE config and recreated everything;

2) to avoid problems I've replaced the script DswhController.php on my server using the original in your dist file;

3) I've followed your instructions to replace the EE method (at line 584) and the IF statement too (at line 631);

4) I've took a deep breath and then I've started my tests (yes, snapshots, backups and everything. A tired developer almost all the time have amazing ideas to mess up all the things... :rolleyes:)

Does not work. The invalid email does not get blacklisted.

As I have some specific tools and configs (from PageSpeedy to Firewall and Request rules, etc) I've started to disabled everything and doing more tests.

I've read 100% in your message... Do you believe that this should be... well... 80%? Ok, you're awesome: 99%!

@twisted1919, I believe that this is the "entry point":

PHP:
    public function actionIndex($id)
    {
        $request = Yii::app()->request;
        if (!$request->isPostRequest) {
            Yii::app()->end();
        }
       
        [...]
       
        Yii::app()->end();
    }

And you defined that only POST is accepted, BUT EE use GET to send the info to MW:

"GET /dswh/20?transaction=873dd184-cad4-40de-84b1-c59c699a57b3&to=test@test.com&date=3/31/2015%206:54:56%20AM&status=opened&channel=testchannel&account=account@test.com&category=sent&subject=test HTTP/1.1" 200 -

I've commented this check and started new tests. Well... I've found some "things":

1) as I used the URLs that I've found on my logs, I've opened each one using my browser. All the times that I've done this and tried to access the campaign list (as a customer) I've received this message/error:
I'm curious about the fact that, after some time, no error anymore.

mw-ee-debug-panic-runrun.png


@twisted1919, is this a result of opening this on the browser? Do you have any idea?

2) finally almost all that invalid emails reported by EE, and executed manually using the URL above, was blacklisted.... ALMOST, Almost... One invalid email, reported by EE, does not change: Confirmed and Active.

mw-ee-debug-monster-bounce.png


The REASON? Reading the docs I've found easily the answer:

Ignore
The email was not delivered because the email address is currently in the "Bounce List". Emails in the "Bounce List" are either hard failures or unsubscribes managed by our system. If you feel this email should be delivered please go to the "Blocked Recipients" screen and remove the email address from this list. Emails in this category are not rescheduled.
https://elasticemail.com/support/email-delivery-error-categories

In fact the status that we receive is:
category=NotDelivered

EE are completely right and taking care of it's service. GREAT!

There's only a little (?) problem: MW will always send a message to this mail and more than have to pay to send this invalid message your account reputation can real suffer in terms of your reputation and then... you won't be a good guy and "No better prices for you anymore".

As EE have A REAL AGGRESSIVE discount if you do the right thing: be good, DON'T SEND SPAM!

So:
  • @Rob I believe that yes, working. But this too much to me as All this is new to me in this moment.
  • @twisted1919, can you help to validate this? You will known how to do, I don't have any doubt;
Thanks and sorry for this huge message,
 
@Fabian Simões - Not sure exactly what version you are using, but the dswh controller from my version is attached here, try to put it in apps/frontend/controllers and see how it goes, that should work.

@twisted1919, is this a result of opening this on the browser? Do you have any idea?
This is an issue indeed, it happens when you have merged lists afaik, but it's fixed in the dev branch anyway.
 

Attachments

  • DswhController.zip
    3.7 KB · Views: 4
@Fabian Simões - Not sure exactly what version you are using, but the dswh controller from my version is attached here, try to put it in apps/frontend/controllers and see how it goes, that should work.


This is an issue indeed, it happens when you have merged lists afaik, but it's fixed in the dev branch anyway.

That dswh controller is significantly different to mine, I'm using version 1.3.5.2, great news is IT WORKS!! :)

There are 200 hundred lines of code difference.

Cheers @twisted1919
 
@Rob - It's different because there are some changes that i have done for the 1.3.5.3(was a small milestone, not released) and current dev version 1.3.5.4 :)
 
Back
Top