<% from urlparse import urlparse from webhelpers.text import wrap_paragraphs from baruwa.lib.misc import _ from baruwa.lib.templates.helpers import datetimeformat, format_date from baruwa import __version__ as baruwaversion spam = [item for item in messages if item.spam] policy = [item for item in messages if not item.spam] hosturl = config.get('baruwa.default.url', 'http://localhost') host_parts = urlparse(str(hosturl)) %> ${config.get('baruwa.custom.name', 'Baruwa')} Quarantine report
${config.get('baruwa.custom.name', 'Baruwa')} Quarantine report
Want to access the full quarantine ?
View it online.

Quarantine Report

% if spam: % for i, item in enumerate(spam): <% if item.to_domain in host_urls: host = host_urls[item.to_domain] else: host = config.get('baruwa.default.url', 'http://localhost') hurl = urlparse(str(host)) %> % endfor % endif % if policy: % for i, item in enumerate(policy): <% if item.to_domain in host_urls: host = host_urls[item.to_domain] else: host = config.get('baruwa.default.url', 'http://localhost') hurl = urlparse(str(host)) %> % endfor % endif

${_('Spam Report')}

${_('Date/Time')}
${_('From Address')}
${_('Subject')}
${_('Release')}
${datetimeformat(format_date(item.timestamp, tzinfo), format='%Y-%m-%d %H:%M:%S')}
${'' if item.from_address is None else wrap_paragraphs(item.from_address, 25)}
${'' if item.subject is None else wrap_paragraphs(item.subject, 35)}
% if hasattr(item, 'uuid'): ${_('Release')} % else: ${_('Release')} % endif

${_('Policy Blocked Report')}

${_('Date/Time')}
${_('From Address')}
${_('Subject')}
${_('Release')}
${datetimeformat(format_date(item.timestamp, tzinfo), format='%Y-%m-%d %H:%M:%S')}
${'' if item.from_address is None else wrap_paragraphs(item.from_address, 25)}
${'' if item.subject is None else wrap_paragraphs(item.subject, 35)}
% if hasattr(item, 'uuid'): ${_('Request release')} % else: ${_('Request release')} % endif
${config.get('baruwa.custom.name', 'Baruwa')} : Powered by Baruwa [${baruwaversion}]