sieve-filter to script fails with SHUT_WR

Mark Stover mark.stover at gmail.com
Wed Dec 30 14:15:49 UTC 2015


Trying to make vnd.dovecot.filter to exchange an email with my script.
(I have a vnd.dovecot.pipe script working, so I'm pretty sure it's not
the configuration...) I'm passing the email using stdin/stdout and
_not_ using sockets.

My script receives the email and processes it, but the filter process fails:

lda(<username>): Error:
shutdown(/usr/local/lib/dovecot-sieve/sieve-filter/CleanAttachments.py,
SHUT_WR) failed: Socket is not connected
lda(<username>): Error: sieve: 20-filter-incoming: line 15: filter
action: failed to execute to program `CleanAttachments.py'

Not sure, what I'm doing wrong...

Thanks,
Mark

$ doveconf -n
# 2.2.21 (5345f22): /usr/local/etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.9 (357ac0a0e68b+)
# OS: Darwin 15.2.0 x86_64
lda_mailbox_autocreate = yes
mail_location = maildir:~/Maildir
maildir_broken_filename_sizes = yes
maildir_very_dirty_syncs = yes
plugin {
  sieve = file:~/.dovecot/sieve;active=~/.dovecot/sieve/user.sieve
  sieve_before = /usr/local/lib/dovecot-sieve/sieve.d/
  sieve_execute_bin_dir = /usr/local/lib/dovecot-sieve/sieve-execute
  sieve_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
+vnd.dovecot.filter +vnd.dovecot.debug
  sieve_filter_bin_dir = /usr/local/lib/dovecot-sieve/sieve-filter
  sieve_pipe_bin_dir = /usr/local/lib/dovecot-sieve/sieve-pipe
  sieve_plugins = sieve_extprograms
  sieve_user_log = ~/.dovecot/sieve/sieve.log
}
postmaster_address = mstover at cisco.com
protocol lda {
  info_log_path =
  log_path =
  mail_plugins = " sieve"
}

Sieve Script:

require [ "variables", "envelope", "vnd.dovecot.debug", "vnd.dovecot.filter" ];

   if envelope :matches "to" "*" { set "to" "${1}"; }
   if envelope :matches "from" "*" { set "from" "${1}"; }

   debug_log "Received message TO=${to} FROM=${from}";

   filter "CleanAttachments.py";

   debug_log "Returned from CleanAttachments";
   if envelope :matches "to" "*" { set "to" "${1}"; }
   if envelope :matches "from" "*" { set "from" "${1}"; }
   debug_log "Returned message TO=${to} FROM=${from}";


More information about the dovecot mailing list