Cocoland Asaf
Cocoland Asaf

Reputation: 28

Django + Anymail + Mailgun Webhook => no HTTP_AUTHORIZATION in META

I am trying to get a Webhook (on email open) http (not https) post request from Mailgun using Anymail under Django.

After sending an email successfully and open it, the request is sent to my server from Mailgun but then for some reason I keep getting this in my logs:

"Missing or invalid basic auth in Anymail Mailgun webhook"

I am using Apache server with Ubuntu 14.04 and Python 2.7.12. I tried using Django test server and there it works fine.

In my setting.py, I have:

ANYMAIL = {
    "MAILGUN_API_KEY": "key-f962ecaf....",
    'WEBHOOK_AUTHORIZATION': 'SJEi3JF...:Qo9Eu1...'
}
EMAIL_BACKEND = "anymail.backends.mailgun.MailgunBackend"

And of course Anymail is in my INSTALLED_APPS.

The webhook url in Mailgun is:

http://SJEi3JF...:[email protected]/appname/anymail/mailgun/tracking/

I have a feeling that it some how related to Post params blocked by Django.


After a deeper check, I have found that no HTTP_AUTHORIZATION in request.META and still I don't know why.

Upvotes: 1

Views: 586

Answers (1)

pymarco
pymarco

Reputation: 8195

I resolved this issue by adding the following to my apache conf.

WSGIPassAuthorization On

Upvotes: 1

Related Questions