nonunique log_id in miltermode

Andreas Schulze via amavis-users amavis-users at amavis.org
Thu Nov 21 08:38:58 CET 2013


Hello,

we found the logging of amavisd(-milter)? not as unique as it should be.
(MTA -> amavisd-milter -> amavisd) 

Nov 21 07:12:13 idvamavis03 amavisd-milter[4245]: 3dQ9R01QltzDP38: log_id=06573
Nov 21 07:12:55 idvamavis03 amavisd-milter[4245]: 3dQ9Rn2sGVzDP38: log_id=06573

# grep '(06573)' /var/log/mail | grep mail_id | wc -l
20

This is exactly $max_requests.

Digging into amavisd I found a function new_am_id responsible for id generation.
In miltermode it's called in line 19627 with a value of 'undef' which takes only the pid as log_id.

In Line 20234 new_am_id get $Amavis::child_invocation_count as additional parameter.

Atttached patch (amavisd-new-2.8.2-rc1) add $Amavis::child_invocation_count to the new_am_id
in miltermode and produces the expected logging:

Nov 21 05:19:53 taro amavisd-milter[11126]: 3dQ6xN2mnDz259S: log_id=28605-20
Nov 21 06:00:01 taro amavisd-milter[11126]: 3dQ7qb5sqJz259S: log_id=28606-20
Nov 21 06:11:39 taro amavisd-milter[11126]: 3dQ8521V0Xz259S: log_id=04856-01
Nov 21 06:31:00 taro amavisd-milter[11126]: 3dQ8WR1ZgDz259S: log_id=09749-01
Nov 21 06:32:00 taro amavisd-milter[11126]: 3dQ8Xc02WHz259S: log_id=04856-02

Any objections to solve the issue in an other way?
Andreas

-- 
Andreas Schulze
Internetdienste | P252

DATEV eG
90329 Nürnberg | Telefon +49 911 319-0 | Telefax +49 911 319-3196
E-Mail info @datev.de | Internet www.datev.de
Sitz: 90429 Nürnberg, Paumgartnerstr. 6-14 | Registergericht Nürnberg, GenReg Nr.70
Vorstand
Prof. Dieter Kempf (Vorsitzender)
Dipl.-Kfm. Wolfgang Stegmann (stellvertretender Vorsitzender)
Dipl.-Kfm. Michael Leistenschneider
Dipl.-Kfm. Dr. Robert Mayr
Jörg Rabe v. Pappenheim
Dipl.-Vw. Eckhard Schwarzer
Vorsitzender des Aufsichtsrates: Reinhard Verholen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unique_log_id_in_miltermode.patch
Type: text/x-diff
Size: 798 bytes
Desc: not available
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20131121/d2b59a00/attachment.patch>


More information about the amavis-users mailing list