What happens with soft bounces?

Lakjin

Active Member
Is there a setting in MailWizz that marks a user as hard bounced after X amount of soft bounces for an email address?
 

twisted1919

Administrator
Staff member
That applies for everything since it counts soft bounces and doesn't really care how they became soft bounces.
 

twisted1919

Administrator
Staff member
Internal is when the email returns for reasons related to your host, for example if you try to send an email and the remote smtp server rejects it because he doesn't like your ip reputation.
 

Lakjin

Active Member
Internal is when the email returns for reasons related to your host, for example if you try to send an email and the remote smtp server rejects it because he doesn't like your ip reputation.
How do we control if a bounce code is marked as internal vs soft? I'm looking at dswh controller file that processes bounces and I don't see any option, but I'm seeing some of bounces being marked as internal. Are internal the same as soft bounces (i.e., a subscriber with X internal bounces is now marked as hard bounce)?
 

Lakjin

Active Member
The app decides this based on some rules, have a look at the dswh controller and see ;)
I've looked at my bounce_log and I'm seeing 'Spam' being marked as 'internal' bounce. However, I do not see BOUNCE_INTERNAL used anywhere for ElasticEmail (I see for other ESPs). Where is the setting you are referring to?
 

twisted1919

Administrator
Staff member
Here's the EE spam webhook processor, we don't use any internal bounce here:
PHP:
public function processElasticemail()
{
    $request     = Yii::app()->request;
    $category    = trim($request->getQuery('category'));
    $transaction = trim($request->getQuery('transaction'));
    $status      = trim($request->getQuery('status'));

    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();
    }
    
    // All categories:
    // https://elasticemail.com/support/delivery/http-web-notification
    
    if ($status == 'AbuseReport') {
        
        if (Yii::app()->options->get('system.cron.process_feedback_loop_servers.subscriber_action', 'unsubscribe') == 'delete') {
            $subscriber->delete();
            Yii::app()->end();
        }

        $subscriber->saveStatus(ListSubscriber::STATUS_UNSUBSCRIBED);

        $count = CampaignTrackUnsubscribe::model()->countByAttributes(array(
            'campaign_id'   => $campaign->campaign_id,
            'subscriber_id' => $subscriber->subscriber_id,
        ));

        if (empty($count)) {
            $trackUnsubscribe = new CampaignTrackUnsubscribe();
            $trackUnsubscribe->campaign_id   = $campaign->campaign_id;
            $trackUnsubscribe->subscriber_id = $subscriber->subscriber_id;
            $trackUnsubscribe->note          = 'Unsubscribed via Web Hook!';
            $trackUnsubscribe->ip_address    = Yii::app()->request->userHostAddress;
            $trackUnsubscribe->user_agent    = StringHelper::truncateLength(Yii::app()->request->userAgent, 255);
            $trackUnsubscribe->save(false);
        }
        
        // since 1.4.4 - complaints go into their own tables
        $count = CampaignComplainLog::model()->countByAttributes(array(
            'campaign_id'   => $campaign->campaign_id,
            'subscriber_id' => $subscriber->subscriber_id,
        ));

        if (empty($count)) {
            $complaintLog = new CampaignComplainLog();
            $complaintLog->campaign_id   = $campaign->campaign_id;
            $complaintLog->subscriber_id = $subscriber->subscriber_id;
            $complaintLog->message       = 'Abuse complaint via ElasticEmail!';
            $complaintLog->save(false);
        }
        //

        Yii::app()->end();
    }
    
    if ($status == 'Unsubscribed') {
        
        $subscriber->saveStatus(ListSubscriber::STATUS_UNSUBSCRIBED);

        $count = CampaignTrackUnsubscribe::model()->countByAttributes(array(
            'campaign_id'   => $campaign->campaign_id,
            'subscriber_id' => $subscriber->subscriber_id,
        ));

        if (!empty($count)) {
            Yii::app()->end();
        }

        $trackUnsubscribe = new CampaignTrackUnsubscribe();
        $trackUnsubscribe->campaign_id   = $campaign->campaign_id;
        $trackUnsubscribe->subscriber_id = $subscriber->subscriber_id;
        $trackUnsubscribe->note          = 'Unsubscribed via Web Hook!';
        $trackUnsubscribe->ip_address    = Yii::app()->request->userHostAddress;
        $trackUnsubscribe->user_agent    = StringHelper::truncateLength(Yii::app()->request->userAgent, 255);
        $trackUnsubscribe->save(false);

        Yii::app()->end();
    }
    
    // $bounceCategories = array(
    //    'NoMailbox', 'AccountProblem',
    //    'Throttled', 'ConnectionTerminated',
    //);
    $bounceCategories = array('NoMailbox');
    
    $bounceCategories = array_map('strtolower', $bounceCategories);
    $categoryID       = strtolower($category);

    if (in_array($categoryID, $bounceCategories)) {
        $hardBounceCategories = array('NoMailbox', 'AccountProblem');
        $hardBounceCategories = array_map('strtolower', $hardBounceCategories);
        
        $softBounceCategories = array('Throttled', 'ConnectionTerminated');
        $softBounceCategories = array_map('strtolower', $softBounceCategories);

        $bounceType = null;
        
        if (in_array($categoryID, $hardBounceCategories)) {
            $bounceType = CampaignBounceLog::BOUNCE_HARD;
        } elseif (in_array($categoryID, $softBounceCategories)) {
            $bounceType = CampaignBounceLog::BOUNCE_SOFT;
        }
        
        if ($bounceType === null) {
            Yii::app()->end();
        }

        $count = CampaignBounceLog::model()->countByAttributes(array(
            'campaign_id'   => $campaign->campaign_id,
            'subscriber_id' => $subscriber->subscriber_id,
        ));

        if (!empty($count)) {
            Yii::app()->end();
        }
        
        $bounceLog = new CampaignBounceLog();
        $bounceLog->campaign_id     = $campaign->campaign_id;
        $bounceLog->subscriber_id   = $subscriber->subscriber_id;
        $bounceLog->message         = $category;
        $bounceLog->bounce_type     = $bounceType;
        $bounceLog->save();

        if ($bounceLog->bounce_type == CampaignBounceLog::BOUNCE_HARD) {
            $subscriber->addToBlacklist($bounceLog->message);
        }
        
        Yii::app()->end();
    }

    Yii::app()->end();
}
 

Lakjin

Active Member
Here's the EE spam webhook processor, we don't use any internal bounce here:
Exactly, I saw that as well. However, I'm definitely seeing 'Internal' bounce being recorded for 'Spam' and 'BlackListed' in the bounce_log and I'm only using EE. So something is definitely up.
 

twisted1919

Administrator
Staff member
@Marcello - If you don't want to send them again, then yes, you can remove them, or disable them, maybe later you'll fix this issue and you can send them emails again.
 
Top