mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Two bugfixes. One was affecting both webmail and quarantine modules.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
new Element('input', {
|
||||
'type' : 'hidden', 'name' : "action", style: "display:none", 'value' : name
|
||||
}).inject($("listingform"), "top");
|
||||
{% url extensions.amavis_quarantine.main.process as actionurl %}
|
||||
{% url extensions.amavis_quarantine.views.process as actionurl %}
|
||||
$("listingform").set("action", "{{ actionurl }}");
|
||||
$("listingform").set("send", {
|
||||
onSuccess : function(res) {
|
||||
|
||||
@@ -149,6 +149,9 @@ class Email(object):
|
||||
if re.match("^attachment", part["Content-Disposition"]):
|
||||
self.attachments += [part]
|
||||
continue
|
||||
if part.get_content_type() == "text/calendar":
|
||||
contents["plain"] += part.get_payload(decode=True)
|
||||
continue
|
||||
if part.get_content_type() in ("text/html", "text/plain"):
|
||||
contents[part.get_content_subtype()] += part.get_payload(decode=True)
|
||||
if mode != "html" or links == "0":
|
||||
@@ -178,6 +181,7 @@ class Email(object):
|
||||
mode = "plain"
|
||||
else:
|
||||
mode = "html"
|
||||
|
||||
self.pre, self.body = \
|
||||
getattr(self, "viewmail_%s" % mode)(contents[mode], links=links)
|
||||
|
||||
@@ -206,6 +210,8 @@ class Email(object):
|
||||
return (True, body)
|
||||
|
||||
def viewmail_html(self, content, **kwargs):
|
||||
if content is None or content == "":
|
||||
return (False, "")
|
||||
links = kwargs.has_key("links") and kwargs["links"] or "0"
|
||||
html = lxml.html.fromstring(content)
|
||||
if links == "0":
|
||||
|
||||
Reference in New Issue
Block a user