At a loss with antispan and imap_sieve

2020-09-20 Thread Ferenc
Hi,

It seems I can’t google my way out of this one. I’m trying to set up spam/ham 
learning but getting
nowhere.

I tried Johannes Berg Antispam plugin, and syslog shows:

Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program
/usr/lib/dovecot/retrain.sh
Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program
/usr/lib/dovecot/retrain.sh
Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program 
parameter 1 /mail/klaas
Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program 
parameter 2 ham

The file retrain.sh is simply:

#!/bin/sh
echo hi >> debug.log

...with debug.log being an empty world-writeable file in /usr/lib/dovecot. 

Absolutely nothing happens. The file debug.log is not even touched. But when I 
remove retrain.sh there’s an error logged so up
until then, *something* happens. 


After this I tried imap_sieve, following the wiki on dovecot.org, but again 
nothing happens. My imap.log says:
Info: sieve: pipe action: piped message to program `retrain.sh’

But again debug.log is untouched.

I’m fresh out of ideas here. Any help would be most welcome.

I’m on Debian in virtual machine, Postfix delivering mail to Dovecot LMTP 
delivering to virtual
maildirs, bogofilter for scanning incoming mail. Sieve does work for moving 
incoming spam to the
spam mailbox.

Cheers and thanks,

Ferenc


Re: At a loss with antispan and imap_sieve

2020-09-20 Thread Aki Tuomi


> On 21/09/2020 00:37 Ferenc  wrote:
> 
>  
> Hi,
> 
> It seems I can’t google my way out of this one. I’m trying to set up spam/ham 
> learning but getting
> nowhere.
> 
> I tried Johannes Berg Antispam plugin, and syslog shows:
> 
> Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program
> /usr/lib/dovecot/retrain.sh
> Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program
> /usr/lib/dovecot/retrain.sh
> Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program 
> parameter 1 /mail/klaas
> Sep 20 22:22:06 proefmail imap: antispam: running mailtrain backend program 
> parameter 2 ham
> 
> The file retrain.sh is simply:
> 
> #!/bin/sh
> echo hi >> debug.log
> 
> ...with debug.log being an empty world-writeable file in /usr/lib/dovecot. 
> 
> Absolutely nothing happens. The file debug.log is not even touched. But when 
> I remove retrain.sh there’s an error logged so up
> until then, *something* happens. 
> 
> 
> After this I tried imap_sieve, following the wiki on dovecot.org, but again 
> nothing happens. My imap.log says:
> Info: sieve: pipe action: piped message to program `retrain.sh’
> 
> But again debug.log is untouched.
> 
> I’m fresh out of ideas here. Any help would be most welcome.
> 
> I’m on Debian in virtual machine, Postfix delivering mail to Dovecot LMTP 
> delivering to virtual
> maildirs, bogofilter for scanning incoming mail. Sieve does work for moving 
> incoming spam to the
> spam mailbox.
> 
> Cheers and thanks,
> 
> Ferenc

Hi!

Those scripts are not ran as root, so you can't actually write to 
/usr/lib/dovecot, you should probably use some writable location.

Also,

https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/

Aki


Re: auth_passdb_request_finished request fires twice on IMAP login

2020-09-20 Thread Aki Tuomi


> On 19/09/2020 18:14 Eirik Rye  wrote:
> 
>  
> Hi,
> 
> Dovecot v2.3.11.3 (502c39af9)
> 
> auth_passdb_request_finished appears to fire twice for an IMAP login 
> using a Redis passdb. auth_request_finished only fires once.
> 
> In the debug log below, the line "Finished passdb lookup" appears to be 
> logged twice (once by "auth" and once by "auth-worker"). However, the 
> actual passdb lookup against Redis is only performed once. This is 
> confirmed by monitoring queries made against Redis.
> 
> Configuration:
> --
> 
> metric auth_passdb_request_finished {
>event_name = auth_passdb_request_finished
> }
> 
> auth_debug = yes
> passdb {
>auth_verbose = yes
>override_fields = proxy=y
>name = redis
>driver = dict
>args = /etc/dovecot/dovecot-redis.conf.ext
> }
> 
> --
> 
> With the above configuration, I am seeing the 
> auth_passdb_request_finished metric being incremented twice for every 
> successful login:



> 
> Best regards,
> Eirik

You can add 

category = service:auth 

to your metric to make it fire only once.

Aki