<%
from baruwa.lib.templates.helpers import datetimeformat, format_date
%>
${config.get('baruwa.custom.name', 'Baruwa')}
${'=' * len(config.get('baruwa.custom.name', 'Baruwa'))}
<% 
	spam_items = [spam for spam in messages if spam.spam]
	policy_items = [spam for spam in messages if not spam.spam]
%>
% if spam_items:
Spam Report
============

Date/Time   		From                     				Subject          
==================================================================================================	
% for item in spam_items:
<%
line = "%s\t%s\t\t%s" % (datetimeformat(format_date(item.timestamp, tzinfo), format='%Y-%m-%d %H:%M:%S'), item.from_address or '', item.subject or '')
%>
+ ${line}              
% endfor
% endif
% if policy_items:
Policy Blocked Report
=====================

Date/Time   		From                     				Subject             
=================================================================================================
% for item in policy_items:
<%
line = "%s\t%s\t\t%s" % (datetimeformat(format_date(item.timestamp, tzinfo), format='%Y-%m-%d %H:%M:%S'), item.from_address or '', item.subject or '')
%>
+ ${line}              
% endfor
% endif

=================================================================================================
${config.get('baruwa.custom.name', 'Baruwa')} ${config.get('baruwa.custom.url', '-')} Powered by Baruwa - http://www.baruwa.com
