From 5633dc2cb05983e6bcb0603a0c4d420958e4205c Mon Sep 17 00:00:00 2001 From: Zhang Huangbin Date: Thu, 26 May 2016 23:19:55 +0800 Subject: [PATCH] Don't use Amavisd verbose log '' as log template, because it logs mail subject, this may be illegal in some countries. --- .../upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md | 58 ++++++++++++++++++- html/upgrade.iredmail.0.9.4-0.9.5.html | 58 ++++++++++++++++++- 2 files changed, 110 insertions(+), 6 deletions(-) diff --git a/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md b/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md index 41e3e8f3..3f47f4cd 100644 --- a/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md +++ b/en_US/upgrade/0-upgrade.iredmail.0.9.4-0.9.5.md @@ -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. diff --git a/html/upgrade.iredmail.0.9.4-0.9.5.html b/html/upgrade.iredmail.0.9.4-0.9.5.html index dd2f9ff1..9d3c1f33 100644 --- a/html/upgrade.iredmail.0.9.4-0.9.5.html +++ b/html/upgrade.iredmail.0.9.4-0.9.5.html @@ -376,9 +376,61 @@ log_level 0.

  • on FreeBSD: it's /usr/local/etc/amavisd.conf.
  • 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.