Resource icon

[bd] Mails 1.1.0

No permission to download
I received a bunch of errors I have never seen when sending out my newsletter. Xenforo 1.5 beta 4 current BD mail version. Here are a few.
Emails sent by Mandrill.

Code:
XenForo_Exception: [bd] Mails: Sending mail failed, log is available at /home/admin/public_html/community/internal_data/bdmails_1438731611_6dda25f402cff40319f1ac76659f2b21.log - library/bdMails/Transport/Abstract.php:75
Generated By: admin, 4 minutes ago
Stack Trace
#0 /home/admin/public_html/community/library/bdMails/Transport/Abstract.php(61): bdMails_Transport_Abstract->_bdMails_log(Array, '[{"email":"jayj...', false, Array)
#1 /home/admin/public_html/community/library/Zend/Mail/Transport/Abstract.php(348): bdMails_Transport_Abstract->_sendMail()
#2 /home/admin/public_html/community/library/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#3 /home/admin/public_html/community/library/XenForo/Deferred/UserEmail.php(143): Zend_Mail->send(Object(bdMails_Transport_Mandrill))
#4 /home/admin/public_html/community/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_UserEmail->execute(Array, Array, 7.9999971389771, '')
#5 /home/admin/public_html/community/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.9999971389771, '', false)
#6 /home/admin/public_html/community/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#7 /home/admin/public_html/community/library/XenForo/ControllerAdmin/Tools.php(159): XenForo_Model_Deferred->run(true, NULL, '', false)
#8 /home/admin/public_html/community/library/XenForo/FrontController.php(347): XenForo_ControllerAdmin_Tools->actionRunDeferred()
#9 /home/admin/public_html/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/admin/public_html/community/admin.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
  ["url"] => string(60) "http://.com/community/admin.php?tools/run-deferred"
  ["_GET"] => array(1) {
    ["tools/run-deferred"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["redirect"] => string(41) "http://.com/community/admin.php"
    ["execute"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}

Code:
Zend_Http_Client_Adapter_Exception: Email to Bubbasmom747@gmail.com failed: Unable to Connect to ssl://mandrillapp.com:443. Error #110: Connection timed out - library/Zend/Http/Client/Adapter/Socket.php:235
Generated By: admin, Today at 7:10 AM
Stack Trace
#0 /home/admin/public_html/community/library/Zend/Http/Client.php(973): Zend_Http_Client_Adapter_Socket->connect('mandrillapp.com', 443, true)
#1 /home/admin/public_html/community/library/bdMails/Transport/Mandrill.php(177): Zend_Http_Client->request('POST')
#2 /home/admin/public_html/community/library/bdMails/Transport/Abstract.php(57): bdMails_Transport_Mandrill->_bdMails_sendMail()
#3 /home/admin/public_html/community/library/Zend/Mail/Transport/Abstract.php(348): bdMails_Transport_Abstract->_sendMail()
#4 /home/admin/public_html/community/library/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#5 /home/admin/public_html/community/library/XenForo/Deferred/UserEmail.php(143): Zend_Mail->send(Object(bdMails_Transport_Mandrill))
#6 /home/admin/public_html/community/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_UserEmail->execute(Array, Array, 7.9999971389771, '')
#7 /home/admin/public_html/community/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.9999971389771, '', false)
#8 /home/admin/public_html/community/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#9 /home/admin/public_html/community/library/XenForo/ControllerAdmin/Tools.php(159): XenForo_Model_Deferred->run(true, NULL, '', false)
#10 /home/admin/public_html/community/library/XenForo/FrontController.php(347): XenForo_ControllerAdmin_Tools->actionRunDeferred()
#11 /home/admin/public_html/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#12 /home/admin/public_html/community/admin.php(13): XenForo_FrontController->run()
#13 {main}
Request State
array(3) {
  ["url"] => string(60) "http://.com/community/admin.php?tools/run-deferred"
  ["_GET"] => array(1) {
    ["tools/run-deferred"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["redirect"] => string(63) "http://.com/community/admin.php?users/email&sent=6485"
    ["execute"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
  }
}
 
EDIT: This limitation of 1,000 unique address bounces no longer exists. @xfrocks completely reworked the addon to fix the issue by using a webhook instead of a cron job. Just make sure you're using v1.0 or newer and you'll be fine.

-------------
Heard back from Mandrill support.

They are very prompt, have detailed answers, but unfortunately it sounds like once you hit 1,000 entries on the blacklist, it's impossible to get additional entries through polling that endpoint. This is because they only ever return the first 1,000 entries, regardless of status whether active or expired, and b) it's impossible to remove an email from the blacklist... delete only changes it from active to expired, and it'll still be on the list. So even if you filter by 'active', behind the scenes it's just grabbing the first 1,000 emails, then stopping, filtering for active, and returning those. So if the first 1,000 entries have expired, you'll get 'no entries' for the active blacklist, even though there might be a ton more beyond that first 1,000.

So effectively [BD] Mails bounce handling is completely broken once your Mandrill account has had 1,000 unique email addresses bounce--regardless of whether they've expired off the blacklist or not.

This explains why people are getting weird BD Mails errors. Either @xfrocks needs to change how he retrieves the list of bounced emails from Mandrill, or Mandrill needs to change the way their blacklist API call works.

Mandrill suggested that the best way to retrieve bounces is setup a webhook, which requires this addon to create an endpoint within the forum... from an API standpoint, it's definitely a better solution than the way BD Mails currently works of repeatedly polling Mandrill's servers for the entire blacklist. However, it might be difficult to add a webhook endpoint within Xenforo addon code, I don't know.

In addition, I still think Mandrill's blacklist API functionality is pretty broken--they should be able to retrieve the first 1,000 active at a time, or even the first 100 active. So you know that if you query for active, and get no results, that you truly have no emails currently active on the blacklist. If you are affected by this problem, it's worth dropping an email to help@mandrill.com and ask them to fix it, so they know that customers are affected by it.

Here's what they said in response to my two bug reports about broken API functionality and broken web UI functionality for the blacklist:

Hey Jeff,

Thanks for getting in touch. For a bit of context, whenever you use the rejects/delete API call, any query not in your Rejection Blacklist will be marked as true when you call it. That said, this can lead to some false positives when using this call. For example, a simple string of letters like abcdefg will return the response True when using this call so it's possible the values being passed along aren't being passed properly. Additionally, when you "delete" an entry from your Rejection Blacklist, this essentially just causes Mandrill to expire the entry meaning these entries will still appear on your rejects exports.

Obviously, this isn't an ideal set up and our developers are working to provide a better solution moving forward, but I don't have an ETA when that feature may go live.

Hi Jeff,

Thanks for reaching out. Our web interface for the Rejection Blacklist can operate a bit counterintuitively if you have a very large number of addresses in this Blacklist. Although this view will show the first 1000 entries only, this includes expired entries. So if you have more than 1000 entries, but the first 1000 are all expired, the view will be empty.

You may wish to export the full Blacklist as a .csv file - this contains all blacklist entries for your account. You can download this file by accessing the /exports/rejects API endpoint.

Alternatively, you may click on "Rejected" for any email within your Outbound Activity and then click on the reason (ie "soft-bounce") in order to search your Rejection Blacklist for a single email address. This view will also allow you to click the "Export Full Blacklist" button.

If you want to keep your database in sync with Mandrill on a continuous basis, we recommend that you set up a webhook to catch bounce, unsubscribe, or spam complaint event and handle it there—that way we'll only ever send you the differences once without you polling constantly. You can find more information about webhooks here: Introduction to Webhooks – Mandrill Knowledge Base

If webhooks are unacceptable and you do need to pull the entire blacklist, you can use our export APIs to do so. These APIs will give you your entire blacklist, but they are designed for more infrequent use. You can find the documentation about the export API for rejection blacklists here: Exports API | Mandrill

Please let me know if you have any additional questions, and we'd be happy to help.
 
Last edited:
I received a bunch of errors I have never seen when sending out my newsletter. Xenforo 1.5 beta 4 current BD mail version. Here are a few.
Emails sent by Mandrill.

Those are not errors, but should be seen as information about a failed mail sent only. The details of the failed mail is in the file mentioned in that information.

Mandrill suggested that the best way to retrieve bounces is setup a webhook, which requires this addon to create an endpoint within the forum... from an API standpoint, it's definitely a better solution than the way BD Mails currently works of repeatedly polling Mandrill's servers for the entire blacklist. However, it might be difficult to add a webhook endpoint within Xenforo addon code, I don't know.

Webhook end points are no problem in XenForo. There are already some available for PayPal and similar purposes.
 
FWIW--Mandrill followed up with me again to let me know they are well-aware that their blacklist API endpoint is partially broken, and they're working on fixing it, but no ETA on that.

Still agree that if webhooks are easy, that's the better solution, even if Mandrill's blacklist api worked fine.
 
What is the benefit of using this addon over the xenforo built in smtp which can be used with any email delivery provider (mailgun, mandrill, amazon..), despite the bouncing feature? Or is it all about the bouncing. If so I find the title and description a little irritating.
 
This add-on existed before the bouncing feature was included in xenForo. Using this add-on saves you from maintaining an extra bouncing mailbox. Beside that, there is no difference.
 
This add-on existed before the bouncing feature was included in xenForo. Using this add-on saves you from maintaining an extra bouncing mailbox. Beside that, there is no difference.
Sorry if I wasn't clear. So this addon is all about the bouncing? I thought bouncing was a feature and that the main thing is about mandrill, mailgun.. support, which kept me wondering, as those work with the normal xenforo smtp settings.
 
Sorry if I wasn't clear. So this addon is all about the bouncing? I thought bouncing was a feature and that the main thing is about mandrill, mailgun.. support, which kept me wondering, as those work with the normal xenforo smtp settings.

This add-on delivers the mail via REST-API to Mandrill, whereas XenForo does it via regular SMTP.
 
No. You will need to manually download the CSV from Mandrill, figure out which ones are still actively bouncing vs expired (Mandrill lists everyone on the bounce list, even if expired), and use a SQL query against your DB to mark those users' email addresses as bouncing.
 
No. You will need to manually download the CSV from Mandrill, figure out which ones are still actively bouncing vs expired (Mandrill lists everyone on the bounce list, even if expired), and use a SQL query against your DB to mark those users' email addresses as bouncing.
Sorry, I don't understand :) In which case and why we should do this? Can you please explain it more?
 
Heard back from Mandrill support.

They are very prompt, have detailed answers, but unfortunately it sounds like once you hit 1,000 entries on the blacklist, it's impossible to get additional entries through polling that endpoint. This is because they only ever return the first 1,000 entries, regardless of status whether active or expired, and b) it's impossible to remove an email from the blacklist... delete only changes it from active to expired, and it'll still be on the list. So even if you filter by 'active', behind the scenes it's just grabbing the first 1,000 emails, then stopping, filtering for active, and returning those. So if the first 1,000 entries have expired, you'll get 'no entries' for the active blacklist, even though there might be a ton more beyond that first 1,000.

So effectively [BD] Mails bounce handling is COMPLETELY BROKEN once your Mandrill account has had 1,000 unique email addresses bounce--regardless of whether they've expired off the blacklist or not.

This explains why people are getting weird BD Mails errors. Either @xfrocks needs to change how he retrieves the list of bounced emails from Mandrill, or Mandrill needs to change the way their blacklist API call works.

Mandrill suggested that the best way to retrieve bounces is setup a webhook, which requires this addon to create an endpoint within the forum... from an API standpoint, it's definitely a better solution than the way BD Mails currently works of repeatedly polling Mandrill's servers for the entire blacklist. However, it might be difficult to add a webhook endpoint within Xenforo addon code, I don't know.

In addition, I still think Mandrill's blacklist API functionality is pretty broken--they should be able to retrieve the first 1,000 active at a time, or even the first 100 active. So you know that if you query for active, and get no results, that you truly have no emails currently active on the blacklist. If you are affected by this problem, it's worth dropping an email to help@mandrill.com and ask them to fix it, so they know that customers are affected by it.

Here's what they said in response to my two bug reports about broken API functionality and broken web UI functionality for the blacklist:
@xfrocks any plans to fix this?
 
Hello,

Is there a way to set either of these values? "ou can enable a custom return path domain on a per-message basis using the return_path_domain parameter (API), X-MC-ReturnPathDomain (SMTP), or globally for your account under Settings > Sending Defaults > Return Path Domain. Global account settings apply for all emails by default, but if the API call or SMTP headers have different tracking options, this will override the account default setting." Using Mandrill.

Thanks!
 
This add-on existed before the bouncing feature was included in xenForo. Using this add-on saves you from maintaining an extra bouncing mailbox. Beside that, there is no difference.
I am continuing to use this as for some reason no matter what i try i can not get bounce to work on my server so this is a good solution for me.
 
i get this error when cron runs

  • The requested user could not be found.
  • Please enter a valid password.
  • Please enter a valid name.
  • Please enter a value for the required field 'user_group_id'.
 
Top Bottom