Two bugfixes. One was affecting both webmail and quarantine modules.

This commit is contained in:
tonio
2010-06-18 18:24:14 +02:00
parent ac7ae13dac
commit f189602c8a
2 changed files with 7 additions and 1 deletions
@@ -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) {
+6
View File
@@ -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":