Discussion:
X-Spam-Status to log
(too old to reply)
İhsan Doğan
2016-04-22 18:11:09 UTC
Permalink
Hello,

Is it possible to add the X-Spam-Status additionally to the amavis log line?



Ihsan
--
***@dogan.ch http://blog.dogan.ch/
Patrick Ben Koetter
2016-04-22 19:49:13 UTC
Permalink
Post by İhsan Doğan
Hello,
Is it possible to add the X-Spam-Status additionally to the amavis log line?
Try this:

$log_templ = '
[?%#D||Passed #
[? [:ccat|major] |#
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
UNCHECKED|BANNED (%F)|INFECTED (%V)] {[:actions_performed]}#
, [? %p ||%p ][?%a||[?%l||LOCAL ][:client_addr_port] ][?%e||\[%e\] ]%s -> [%D|,]#
[? %q ||, quarantine: %q]#
[? %Q ||, Queue-ID: %Q]#
[? %m ||, Message-ID: %m]#
[? %r ||, Resent-Message-ID: %r]#
[? %i ||, mail_id: %i]#
, Hits: [:SCORE]#
, size: %z#
[? [:partition_tag] ||, pt: [:partition_tag]]#
[? %#T ||, Tests: \[[%T|,]\]]#
, %y ms#
]
[?%#O|#|Blocked #
[? [:ccat|major|blocking] |#
OTHER|CLEAN|MTA-BLOCKED|OVERSIZED|BAD-HEADER-[:ccat|minor]|SPAMMY|SPAM|\
UNCHECKED|BANNED (%F)|INFECTED (%V)] {[:actions_performed]}#
, [? %p ||%p ][?%a||[?%l||LOCAL ][:client_addr_port] ][?%e||\[%e\] ]%s -> [%O|,]#
[? %q ||, quarantine: %q]#
[? %Q ||, Queue-ID: %Q]#
[? %m ||, Message-ID: %m]#
[? %r ||, Resent-Message-ID: %r]#
[? %i ||, mail_id: %i]#
, Hits: [:SCORE]#
, size: %z#
[? [:partition_tag] ||, pt: [:partition_tag]]#
[? %#T ||, Tests: \[[%T|,]\]]#
, %y ms#
]';


You should see something like this in your log:

Apr 22 04:45:18 echo amavis[27999]: (27999-03) Passed CLEAN {AcceptedInbound}, AM.PDP-SOCK [69.163.254.50] [209.85.213.66] <***@example.com> -> <***@sys4.de>, Queue-ID: 3qrg2j0YzSzyxg, Message-ID: <CAPBvRV9BwoPFYH-MSpiac3Qjr2Hjfxsj_nkYM-***@example.com>, mail_id: xHpF37B1Ok2D, Hits: 0.313, size: 13196, Tests: [DKIM_ADSP_CUSTOM_MED=0.001,DKIM_SIGNED=0.1,FREEMAIL_FORGED_FROMDOMAIN=0.199,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.001,HTML_MESSAGE=0.001,T_DKIM_INVALID=0.01], 891 ms

***@rick
--
[*] sys4 AG

https://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein
İhsan Doğan
2016-04-22 20:01:46 UTC
Permalink
Hi Patrick,
Post by İhsan Doğan
Is it possible to add the X-Spam-Status additionally to the amavis log line?
[...]
Works like a charm. Thank you very much!



Ihsan
--
***@dogan.ch http://blog.dogan.ch/
Loading...