[03/Apr/2023 13:07:04] "POST /redacted/inbound/ HTTP/1.1" 500 104741
Internal Server Error: /redacted/inbound/
Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner
response = get_response(request)
File "/opt/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 55, in wrapped_view
return view_func(*args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/anymail/webhooks/base.py", line 67, in dispatch
return super().dispatch(request, *args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatch
return handler(request, *args, **kwargs)
File "/opt/venv/lib/python3.10/site-packages/anymail/webhooks/base.py", line 81, in post
events = self.parse_events(request)
File "/opt/venv/lib/python3.10/site-packages/anymail/webhooks/postmark.py", line 26, in parse_events
return [self.esp_to_anymail_event(esp_event)]
File "/opt/venv/lib/python3.10/site-packages/anymail/webhooks/postmark.py", line 169, in esp_to_anymail_event
attachments = [
File "/opt/venv/lib/python3.10/site-packages/anymail/webhooks/postmark.py", line 172, in <listcomp>
content=attachment["Content"],
KeyError: 'Content'
(Pdb) esp_event.get("Attachments", [])
[{'Name': 'test.txt', 'ContentType': 'text/plain', 'Data': 'VGhpcyBpcyBhdHRhY2htZW50IGNvbnRlbnRzLCBiYXNlLTY0IGVuY29kZWQu', 'ContentLength': 45}]
I'll follow up to figure out what's causing this issue. It might be an issue at Postmark, but given that the view crashes as a result of it I'll report it here first.
It seems like the inbound test email from postmark can not be parsed by anymail
After pressing the check button in postmark:
Some debugging
I checked the developer guide by postmark and it seems like anymail is doing the right thing.
The documentation also mentions
Content, but in my case I'm seeing aDatakey.I'll follow up to figure out what's causing this issue. It might be an issue at Postmark, but given that the view crashes as a result of it I'll report it here first.