Hi there,
I've set[]up Dovecote2 + Postfix + SpamAssassin on my FreeBSD 10 VPS and it works flawlessly. Though, I couldn't set[]up the Dovecot Antispam plugin to train SpamAssassin when I move mails to the Junk folder.
I installed the plugin from ports and followed the official documentation and the man page without any success.
This is my /usr/local/etc/dovecot/dovecot.conf:
And, this the script /mail/sa-learn-pipe.sh:
I made it excecutable by all users using
The problem is there is no log in /var/log/maillog regarding the Antispam plugin, and the script won't get called when I moved any message in/out to/from Junk folder.
I'll appreciate any help.
I've set[]up Dovecote2 + Postfix + SpamAssassin on my FreeBSD 10 VPS and it works flawlessly. Though, I couldn't set[]up the Dovecot Antispam plugin to train SpamAssassin when I move mails to the Junk folder.
I installed the plugin from ports and followed the official documentation and the man page without any success.
This is my /usr/local/etc/dovecot/dovecot.conf:
Code:
auth_mechanisms = plain login digest-md5
disable_plaintext_auth = no
first_valid_gid = 6
first_valid_uid = 26
last_valid_gid = 6
last_valid_uid = 26
lmtp_save_to_detail_mailbox = yes
mail_gid = mail
mail_location = mdbox:/mail/%d/%u
mail_privileged_group = mail
mail_uid = mailnull
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
inbox = yes
location =
mailbox Archive {
#auto = create
auto = no
special_use = \Archive
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Flagged {
#auto = create
auto = no
special_use = \Flagged
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
mailbox virtual/All {
auto = no
special_use = \All
}
prefix =
separator = /
}
passdb {
args = /mail/%d/dovecot_passwd
driver = passwd-file
}
plugin {
antispam_backend = MAILTRAIN
antispam_mail_spam = --spam
antispam_mail_notspam = --ham
antispam_mail_sendmail = /mail/sa-learn-pipe.sh
antispam_spam = Junk
antispam_trash = Trash
quota_rule = *:storage=8GB
sieve = /mail/%d/%u/dovecot.sieve
sieve_dir = /mail/%d/%u
sieve_global_dir = /mail/sieve
sieve_global_path = /mail/sieve/globalfilter.sieve
}
protocols = imap pop3 lmtp sieve
service auth {
unix_listener auth-client {
group = mail
mode = 0660
user = postfix
}
unix_listener auth-master {
group = mail
mode = 0600
user = mailnull
}
user = root
}
service imap-login {
inet_listener imap {
address = *
port = 143
}
inet_listener imaps {
address = *
port = 993
}
process_limit = 32
process_min_avail = 1
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0660
user = postfix
}
}
service managesieve-login {
inet_listener sieve {
port = 4190
}
process_min_avail = 0
service_count = 1
vsz_limit = 64 M
}
service managesieve {
process_limit = 1024
}
service pop3-login {
inet_listener pop3 {
address = *
port = 110
}
inet_listener pop3s {
address = *
port = 995
}
process_limit = 32
process_min_avail = 1
}
ssl_cert = </etc/ssl/dovecot/cert.pem
ssl_key = </etc/ssl/dovecot/key.pem
userdb {
args = /mail/%d/dovecot_passwd
driver = passwd-file
}
verbose_proctitle = yes
protocol lmtp {
mail_plugins = $mail_plugins sieve
postmaster_address = postmaster@SomeDomain.com
quota_full_tempfail = yes
}
protocol sieve {
mail_max_userip_connections = 10
managesieve_implementation_string = Dovecot Pigeonhole
managesieve_logout_format = bytes=%i/%o
managesieve_max_line_length = 65536
}
protocol imap {
imap_client_workarounds = delay-newmail tb-extra-mailbox-sep
mail_plugins = $mail_plugins quota imap_quota antispam
}
protocol pop3 {
mail_plugins = $mail_plugins quota
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
mail_plugins = $mail_plugins quota sieve
postmaster_address = postmaster@SomeDomain.com
sendmail_path = /usr/local/sbin/sendmail
}
And, this the script /mail/sa-learn-pipe.sh:
Code:
#!/bin/sh
echo /usr/local/bin/sa-learn $* /tmp/sendmail-msg-$$.txt
echo "$$-start ($*)" >> /tmp/sa-learn-pipe.log
#echo $* > /tmp/sendmail-parms.txt
cat<&0 >> /tmp/sendmail-msg-$$.txt
/usr/local/bin/sa-learn $* /tmp/sendmail-msg-$$.txt
rm -f /tmp/sendmail-msg-$$.txt
echo "$$-end" >> /tmp/sa-learn-pipe.log
exit 0
I made it excecutable by all users using
chmod a+x /mail/sa-learn-pipe.sh
The problem is there is no log in /var/log/maillog regarding the Antispam plugin, and the script won't get called when I moved any message in/out to/from Junk folder.
I'll appreciate any help.