On 27 Jun 2023, at 12:00, amavis-users-requ...@amavis.org wrote:
>
>> It would be really nice to have a setting like sa_debug_sampling (or 
>> sa_debug_ratio, sa_debug_sample, etc.) taking an integer value (eg. 100) 
>> that would trigger debug logging for 1 email message every sa_debug_sampling 
>> messages (eg. 1 message every 100 messages).
>> The sampling can be fuzzy, for a sa_debug_sampling value of 100 I would not 
>> mind getting a debug output every 90 to 110 messages.
>>
>> Another way to address that could be time-based with a setting like 
>> sa_debug_interval taking an integer value in seconds (eg. 10) that would 
>> trigger debug logging for 1 email message every sa_debug_interval seconds 
>> (eg. 1 message every 10 secondes).
>>
> The implementation of such feature might have an impact on performance even 
> when it is disabled. The $sa_debug level is used inside SpamAssassin to 
> decide when to callback registered logging methods. Without monkeypatching 
> SA, Amavis would have to run SA with enabled debugging all the time and 
> filter-out dbg-loglines for non-sample messages afterwards.


I was under the impression that it’s already there: you can tune Amavisd-new to 
activate conditional debug inside SA depending on recipients address (that’s 
what I’m doing). I don’t understand how a change in condition (timing or number 
of messages) could affect performances in a more important way.
Could you elaborate on this?


> With amavis 2.13 you can prototype it yourself. Place a modified version of 
> Amavislog.pm inside a high-priority @INC directory, e.g:

Thanks for the code diff, I’ll take some time to understand how it works.

Patrick

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to