amavis-user October 2010 archive
Main Archive Page > Month Archives  > amavis-user archives
amavis-user: Re: [AMaViS-user] Logging triggered tests for all m

Re: [AMaViS-user] Logging triggered tests for all messages?

From: Mark Martinec <Mark.Martinec+amavis_at_nospam>
Date: Mon Oct 11 2010 - 14:18:18 GMT
To: amavis-user@lists.sourceforge.net

Danilo,

> I'd like to always log tests triggered by messages. Right now I have
> log level = 2 and tests are only logged for messages sent to
> @local_domains_maps ... SPAM-TAG, <someone@somewhere.else> -> ...
> I'd like to see such line for all messages, also those sent from my
> domain(s) to anyone else.
> Is that possible?

Don't bother with internal debug log entry like SPAM-TAG (which is
going away with 2.7.0 anyway). Just add a macro %T to your $log_templ,
e.g.:

[? %#T ||, Tests: \[[%T|,]\]]#

The default template can either be modified (the %T line uncommented, twice)
near the end of file 'amavisd', or replaced entirely in amavisd.conf,
for example:

$log_templ = <<'EOD';
# =============================================================================
# This text section governs how a main per-message amavisd-new log entry is
# formed (config variable $log_templ). An empty text will prevent a log entry,
# multiline text will produce multiple log entries, one for each nonempty line.
# Syntax is explained in the README.customize file.
[?%#D|#|Passed #
[? [:ccat|major] |OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER|SPAMMY|SPAM|\
UNCHECKED|BANNED (%F)|INFECTED (%V)]#
, [? %p ||%p ][?%a||[?%l||LOCAL ]\[%a\] ][?%e||\[%e\] ]%s -> [%D|,]#
[? %q ||, quarantine: %q]#
[? %Q ||, Queue-ID: %Q]#
[? %m ||, Message-ID: %m]#
[? %r ||, Resent-Message-ID: %r]#
, mail_id: %i#
, Hits: [:SCORE]#
, size: %z#
[? [:partition_tag] ||, pt: [:partition_tag]]#
[~[:remote_mta_smtp_response]|["^$"]||[", queued_as: "]]\
[remote_mta_smtp_response|[~%x|["queued as ([0-9A-Z]+)$"]|["%1"]|["%0"]]|/]#
#[? [:header_field|Subject]||, Subject: [:dquote|[:header_field|Subject|100]]]#
#[? [:header_field|From] ||, From: [:uquote|[:header_field|From|100]]\
#[? [:dkim|author] || (dkim:AUTHOR)]]#
#[? [:useragent|name] ||, [:useragent|name]: [:uquote|[:useragent|body]]]#
[? %#T ||, Tests: \[[%T|,]\]]#
#[:supplementary_info|SCTYPE|, shortcircuit=%%s]#
#[:supplementary_info|AUTOLEARN|, autolearn=%%s]#
#[:supplementary_info|AUTOLEARNSCORE|, autolearnscore=%%s]#
#[? [:supplementary_info|LANGUAGES] ||, languages=[:uquote|[:supplementary_info|LANGUAGES]]]#
#[? [:supplementary_info|RELAYCOUNTRY] ||, relaycountry=[:uquote|[:supplementary_info|RELAYCOUNTRY]]]#
#[? [:supplementary_info|ASN] ||, asn=[:uquote|[:supplementary_info|ASN] [:supplementary_info|ASNCIDR]]]#
[? [:dkim|identity] ||, dkim_id=[:dkim|identity]]#
, %y ms#
]
[?%#O|#|Blocked #
[? [:ccat|major|blocking] |#
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER|SPAMMY|SPAM|\
UNCHECKED|BANNED (%F)|INFECTED (%V)]#
, [? %p ||%p ][?%a||[?%l||LOCAL ]\[%a\] ][?%e||\[%e\] ]%s -> [%O|,]#
[? %q ||, quarantine: %q]#
[? %Q ||, Queue-ID: %Q]#
[? %m ||, Message-ID: %m]#
[? %r ||, Resent-Message-ID: %r]#
, mail_id: %i#
, Hits: [:SCORE]#
, size: %z#
[? [:partition_tag] ||, pt: [:partition_tag]]#
#, smtp_resp: [:smtp_response]#
#[? [:header_field|Subject]||, Subject: [:dquote|[:header_field|Subject|100]]]#
#[? [:header_field|From] ||, From: [:uquote|[:header_field|From|100]]\
#[? [:dkim|author] || (dkim:AUTHOR)]]#
#[? [:useragent|name] ||, [:useragent|name]: [:uquote|[:useragent|body]]]#
[? %#T ||, Tests: \[[%T|,]\]]#
#[:supplementary_info|SCTYPE|, shortcircuit=%%s]#
#[:supplementary_info|AUTOLEARN|, autolearn=%%s]#
#[:supplementary_info|AUTOLEARNSCORE|, autolearnscore=%%s]#
#[? [:supplementary_info|LANGUAGES] ||, languages=[:uquote|[:supplementary_info|LANGUAGES]]]#
#[? [:supplementary_info|RELAYCOUNTRY] ||, relaycountry=[:uquote|[:supplementary_info|RELAYCOUNTRY]]]#
#[? [:supplementary_info|ASN] ||, asn=[:uquote|[:supplementary_info|ASN] [:supplementary_info|ASNCIDR]]]#
[? [:dkim|identity] ||, dkim_id=[:dkim|identity]]#
, %y ms#
]
EOD

  Mark

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
 Please visit http://www.ijs.si/software/amavisd/ regularly
 For administrativa requests please send email to rainer at openantivirus dot org