1 (edited by lakano 2015-08-19 23:06:23)

Topic: [SOLVED]sieve extprogram plugin is it really included in this release?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: Ubuntu Server 14.04.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): NginX
- Manage mail accounts with iRedAdmin-Pro? Not yet
- Related log if you're reporting an issue:

dovecot-sieve logs:

Aug 19 11:29:32 lda(guillaume.XXXX@YYYY.com): Error: sieve: dovecot: line 1: require command: unknown Sieve capability `vnd.dovecot.execute'
Aug 19 11:29:32 lda(guillaume.XXXX@YYYY.com): Error: sieve: dovecot: line 9: unknown test 'execute' (only reported once at first occurence)
Aug 19 11:29:32 lda(guillaume.XXXX@YYYY.com): Error: sieve: dovecot: validation failed
Aug 19 11:29:32 lda(guillaume.XXXX@YYYY.com): Error: sieve: failed to compile script /var/vmail/sieve/dovecot.sieve
Aug 19 11:29:32 lda(guillaume.XXXX@YYYY.com): Info: msgid=<CAPvxbadtcYdhgp3frtbs52jMKjhnKt++BK_NLORkbpAAbNub7g@mail.gmail.com>: saved mail to INBOX

====

Hello!

I'm trying to use Sieve plugin "extprograms".
In the /etc/dovecot/conf.d/90-sieve.conf there is this comment just before the line "sieve_plugins" :

# The sieve_extprograms plugin is included in this release.

I suppose I doesn't need to manually compile the plugin to install it.

So, I've enabled it as described in docs ( http://wiki2.dovecot.org/Pigeonhole/Sie … xtprograms ) :

sieve_plugins = sieve_extprograms

  sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.filter +vnd.dovecot.execute

  sieve_pipe_bin_dir = /usr/lib/dovecot/sieve-pipe
  sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
  sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute

Of course, I've created the folders /usr/lib/dovecot/sieve-* with my script (named "spamcha")

And I have updated the /var/vmail/sieve/dovecot.sieve

require ["fileinto", "vnd.dovecot.execute", "variables"];

# rule:[Move Spam to Junk Folder]
if header :is "X-Spam-Flag" "YES"
{
    fileinto "Junk";
}

if execute :output "spamcha_maildir" "spamcha" "${recipient}"
{
    fileinto "${spamcha_maildir}";
}

After restarting the dovecot service, and trying to send new email, I have this error in sieve logs:

Aug 19 11:29:32 lda(guillaume.XXXX@YYYY.com): Error: sieve: dovecot: line 1: require command: unknown Sieve capability `vnd.dovecot.execute'

So, there is a solution to known if the extprogram plugin is really included in this release please ?
If it's really included, so may be someone have an idea of how to make it works ?

Thanks a lots smile

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by Thierry 2015-08-19 21:29:34)

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

Is dovecot-sieve installed ?
have a look at the end of this link:

https://www.skelleton.net/2015/03/21/ho … ith-dmarc/

3

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

Thanks Thierry !

It's weird because there is 2 config files to updates on Ubuntu( /etc/dovecot/conf.d/90-sieve.conf and /etc/dovecot/dovecot.conf ), I'd only updated one.

Since I've updated the 2 files and updated changes as on your link in the lda.conf file, the error is now different:

lda(myem@il): Fatal: opendir(/usr/lib/dovecot/modules/sieve) failed: No such file or directory

The folder missing... but the debian/ubuntu package "dovecot-sieve" is correctly installed:

# dpkg -l | grep dovecot
ii  dovecot-antispam                    2.0+20130822-2build1                 amd64        Dovecot plugins for training spam filters
ii  dovecot-core                        1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - core files
ii  dovecot-imapd                       1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - IMAP daemon
ii  dovecot-lmtpd                       1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - LMTP server
ii  dovecot-managesieved                1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - ManageSieve server
ii  dovecot-mysql                       1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - MySQL support
ii  dovecot-pop3d                       1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - POP3 daemon
ii  dovecot-sieve                       1:2.2.9-1ubuntu2.1                   amd64        secure POP3/IMAP server - Sieve filters sup

Do you have another idea ?
Thanks for your help!

4

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

The wiki page says:

This plugin is only available for Pigeonhole v0.3 and higher (available for Dovecot v2.1).

What's your Pigeonhole version?

5 (edited by lakano 2015-08-19 22:12:55)

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

ZhangHuangbin wrote:

The wiki page says:
What's your Pigeonhole version?

On their documentation, they said for Debian it's included in dovecot-sieve / dovecot-managesieved packages, installed ( v2.2.9 ):

Debian

Starting with Debian Wheezy, Pigeonhole binaries are distributed in separate packages: dovecot-sieve for the Sieve interpreter and dovecot-managesieved for the ManageSieve service. You can install these by running:

apt-get install dovecot-sieve dovecot-managesieved

(source: http://wiki2.dovecot.org/Pigeonhole/Installation )

6

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

The binaries seems present:

# dpkg -L dovecot-sieve
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/dovecot-sieve
/usr/share/doc/dovecot-sieve/copyright
/usr/share/bug
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/sieve-test.1.gz
/usr/share/man/man1/sieve-dump.1.gz
/usr/share/man/man1/sieve-filter.1.gz
/usr/share/man/man1/sievec.1.gz
/usr/share/dovecot
/usr/share/dovecot/conf.d
/usr/share/dovecot/conf.d/90-sieve.conf
/usr/lib
/usr/lib/dovecot
/usr/lib/dovecot/modules
/usr/lib/dovecot/modules/lib90_sieve_extprograms_plugin.so
/usr/lib/dovecot/modules/doveadm
/usr/lib/dovecot/modules/doveadm/lib10_doveadm_sieve_plugin.so
/usr/lib/dovecot/modules/lib90_sieve_plugin.so
/usr/lib/dovecot/libdovecot-sieve.so.0.0.0
/usr/bin
/usr/bin/sieve-test
/usr/bin/sieve-dump
/usr/bin/sievec
/usr/bin/sieve-filter
/usr/share/doc/dovecot-sieve/changelog.Debian.gz
/usr/share/bug/dovecot-sieve
/usr/share/man/man1/sieved.1.gz
/usr/lib/dovecot/libdovecot-sieve.so
/usr/lib/dovecot/libdovecot-sieve.so.0

=> /usr/lib/dovecot/modules/lib90_sieve_extprograms_plugin.so

So this seems supported, but something in my configuration or in the binary link module doesn't works.

7

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

Note: iRedMail doesn't configure Dovecot to use files under /etc/dovecot/conf.d/. We use just /etc/dovecot/dovecot.conf and other files under /etc/dovecot/, but not /etc/dovecot/conf.d/.

Also, please show us your full Dovecot config with command 'dovecot -n'.

8

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

Ok, I understood better smile

Here is the error:

Aug 19 16:29:55 lda(guillaume.lecanu@nox-digital.com): Fatal: opendir(/usr/lib/dovecot/modules/sieve) failed: No such file or directory

And the dovecot -n:

# dovecot -n
# 2.2.9: /etc/dovecot/dovecot.conf
managesieve(root): Fatal: opendir(/usr/lib/dovecot/modules/sieve) failed: No such file or directory
doveconf: Error: managesieve-login: dump-capability process returned 89
# OS: Linux 3.13.0-62-generic x86_64 Ubuntu 14.04.1 LTS
auth_master_user_separator = *
auth_mechanisms = PLAIN LOGIN
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
first_valid_uid = 2000
last_valid_uid = 2000
listen = * [::]
log_path = /var/log/dovecot.log
mail_gid = 2000
mail_location = maildir:%Lh/Maildir/:INDEX=%Lh/Maildir/
mail_plugins = quota mailbox_alias acl
mail_uid = 2000
namespace {
  inbox = yes
  location =
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    auto = no
    special_use = \Sent
  }
  mailbox Spam {
    auto = no
    special_use = \Junk
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator = /
  type = private
}
namespace {
  list = children
  location = maildir:%%Lh/Maildir/:INDEX=%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
passdb {
  args = /etc/dovecot/dovecot-master-users
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  antispam_backend = pipe
  antispam_pipe_program = /usr/bin/sa-learn
  antispam_pipe_program_args = --username=%Lu
  antispam_pipe_program_notspam_arg = --ham
  antispam_pipe_program_spam_arg = --spam
  antispam_spam = Junk
  antispam_trash = Trash
  auth_socket_path = /var/run/dovecot/auth-master
  mailbox_alias_new = Sent Messages
  mailbox_alias_new2 = Sent Items
  mailbox_alias_old = Sent
  mailbox_alias_old2 = Sent
  quota = dict:user::proxy::quotadict
  quota_rule = *:storage=1G
  quota_warning = storage=85%% quota-warning 85 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  quota_warning3 = storage=95%% quota-warning 95 %u
  sieve = %Lh/sieve/dovecot.sieve
  sieve_before = /var/vmail/sieve/dovecot.sieve
  sieve_dir = %Lh/sieve
  sieve_execute_bin_dir = /usr/lib/dovecot/sieve-execute
  sieve_filter_bin_dir = /usr/lib/dovecot/sieve-filter
  sieve_global_dir = /var/vmail/sieve
  sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.filter +vnd.dovecot.execute
  sieve_pipe_bin_dir = /usr/lib/dovecot/sieve-pipe
  sieve_plugins = sieve_extprograms
}
protocols = pop3 imap sieve lmtp
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  process_limit = 500
  service_count = 1
}
service lmtp {
  executable = lmtp -L
  inet_listener lmtp {
    address = 127.0.0.1
    port = 24
  }
  process_min_avail = 5
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
  user = vmail
}
service managesieve-login {
  inet_listener sieve {
    address = 127.0.0.1
    port = 4190
  }
}
service pop3-login {
  service_count = 1
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/ssl/certs/iRedMail.crt
ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
ssl_dh_parameters_length = 2048
ssl_key = </etc/ssl/private/iRedMail.key
ssl_prefer_server_ciphers = yes
ssl_protocols = !SSLv2 !SSLv3
userdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  lda_mailbox_autocreate = yes
  lda_mailbox_autosubscribe = yes
  log_path = /var/log/dovecot-sieve.log
  mail_plugins = quota mailbox_alias acl sieve
  postmaster_address = root
}
protocol lmtp {
  info_log_path = /var/log/dovecot-lmtp.log
  lmtp_save_to_detail_mailbox = yes
  mail_plugins = quota sieve
  postmaster_address = postmaster
  recipient_delimiter = +
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_max_userip_connections = 20
  mail_plugins = quota mailbox_alias acl imap_quota imap_acl antispam
}
protocol pop3 {
  mail_max_userip_connections = 20
  mail_plugins = quota mailbox_alias acl
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}

What is weird, is even with the "dovecot -n" command there is the same error message and another one:

doveconf: Error: managesieve-login: dump-capability process returned 89

Thanks for your help smile

9

Re: [SOLVED]sieve extprogram plugin is it really included in this release?

I fixed the problem. This seems to be a bug in the package ( https://bugs.debian.org/cgi-bin/bugrepo … bug=742770 )

The solution I've found is to manually create the /usr/lib/dovecot/modules/sieve/ folder and to link the library :
ln -s /usr/lib/dovecot/modules/lib90_sieve_extprograms_plugin.so /usr/lib/dovecot/modules/sieve

Thanks for your help !