Commit 271c8d53 authored by Claudemir Todo Bom's avatar Claudemir Todo Bom

* fix outlook spam/ham learning

parent 7f6feb10
Pipeline #190 passed with stage
in 1 minute and 18 seconds
......@@ -12,4 +12,8 @@ if environment :matches "imap.user" "*" {
set "username" "${1}";
}
pipe :copy "sa-learn-pipe.sh" [ "${username}", "ham" ];
if environment :matches "imap.cause" "*" {
set "cause" "${1}";
}
pipe :copy "sa-learn-pipe.sh" [ "${username}", "ham" , "${cause}" ];
......@@ -4,4 +4,8 @@ if environment :matches "imap.user" "*" {
set "username" "${1}";
}
pipe :copy "sa-learn-pipe.sh" [ "${username}", "spam" ];
if environment :matches "imap.cause" "*" {
set "cause" "${1}";
}
pipe :copy "sa-learn-pipe.sh" [ "${username}", "spam" , "${cause}" ];
#!/bin/bash
MYPID=$$
[ -d /var/spool/maildir/salearn-queue ] || mkdir /var/spool/maildir/salearn-queue
TEMPFILE=/var/spool/maildir/salearn-queue/salearn-msg-$$.$RANDOM.msg
......@@ -16,7 +18,10 @@ cat - > ${TEMPFILE}
SAUSER="$1"
SACOMMAND="--$2"
SACAUSE="$3"
[ -e /var/spool/maildir/salearn.pipe ] || ( /usr/bin/mkfifo /var/spool/maildir/salearn.pipe && /bin/chmod ugo+r /var/spool/maildir/salearn.pipe )
[ "${SACOMMAND}" ] && [ "${SAUSER}" ] && [ "${TEMPFILE}" ] && echo "${SACOMMAND} ${SAUSER} ${TEMPFILE}" > /var/spool/maildir/salearn.pipe
/usr/bin/logger -p mail.notice -t sa-learn-pipe\[${MYPID}\] "added to queue: Cause ${SACAUSE} / command: ${SACOMMAND} ${SAUSER} ${TEMPFILE}"
......@@ -117,10 +117,11 @@ cp roundcube/* /etc/roundcube/
cp -a www /var/www/html/wwmail
cp -a userapi /var/www/html/userapi
cp -a antispamsieve /etc/wwmail/antispamsieve
chown mail.mail /etc/wwmail/antispamsieve -R
chmod 0700 /etc/wwmail/antispamsieve -R
sievec /etc/wwmail/antispamsieve/learn_ham.sieve
sievec /etc/wwmail/antispamsieve/learn_spam.sieve
sievec /etc/wwmail/antispamsieve/learn.sieve
chown mail.mail /etc/wwmail/antispamsieve -R
chmod 0700 /etc/wwmail/antispamsieve -R
```
Os usuário e grupo `clamav` precisam ser ajustados para se integrar corretamente com o `exim`, para isso devem ser utilizados os seguintes comandos:
......
......@@ -24,7 +24,7 @@ plugin {
# From elsewhere to Junk folder
imapsieve_mailbox1_name = Junk
imapsieve_mailbox1_causes = COPY APPEND
imapsieve_mailbox1_causes = COPY
imapsieve_mailbox1_before = file:/etc/wwmail/antispamsieve/learn_spam.sieve
# From Junk folder to elsewhere
......@@ -33,6 +33,11 @@ plugin {
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_before = file:/etc/wwmail/antispamsieve/learn_ham.sieve
# Append action - used by Outlook when moving!
imapsieve_mailbox3_name = *
imapsieve_mailbox3_causes = APPEND
imapsieve_mailbox3_before = file:/etc/wwmail/antispamsieve/learn.sieve
sieve_pipe_bin_dir = /etc/wwmail/antispamsieve/
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment