SparkPost Mail Transport for XF 2.3

SparkPost Mail Transport for XF 2.3 3.0.4

No permission to download
And this one...
Code:
SparkPost\SparkPostException: Job Hampel\SparkPostMail:MessageEvent: {"errors": [ {"message": "Unauthorized."} ]} src/addons/Hampel/SparkPostMail/vendor/sparkpost/sparkpost/lib/SparkPost/SparkPostPromise.php:77
Code:
#0 src/addons/Hampel/SparkPostMail/SubContainer/SparkPost.php(67): SparkPost\SparkPostPromise->wait()
#1 src/addons/Hampel/SparkPostMail/Job/MessageEvent.php(42): Hampel\SparkPostMail\SubContainer\SparkPost->getMessageEvents(1, 1000, Array, 1727085323, 1728035723)
#2 src/XF/Job/Manager.php(275): Hampel\SparkPostMail\Job\MessageEvent->run(8)
#3 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#4 src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 8)
#5 job.php(46): XF\Job\Manager->runQueue(false, 8)
#6 {main}
Code:
Previous GuzzleHttp\Exception\ClientException: Client error: `GET https://api.sparkpost.com/api/v1/events/message?page=1&per_page=1000&events=bounce,policy_rejection,out_of_band,generation_rejection,spam_complaint,list_unsubscribe,link_unsubscribe&from=2024-09-23T09%3A55&to=2024-10-04T09%3A55` resulted in a `401 Unauthorized` response:
{"errors": [ {"message": "Unauthorized."} ]}

 - src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
#0 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Middleware.php(72): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)
#1 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(209): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/TaskQueue.php(52): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(167): GuzzleHttp\Promise\TaskQueue->run()
#5 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(206): GuzzleHttp\Handler\CurlMultiHandler->tick()
#6 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(251): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#7 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#8 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#10 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#11 src/addons/Hampel/SparkPostMail/vendor/php-http/guzzle7-adapter/src/Promise.php(94): GuzzleHttp\Promise\Promise->wait(false)
#12 src/addons/Hampel/SparkPostMail/vendor/sparkpost/sparkpost/lib/SparkPost/SparkPostPromise.php(73): Http\Adapter\Guzzle7\Promise->wait(true)
#13 src/addons/Hampel/SparkPostMail/SubContainer/SparkPost.php(67): SparkPost\SparkPostPromise->wait()
#14 src/addons/Hampel/SparkPostMail/Job/MessageEvent.php(42): Hampel\SparkPostMail\SubContainer\SparkPost->getMessageEvents(1, 1000, Array, 1727085323, 1728035723)
#15 src/XF/Job/Manager.php(275): Hampel\SparkPostMail\Job\MessageEvent->run(8)
#16 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#17 src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 8)
#18 job.php(46): XF\Job\Manager->runQueue(false, 8)
#19 {main}

Was my Sparkpost account misconfigured?

View attachment 312014

I just changed to this

View attachment 312015

I'm running CF

View attachment 312016
View attachment 312017

Thanks.

Does your API key have the "Events Search: Read-only" permission?
 
But don't worry too much, I wanted to try the system to see how it worked, I finally went back because of the difficulty.

But maybe these mistakes will happen to others.

I noticed one thing, the DNS CNAME record that I entered in CF was validated by Sparkpost then refused, then validated again... (when we click on the button (revalidate the domain in Sparkpost). There may be an inconsistency here.
 
Error: Email to ********@icloud.com from ****@permaforo.net failed: Call to undefined method GuzzleHttp\Exception\ClientException::appendDebug() src/addons/Hampel/SparkPostMail/vendor/hampel/symfonymailer-sparkpost/src/Transport/AbstractHttpTransport.php:57

That's a bug in the error handling for that function.

I've released v3.0.3 to address this bug.

However, the fact that it's hitting that code means that the mail send attempt failed.

I suspect you've got a misconfiguration there - you're mailing domain is mailing.permaforo.net, but you're sending from @permaforo.net

You can send from @mailing.permaforo.net if your mailing domain is permaforo.net, but not the other way around - you need to either set up your root domain (permaforo.net) as a mailing domain, or send from @mailing.permaforo.net
 
But don't worry too much, I wanted to try the system to see how it worked, I finally went back because of the difficulty.

But maybe these mistakes will happen to others.

I noticed one thing, the DNS CNAME record that I entered in CF was validated by Sparkpost then refused, then validated again... (when we click on the button (revalidate the domain in Sparkpost). There may be an inconsistency here.

It could just be that the DNS wasn't fully updated yet and so SparkPost queried a DNS that didn't yet have the CNAME record? Cloudflare is pretty quick to push out DNS updates though, so it would be unusual for this to happen in my experience.
 
After update: Many errors like this:

Email to ****@gmx.de from forum@forum.com failed: Process failed with exit code 65: sendmail: envelope from address bounce@bounce.forum.com not accepted by the server sendmail: server message: 550-Requested action not taken: mailbox unavailable sendmail: server message: 550-Sender address is not allowed. sendmail: server message: 550 1MC2sH-1t8MEN4Bjx-000Jxr sendmail: could not send mail (account default from /homepages/config/smtp/msmtprc.u81283859)
 
Can I ask you, what is the delivery rate for your e-mails with SparkPost - for us in Sendgrid it is horrible.

And how many are you sending to? is that every week, months or ?
 
After update: Many errors like this:

Email to ****@gmx.de from forum@forum.com failed: Process failed with exit code 65: sendmail: envelope from address bounce@bounce.forum.com not accepted by the server sendmail: server message: 550-Requested action not taken: mailbox unavailable sendmail: server message: 550-Sender address is not allowed. sendmail: server message: 550 1MC2sH-1t8MEN4Bjx-000Jxr sendmail: could not send mail (account default from /homepages/config/smtp/msmtprc.u81283859)

This addon does not use sendmail - you've missed a configuration step somewhere.
 
Can I ask you, what is the delivery rate for your e-mails with SparkPost - for us in Sendgrid it is horrible.

And how many are you sending to? is that every week, months or ?

Last 30 days:

72K sends, 127 bounces

1728546173728.webp

Of those 127 bounces:
  • 38 mailbox full
  • 13 mail block (recipient address does not exist)
  • 12 mail block (message blocked by receiver)
  • 12 invalid recipient
  • 7 transient failure
  • 4 undetermined
  • 2 auto-reply
  • 1 spam block
I'm getting a lot of bot registrations on one of my sites - which I would think will be responsible for quite a few of those failures.

So overall - my mail deliverability is very good.

But I've also got a dedicated IP address and have automated bounce processing set up to prevent sending to invalid addresses once they have bounced.
 
Everything was ok until the update today;
now i get these errors.

Something is changed, the only thing i have changed is the add-on.

I can update a second forum also; but I am afraid that the mails will stop working there also.

BTW: Wenn i go to edit (sparkpost is used) and choose the radio for sparkpost i come back to the previous page; there is no edit form!
Should it be like this?

When i change the radio to go to phpmailer, then edit again and change to spark post, ther eis no edit form!


If I do the same on the previous version of your addon, i get a form to set values for your addon.

I will uninstall and install as next step.
 
Answer from SP:

Thank you for contacting Bird CRM.
It looks like the Sendmail process is somehow checking the return path address bounce@ for validity.
The domain has an MX record in place so I don't know why it would fail to send due to that.
I would recommend rolling back the changes / version of Sendmail to what you had before this issue occurred.
 
Last edited:
Back
Top Bottom