Seems that bounces aren't processed, what can i do?

Discussion in 'Common issues' started by twisted1919, Jan 1, 2015.

  1. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,450
    Likes Received:
    2,432
    So, you've sent a campaign and expect to get some bounces back because you intentionally put invalid emails there but nothing shows in the bounces area of the campaign and you are stumped because of that (that makes two of us) and of course you need to know why.

    First think you need to make sure is that you haven't forgot to add the cron job for processing bounces, in case you did forgot, here's the list again to double check: https://forum.mailwizz.com/threads/what-are-the-cron-jobs-that-i-have-to-add.12/

    Next, when a bounce server is being used to process bounces, its status changes from active to "cron-running" in your mailwizz web interface. Mailwizz relies on pcntl extension to make sure if the process doesn't exit nicely (because of some error or timeout) to restore the initial status of the server, that is, the active status so that the server can be selected next time when the cron job will run. The thing is, the pcntl extension is something that doesn't come with php and has to be installed separately so most of the time is likely that your php install doesn't contain the extension. And because the extension is missing, mailwizz might not be able to restore a proper state of the bounce server (mailwizz has fallbacks mechanisms to cope with missing pcntl extension) and your bounce server will remain stuck in cron-processing mode and will not be picked for processing next time when the cron runs, remember, only bounce server having the status active are picked up for processing.
    Bottom line, if you see your bounce server has the status "cron-running" for more than 30 minutes, then you can go to your applicaction Backend -> Misc -> Emergency Actions and reset your bounce servers status so that they become active again.

    Another thing is that, when processing bounces, mailwizz uses php's imap extension and even if your web instance of php contains the imap extension that doesn't mean your command line (CLI) contains it too, matter a fact, i saw multiple servers that use php 5.3 as the web module(well, yeah php-fpm too, but you get the point), and php 5.2 as the CLI module. You can verify this from command line, by running the command php -v which will tell you the version you are using in command line and if that is indeed using the CLI module and not the web module, because, i also saw the command line calling the web module, which is wrong since the web module is subject to timeouts and the such while the command line module isn't(well, it shouldn't anyway) thus is perfect for long running scripts.
    To make sure your command line php contains the imap extension and the functions, the best way would be to create a php file on your server, say imap.php with the following contents:
    PHP:
    <?php var_dump(function_exists('imap_open'));?>
    then run in from command line with:
    Code:
    php imap.php
    
    If the output contains the false word, then you don't have imap installed and you have too.

    If all the above look fine on your server, then make sure you don't use services like gmail / yahoo / aol / etc as bounce servers. These services will limit the number of connections and might as well deny access to read the bounce boxes thus mailwizz won't be able to connect and read the emails.

    Next, it's always a good way to actually login for the bounce box and verify if there are emails there and if there are, and those are returned for your mailwizz campaigns, look in the email source and make sure the following headers are there:
    Code:
    X-Mw-Campaign-Uid: 13CharsHash
    X-Mw-Subscriber-Uid: 13CharsHash
    
    Because mailwizz uses those two headers to identify the campaign and the subscriber so that it can take proper actions against them.
    If you don't see those headers, then that's bad, somehow those were stripped by the server that returned those emails into your bounce box, nothing much to do in this case.

    Other things you can do, since the cron job for processing bounces is a simple command line script, you can actually call it from the command line as:
    Code:
    php {FULL_PATH_TO_APPS_FOLDER}/apps/console/console.php bounce-handler
    
    and see how that goes, if it processes any bounce from your bounce box.

    Some notes:
    1. Because of the nature of processing bounces, because each email has to go through thousand of bounce rules and because connecting to imap/pop3 server is usually a slow action (like any other network action) you should make sure your command line php has enough memory to process your bounces. This, in tandem with the settings for bounces from Backend -> Settings -> Cron should be tweaked to match your server.

    2) In mailwizz, services like Amazon SES, Mandrill, Mailgun, Leadersend, ElasticEmail, Sendgrid not only work by using their smtp inteface, but they do have custom API implementation in mailwizz and when you create a delivery server, you can use the API implementation instead of the smtp implementation:
    mailwizz-web-apis.png
    The reason why you should use these instead of the SMTP alternative is because they are slightly faster when sending and because you don't need bounce servers at all because mailwizz will subscribe to certain webhooks and will receive notifications when an email bounces, marks you as spam, etc so you don't need the memory intensive cron job to process bounces.
     
  2. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Hi,

    I went through all ofthe steps mentioned in this post.
    So,
    I made sure the cron jobs for processing bounces were added.
    I manually set them from cron-running to active before i send the campaign.
    I created the file imap.php and ran it in the server with a successful result, which means that my command line php contains the imap extension and the functions
    I noticed also that my bounce@domain.com inbox mails contain the
    X-Mw-Campaign-Uid: 13CharsHash
    X-Mw-Subscriber-Uid: 13CharsHash
    headers in their source.
    I called the bounce-handler from the server's terminal with the script, still didn't process bounce.
    I need to mention also that i completely replaced the bounce-handler config file according to a suggestion made by a friend to fix the issue of the bounce handler not to blacklist the soft bounces.

    Please any suggestion from your side would be appreciated.
     
  3. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,450
    Likes Received:
    2,432
  4. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Yes, I installed it.
    Up to now, I can see bounces are shown as processed.
    I can see hard and soft bounces.
    But i was expecting mailwizz would blacklist all the hard bounces from the list, which it doesn't.
    Iis there a way that mailwizz could automatically blacklist all the hard bounces from the list?
     
  5. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,450
    Likes Received:
    2,432
    The emails are blacklisted depending on your settings from backend -> settings -> cron (last two boxes) and they are blacklisted when the process-campaigns-delivery-and-bounce-logs (yeah, i wasn't that inspired when i write this command) is running, so a delay will always exists.
     
  6. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Ok thank you
    I set them to one day.
    Tomorrow we will get the results i suppose.
     
  7. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    It's been 5 days since my last campaign and the bounces are not processed.
    The last two boxes, i understand define, how long will the email address stay blacklisted, before it's deleted, right?
    The problem is that hard bounces don't get deleted at all, even after 5 days
     
  8. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    So bottom line, i need to know how the hard bounces can be deleted from the list.
     
  9. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,450
    Likes Received:
    2,432
    What is the value in your blacklisted days box ?
     
  10. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    0
     
  11. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Body, sorry once again

    I can see that hard bounces are blacklisted.
    The only problem is the list shows all the subscribers, not only the confirmed ones like I was used to see from another email campaigner.
    That would be a good idea although.

    Thanks again, and sorry for the useless posts.
     
  12. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,450
    Likes Received:
    2,432
    You can filter them, to show only confirmed :D
     
  13. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Right.
    Anyway i just came today to see that bounces from tha last campain, weren't proccessed at all. The bounce servers are in status active.
    What might have happened?
     
  14. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,450
    Likes Received:
    2,432
    How do you know they were not processed ?
     
  15. stradivaris

    stradivaris New Member

    Joined:
    May 14, 2015
    Messages:
    10
    Likes Received:
    0
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    It happens quite often, that bounces aren't processed because it shows it on campaign overview.
    But i noticed it gets fixed, after i restart the server.
     
  16. Eldi

    Eldi Member

    Joined:
    Mar 19, 2015
    Messages:
    59
    Likes Received:
    4
    S.E:
    2020-04-25 09:10:41
    L.T:
    Regular
    L.C:
    4
    I have 2 separate mailwizz installations on the same server:
    One upgraded from previews version and one fresh install.

    But bounces are not working on both of them.

    View campaigns bounce logs
    http://prntscr.com/81gazm

    Bounce servers:
    http://prntscr.com/81gbof

    root@ [~]# service crond status
    crond (pid 1914) is running...

    Bounce mailboxes have a lot of emails.


    What might be wrong?
     
  17. Rob

    Rob Active Member

    Joined:
    Feb 17, 2015
    Messages:
    404
    Likes Received:
    99
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Can you post what your cronjob list is? Keep in mind that with two installations on one server you will need two sets of cronjobs.

    Check your cron logs to see if all jobs are firing correctly and check the campaign bounce logs in MW backend.
     
  18. Eldi

    Eldi Member

    Joined:
    Mar 19, 2015
    Messages:
    59
    Likes Received:
    4
    S.E:
    2020-04-25 09:10:41
    L.T:
    Regular
    L.C:
    4

    Attached Files:

  19. Rob

    Rob Active Member

    Joined:
    Feb 17, 2015
    Messages:
    404
    Likes Received:
    99
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Those aren't right, take a look at Backend > Miscellaneous > cron jobs list

    You need to change the minute settings and the location of php
     
  20. Eldi

    Eldi Member

    Joined:
    Mar 19, 2015
    Messages:
    59
    Likes Received:
    4
    S.E:
    2020-04-25 09:10:41
    L.T:
    Regular
    L.C:
    4
    I believe i copy pasted from there or from the install instructions. Since sending is working..

    I will check now - Thanks

    Besides the 30 minutes instead of 10 minutes other part of the cron is OK.
    Anyway I changed to every 10 minutes but I believe this doesn't affect nothing besides the timer.
     
    Last edited: Aug 6, 2015

Share This Page