Don't use Amavisd verbose log '' as log template, because it logs mail subject, this may be illegal in some countries.
This commit is contained in:
parent
0959f8ff2b
commit
5633dc2cb0
|
@ -332,9 +332,61 @@ Open Amavisd config file `amavisd.conf`, add below lines in BEFORE the last line
|
|||
* on OpenBSD: it's `/etc/amavisd.conf`.
|
||||
|
||||
```
|
||||
# Always log verbose info of processed mail, including subject, SpamAssassin
|
||||
# testing results, etc, useful for troubleshooting..
|
||||
$log_templ = $log_verbose_templ;
|
||||
# Custom Amavisd log template to always log SpamAssassin testing results,
|
||||
# useful for troubleshooting. if you want more verbose log, replace it by:
|
||||
#
|
||||
# $log_templ = $log_verbose_templ;
|
||||
#
|
||||
# WARNING: $log_verbose_templ will log mail subject, this may be illegal
|
||||
# according to the laws in some countries.
|
||||
#
|
||||
# Note: You can find the original log template at the bottom of
|
||||
# /usr/sbin/amavisd-new.
|
||||
$log_templ = '
|
||||
[?%#D|#|Passed #
|
||||
[? [:ccat|major] |#
|
||||
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
|
||||
UNCHECKED[?[:ccat|minor]||-ENCRYPTED|]|BANNED (%F)|INFECTED (%V)]#
|
||||
{[:actions_performed]}#
|
||||
,[?%p|| %p][?%a||[?%l|| LOCAL] [:client_addr_port]][?%e|| \[%e\]] [:mail_addr_decode_octets|%s] -> [%D|[:mail_addr_decode_octets|%D]|,]#
|
||||
[? %q ||, quarantine: %q]#
|
||||
[? %Q ||, Queue-ID: %Q]#
|
||||
[? %m ||, Message-ID: [:mail_addr_decode_octets|%m]]#
|
||||
[? %r ||, Resent-Message-ID: [:mail_addr_decode_octets|%r]]#
|
||||
[? %i ||, 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-Za-z]+)$"]|["%1"]|["%0"]]|/]#
|
||||
#, Subject: [:dquote|[:mime2utf8|[:header_field_octets|Subject]|100|1]]#
|
||||
#, From: [:uquote|[:mail_addr_decode_octets|[:rfc2822_from]]]#
|
||||
[? [:dkim|sig_sd] ||, dkim_sd=[:dkim|sig_sd]]#
|
||||
[? [:dkim|newsig_sd] ||, dkim_new=[:dkim|newsig_sd]]#
|
||||
, %y ms#
|
||||
[? %#T ||, Tests: \[[%T|,]\]]#
|
||||
]
|
||||
[?%#O|#|Blocked #
|
||||
[? [:ccat|major|blocking] |#
|
||||
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
|
||||
UNCHECKED[?[:ccat|minor]||-ENCRYPTED|]|BANNED (%F)|INFECTED (%V)]#
|
||||
{[:actions_performed]}#
|
||||
,[?%p|| %p][?%a||[?%l|| LOCAL] [:client_addr_port]][?%e|| \[%e\]] [:mail_addr_decode_octets|%s] -> [%O|[:mail_addr_decode_octets|%O]|,]#
|
||||
[? %q ||, quarantine: %q]#
|
||||
[? %Q ||, Queue-ID: %Q]#
|
||||
[? %m ||, Message-ID: [:mail_addr_decode_octets|%m]]#
|
||||
[? %r ||, Resent-Message-ID: [:mail_addr_decode_octets|%r]]#
|
||||
[? %i ||, mail_id: %i]#
|
||||
, Hits: [:SCORE]#
|
||||
, size: %z#
|
||||
[? [:partition_tag] ||, pt: [:partition_tag]]#
|
||||
#, Subject: [:dquote|[:mime2utf8|[:header_field_octets|Subject]|100|1]]#
|
||||
#, From: [:uquote|[:mail_addr_decode_octets|[:rfc2822_from]]]#
|
||||
[? [:dkim|sig_sd] ||, dkim_sd=[:dkim|sig_sd]]#
|
||||
[? [:dkim|newsig_sd] ||, dkim_new=[:dkim|newsig_sd]]#
|
||||
, %y ms#
|
||||
[? %#T ||, Tests: \[[%T|,]\]]#
|
||||
]';
|
||||
```
|
||||
|
||||
Restarting Amavisd service is required.
|
||||
|
|
|
@ -376,9 +376,61 @@ log_level 0.</p>
|
|||
<li>on FreeBSD: it's <code>/usr/local/etc/amavisd.conf</code>.</li>
|
||||
<li>on OpenBSD: it's <code>/etc/amavisd.conf</code>.</li>
|
||||
</ul>
|
||||
<pre><code># Always log verbose info of processed mail, including subject, SpamAssassin
|
||||
# testing results, etc, useful for troubleshooting..
|
||||
$log_templ = $log_verbose_templ;
|
||||
<pre><code># Custom Amavisd log template to always log SpamAssassin testing results,
|
||||
# useful for troubleshooting. if you want more verbose log, replace it by:
|
||||
#
|
||||
# $log_templ = $log_verbose_templ;
|
||||
#
|
||||
# WARNING: $log_verbose_templ will log mail subject, this may be illegal
|
||||
# according to the laws in some countries.
|
||||
#
|
||||
# Note: You can find the original log template at the bottom of
|
||||
# /usr/sbin/amavisd-new.
|
||||
$log_templ = '
|
||||
[?%#D|#|Passed #
|
||||
[? [:ccat|major] |#
|
||||
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
|
||||
UNCHECKED[?[:ccat|minor]||-ENCRYPTED|]|BANNED (%F)|INFECTED (%V)]#
|
||||
{[:actions_performed]}#
|
||||
,[?%p|| %p][?%a||[?%l|| LOCAL] [:client_addr_port]][?%e|| \[%e\]] [:mail_addr_decode_octets|%s] -> [%D|[:mail_addr_decode_octets|%D]|,]#
|
||||
[? %q ||, quarantine: %q]#
|
||||
[? %Q ||, Queue-ID: %Q]#
|
||||
[? %m ||, Message-ID: [:mail_addr_decode_octets|%m]]#
|
||||
[? %r ||, Resent-Message-ID: [:mail_addr_decode_octets|%r]]#
|
||||
[? %i ||, 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-Za-z]+)$"]|["%1"]|["%0"]]|/]#
|
||||
#, Subject: [:dquote|[:mime2utf8|[:header_field_octets|Subject]|100|1]]#
|
||||
#, From: [:uquote|[:mail_addr_decode_octets|[:rfc2822_from]]]#
|
||||
[? [:dkim|sig_sd] ||, dkim_sd=[:dkim|sig_sd]]#
|
||||
[? [:dkim|newsig_sd] ||, dkim_new=[:dkim|newsig_sd]]#
|
||||
, %y ms#
|
||||
[? %#T ||, Tests: \[[%T|,]\]]#
|
||||
]
|
||||
[?%#O|#|Blocked #
|
||||
[? [:ccat|major|blocking] |#
|
||||
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
|
||||
UNCHECKED[?[:ccat|minor]||-ENCRYPTED|]|BANNED (%F)|INFECTED (%V)]#
|
||||
{[:actions_performed]}#
|
||||
,[?%p|| %p][?%a||[?%l|| LOCAL] [:client_addr_port]][?%e|| \[%e\]] [:mail_addr_decode_octets|%s] -> [%O|[:mail_addr_decode_octets|%O]|,]#
|
||||
[? %q ||, quarantine: %q]#
|
||||
[? %Q ||, Queue-ID: %Q]#
|
||||
[? %m ||, Message-ID: [:mail_addr_decode_octets|%m]]#
|
||||
[? %r ||, Resent-Message-ID: [:mail_addr_decode_octets|%r]]#
|
||||
[? %i ||, mail_id: %i]#
|
||||
, Hits: [:SCORE]#
|
||||
, size: %z#
|
||||
[? [:partition_tag] ||, pt: [:partition_tag]]#
|
||||
#, Subject: [:dquote|[:mime2utf8|[:header_field_octets|Subject]|100|1]]#
|
||||
#, From: [:uquote|[:mail_addr_decode_octets|[:rfc2822_from]]]#
|
||||
[? [:dkim|sig_sd] ||, dkim_sd=[:dkim|sig_sd]]#
|
||||
[? [:dkim|newsig_sd] ||, dkim_new=[:dkim|newsig_sd]]#
|
||||
, %y ms#
|
||||
[? %#T ||, Tests: \[[%T|,]\]]#
|
||||
]';
|
||||
</code></pre>
|
||||
|
||||
<p>Restarting Amavisd service is required.</p>
|
||||
|
|
Loading…
Reference in New Issue