imapsieve fail to pipe to sa-learn-spam.sh
Hello,
I'm trying to get Dovecot 2.31, pidgeonhole 0.51 going with imapsieve and rspamd. I'm getting the below in my errorlog:
cat dovecot.log 2018-04-13 17:35:34 imap-login: Info: Login: user=<testuser@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=57977, secured, session=<o4T2psFpje5/AAAB> 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Error: sieve: pipe action: failed to pipe message to program: program `sa-learn-spam.sh' not found 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Info: sieve: left message in mailbox 'Spam' 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Error: sieve: Execution of script /usr/home/vmail/sieve/global/report-spam.sieve failed 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Info: copy from INBOX: box=Spam, uid=1, msgid=, size=1638 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Info: delete: box=INBOX, uid=2, msgid=, size=1638 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Info: expunge: box=INBOX, uid=2, msgid=, size=1638 2018-04-13 17:35:34 indexer-worker(testuser@domain.com)<59488><o4T2psFpje5/AAAB:5O+4G6Yi0Vpg6AAA0J78UA>: Info: Indexed 0 messages in Spam 2018-04-13 17:35:34 imap(testuser@domain.com)<57977><o4T2psFpje5/AAAB>: Info: Logged out in=144 out=1227 deleted=1 expunged=1 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
90-plugin.conf excerpt: plugin { sieve_plugins = sieve_imapsieve sieve_extprograms sieve_before = /home/vmail/sieve/global/admin.sieve sieve = file:/home/vmail/sieve/%d/%n/scripts;active=/home/vmail/sieve/%d/%n/active-script.sieve
# Spam learning
# From elsewhere to Spam folder imapsieve_mailbox1_name = Spam imapsieve_mailbox1_causes = COPY imapsieve_mailbox1_before = file:/home/vmail/sieve/global/report-spam.sieve
# From Spam folder to elsewhere imapsieve_mailbox2_name = * imapsieve_mailbox2_from = Spam imapsieve_mailbox2_causes = COPY imapsieve_mailbox2_before = file:/home/vmail/sieve/global/report-ham.sieve sieve_pipe_bin_dir = /home/vmail/sieve sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute +vnd.dovecot.environment
Here are my sieve scripts, they have been compiled, and the shell scripts, all are owned and group of vmail:vmail and the scripts are 775. home/vmail/sieve/global#cat report-spam.sieve require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; if environment :matches "imap.user" "*" { set "username" "${1}"; } pipe :copy "sa-learn-spam.sh" [ "${username}" ];
/home/vmail/sieve/global#cat 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}" ];
/home/vmail/sieve/global#cat sa-learn-spam.sh #!/bin/sh exec /usr/local/bin/rspamc -h /var/run/rspamd/rspamd.sock -P "Password" learn_spam
/home/vmail/sieve/global#cat sa-learn-ham.sh #!/bin/sh exec /usr/local/bin/rspamc -h /var/run/rspamd/rspamd.sock -P "password" learn_ham
I'd appreciate any suggestions.
Thanks. Dave.
Where did you put your script sa-learn-spam.sh? According to your configuration (sieve_pipe_bin_dir) it should be at /home/vmail/sieve. Rememer also to make it executable.
Rubeno
participants (2)
-
David Mehler
-
Rubén Fernández Asensio