Mathias Markl 7 years ago
parent
commit
00224a8cc1
  1. 2
      muk_web_preview_mail/__manifest__.py
  2. 6
      muk_web_preview_mail/controllers/main.py

2
muk_web_preview_mail/__manifest__.py

@ -27,7 +27,7 @@
Currently the following mail extensions are supported:
- Microsoft Outlook Express Mail Message (*.eml, message/rfc822)
""",
"version": "11.0.1.0.2",
"version": "11.0.1.0.3",
"category": "Extra Tools",
"license": "AGPL-3",
"website": "http://www.mukit.at",

6
muk_web_preview_mail/controllers/main.py

@ -88,8 +88,8 @@ class MailParserController(http.Controller):
return werkzeug.exceptions.UnsupportedMediaType(_("Unparsable message! The file has to be of type: message/rfc822"))
except requests.exceptions.RequestException as exception:
return self._make_error_response(exception.response.status_code, exception.response.reason or _("Unknown Error"))
mail_cache[url] = message.copy()
return self._make_parse_response(request.httprequest.url, message, attachment)
mail_cache[url] = message
return self._make_parse_response(request.httprequest.url, message.copy(), attachment)
def _set_query_parameter(self, url, param_name, param_value):
scheme, netloc, path, query_string, fragment = parse.urlsplit(url)
@ -113,7 +113,7 @@ class MailParserController(http.Controller):
def _make_parse_response(self, url, message, attachment):
if attachment:
for file in message["attachments"]:
if file.fname == attachment:
if file.fname and file.fname == attachment:
return self._make_attachment_response(file.content, file.fname)
else:
attachments = []

Loading…
Cancel
Save