sa-learn with remote Dovecot folders

Gedalya gedalya at gedalya.net
Fri Apr 10 01:49:51 UTC 2015


On 04/09/2015 08:41 PM, Gedalya wrote:
> doveadm user '*' | while read user; do
>     doveadm search -u $user mailbox Junk all | while read guid uid; do
>         doveadm -f flow fetch -u $user text mailbox-guid $guid uid 
> $uid | sed s/^text=// | ssh -i /path/to/ssh-key root@$spamassassin-box 
> "su -l -c 'spamassassin --report' $user"
>         # expunge, so we don't repeat it if no other reason
>         doveadm expunge -u $user mailbox-guid $guid uid $uid
>     done
> done 

Oh, actually `doveadm search -A mailbox Junk all` returns 3 columns - 
username, mailbox-guid, uid, so you don't need a separate command in the 
outer loop iterating over usernames :P ..




More information about the dovecot mailing list