Hi,

I have use Dovecot, Spamassassin and Roundcube. My spam assassin is configured
to use SQL.

I have noticed that when I move a message to the junk folder, it increases the
number of spam on the database. But when I move it out of the junk folder, it
doesn’t increase the ham nor decreases the spam count.

When running sa-learn manually, it does everything right.

Here’s now 90-sieve.conf is configured; 

ieve_plugins = sieve_imapsieve sieve_extprograms
    sieve_before = /var/mail/vmail/mail/sieve/global/spam-global.sieve
    sieve = file:/var/mail/vmail/mail/sieve/%d/%n/scripts;active=/var/mail/
vmail/mail/sieve/%d/%n/active-script.sieve

    imapsieve_mailbox1_name = Spam
    imapsieve_mailbox1_causes = COPY
    imapsieve_mailbox1_before = file:/var/mail/vmail/mail/sieve/global/report-
spam.sieve

    imapsieve_mailbox2_name = *
    imapsieve_mailbox2_from = Spam
    imapsieve_mailbox2_causes = COPY
    imapsieve_mailbox2_before = file:/var/mail/vmail/mail/sieve/global/report-
ham.sieve

    imapsieve_mailbox2_name = Archive
    imapsieve_mailbox2_from = *
    imapsieve_mailbox2_causes = COPY
    imapsieve_mailbox2_before = file:/var/mail/vmail/mail/sieve/global/report-
ham.sieve

    sieve_execute_bin_dir = /usr/bin
    sieve_pipe_bin_dir = /var/mail/vmail/mail/sieve/global/scripts
    sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute

And here’s hoe my scripts are: 

/var/mail/vmail/mail/sieve/global/report-spam.sieve^C
root@9c8c309ee769:/# cat /var/mail/vmail/mail/sieve/global/report-spam.sieve
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables",
"vnd.dovecot.execute" ];

if environment :matches "imap.user" "*" {
  set "username" "${1}";
}

pipe :copy "sa-learn-spam.sh" [ "${username}" ];

/var/mail/vmail/mail/sieve/global/report-ham.sieve
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];

if environment :matches "imap.mailbox" "*" {
  set "mailbox" "${1}";
}

if string "${mailbox}" "Trash" {
  stop;
}

if environment :matches "imap.user" "*" {
  set "username" "${1}";
}

pipe :copy "sa-learn-ham.sh" [ "${username}" ];


sa-learn-ham.sh: 

#!/bin/sh
export PATH="/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:$PATH"
exec /usr/bin/spamc -u ${1} -L ham
exit 0

sa-learn-spam.sh

#!/bin/sh
export PATH="/usr/sbin;/usr/bin;/usr/local/bin;/usr/local/sbin;"
exec /usr/bin/spamc -u ${1} -L spam


Should I change for example: 

exec /usr/bin/spamc -u ${1} -L ham
to
exec /usr/bin/sa-learn -u ${1} —ham
?

Best,
Francis
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to