Setting up sieve with spam learning

Larry Rosenman larryrtx at gmail.com
Tue Feb 13 04:45:40 EET 2018


Make sure you sievec the sieve global scripts. 


-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 214-642-9640             E-Mail: larryrtx at gmail.com
US Mail: 5708 Sabbia Drive, Round Rock, TX 78665-2106

On 2/12/18, 8:41 PM, "dovecot on behalf of @lbutlr" <dovecot-bounces at dovecot.org on behalf of kremels at kreme.com> wrote:

    On 2018-02-12 (19:24 MST), @lbutlr <kremels at kreme.com> wrote:
    > 
    > Cribbing from the dovecot site I recently added the following lines to my dovecot.conf:
    > 
    > 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 index ihave duplicate mime foreverypart extracttext imapsieve vnd.dovecot.imapsieve
    > 
    > plugin {
    >  imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
    >  imapsieve_mailbox1_causes = COPY
    >  imapsieve_mailbox1_name = Junk
    >  imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
    >  imapsieve_mailbox2_causes = COPY
    >  imapsieve_mailbox2_from = Junk
    >  imapsieve_mailbox2_name = *
    >  sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
    >  sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
    >  sieve_plugins = sieve_imapsieve sieve_extprograms
    > }
    > 
    > protocol imap {
    >  mail_plugins = " virtual imap_sieve"
    > }
    > 
    > Now, should I see the report-spam or report-ham sieve's logged anywhere? Because I am not seeing them. 
    
    I did find some logging after looking more carefully:
    
    Feb 12 19:29:31 mail dovecot: imap(kreme): Error: sieve: report-spam: line 7: pipe command: invalid program name '/usr/local/bin/sa-learn-spam.sh'
    Feb 12 19:29:31 mail dovecot: imap(kreme): Error: sieve: report-spam: validation failed
    Feb 12 19:29:31 mail dovecot: imap(kreme): Error: sieve: Failed to compile script `/usr/lib/dovecot/sieve/report-spam.sieve'
    Feb 12 19:29:31 mail dovecot: imap(kreme): sieve: left message in mailbox 'Junk'
    
     # ls -ls /usr/local/bin/sa-learn-spam.sh 
    8 -rwx--x--x  1 root  wheel  54 Jan 23 18:12 /usr/local/bin/sa-learn-spam.sh
    
    # ls -lsa /usr/lib/dovecot/sieve/
    total 40
    8 drwxrwxrwx  2 root   wheel  512 Feb 12 19:29 .
    8 drwxr-xr-x  3 root   wheel  512 Jan 23 18:08 ..
    8 -rw-r--r--  1 root   wheel  329 Feb 12 19:29 report-ham.sieve
    8 -rw-r--r--  1 root   wheel  214 Feb 12 19:28 report-spam.sieve
    8 -rw-r--r--  1 kreme  wheel  354 Feb 12 19:27 report-spam.svbin
    
    # cat /usr/local/bin/sa-learn-spam.sh 
    #!/bin/sh
    exec /usr/local/bin/sa-learn -u ${1} --spam
    
    -- 
    "He has all the virtues I dislike and none of the vices I admire."
    Winston Churchill
    
    
    


More information about the dovecot mailing list