[Dovecot] vacation plugins for squirrelmail

Tamsy dovecot-list at mohtex.net
Tue Apr 17 10:00:23 EEST 2012


Seems not to be attached to my former mail. Here it comes again, inline:

avelsieve config.php

###############################
<?php
/**
  * User-friendly interface to SIEVE server-side mail filtering.
  * Plugin for Squirrelmail 1.4+
  *
  * Licensed under the GNU GPL. For full terms see the file COPYING that 
came
  * with the Squirrelmail distribution.
  *
  * This file contains configuration parameters for SIEVE mail filters 
plugin
  * (aka avelsieve)
  *
  * @version $Id$
  * @author Alexandros Vellis <avel at users.sourceforge.net>
  * @copyright 2002-2004 Alexandros Vellis
  * @package plugins
  * @subpackage avelsieve
  */

/**
  * Debug Mode. Enable this (change to 1) if you need to send a bug report,
  * or to 2 or 3 if you are a developer!
  *
  * Valid values:
  * 0 = No debugging output
  * 1 = Normal debugging output
  * 2 = Firebug-enhanced debugging output
  * 3 = Enhanced debugging output and no Sieve capabilities checks - enables
  *     all UI features!
  */
if(!defined('AVELSIEVE_DEBUG')) {
     define('AVELSIEVE_DEBUG', 1);
}

/* 
======================================================================== */
/* =================== IMAP Server / SIEVE Setup  
========================= */
/* 
======================================================================== */

/** @var string Backend to use. Available backends are:
  * 'ManageSieve': Uses the ManageSieve protocol. e.g. Cyrus
  * 'File': Writes files straight to disk. e.g. Exim4, Dovecot LDA.
  */
global $avelsieve_backend;
$avelsieve_backend = 'ManageSieve';



/* 
======================================================================== */
/* =================== ManageSieve Backend Options 
======================== */
/* 
======================================================================== */

/* Port where ManageSieve servers (e.g. Cyrus IMAP's timsieved) listens to.
  * Default is 2000. Note that another possible port that your server might
  * listen to, is 4190, which is now the official (IANA-assigned) port for
  * Sieve. */

global $sieveport;
$sieveport = 4190;

/**
  * @var string Space separated list of preferred SASL mechanisms for the
  * authentication to ManageSieve server. e.g. "PLAIN DIGEST-MD5";*/

global $sieve_preferred_sasl_mech;
$sieve_preferred_sasl_mech = 'PLAIN';

/**
  * @var boolean Disable STARTTLS for ManageSieve. You can set this to true,
  * if you do not wish to use encryption via TLS mechanisms (i.e. the server
  * is not configured properly, or this is a local connection and TLS is not
  * needed.
  * Note that STARTTLS is supported only in PHP5+. In PHP4 this option will
  * have no effect and STARTTLS will be disabled anyway.
  */
global $avelsieve_disabletls;
$avelsieve_disabletls = false;

/* 
======================================================================== */
/* ======================= File Backend Options 
=========================== */
/* 
======================================================================== */

global $avelsieve_file_backend_options, $data_dir, $username;
$avelsieve_file_backend_options = array(
     'avelsieve_default_file' => "$data_dir/$username.sievesource"
);

/* 
======================================================================== */
/* ====== Implementation- and Server-Specific  Options 
==================== */
/* 
======================================================================== */


/* In Cyrus 2.3+, the notification action is a bit more complex than the
  * others. The oldcyrus variable is for supporting the partially 
implemented
  * notify extension implementation of Cyrus < 2.3. If you have Cyrus < 2.3,
  * just set this to true.
  *
  * This only changes the informational / help text displayed in avelsieve.
  *
  * Cyrus < 2.3 : $from$, $env-from$, $subject$
  * Cyrus 2.3+  : $from$, $env-from$, $subject$, $text$, $text[n]$
  */
global $avelsieve_oldcyrus;
$avelsieve_oldcyrus = true;

/* If you have Cyrus with an lmtpd that can understand the "auth" 
argument to
  * the :envelope test as the SMTP/LMTP auth, or any other Sieve 
implementation,
  * then you can enable this to provide this functionality to the user.
  *
  * This was not clarified in the base spec of RFC 3028. It will be done
  * correctly in a new version of Cyrus, based on a new draft / spec.
  */
global $avelsieve_enable_envelope_auth;
$avelsieve_enable_envelope_auth = true;

/* Some Implementations of Sieve need certain things in order to operate
  * correctly. If you use any of the following server implementations, 
you MUST
  * set this variable to the corresponding value for the filtering to work
  * correctly.
  * Valid values are:
  * - Any RFC3028-mostly-compatible implementation: '' (empty).
  * - Exim MTA: 'exim'
  * - MFL (as supported by mvmf): 'mfl'
  */
global $avelsieve_custom_sieve_implementation;
$avelsieve_custom_sieve_implementation = '';


/* For delivery agents that don't know how to handle some mailbox 
prefixes, you
  * can enable this option. Example for Dovecot LDA: 'INBOX.';
  */
global $avelsieve_striproot;
$avelsieve_striproot = 'INBOX.';

/* If the backend does not support capabilities reporting, such as the File
  * Backend, then you should define which capabilities are used by the 
server
  * implementation.
  *
  * The following are the capabilities supported by Exim4 as of Exim version
  * 4.60, according to README.SIEVE. You can change them if a new version of
  * Exim provides more functionality:
  *  'envelope', 'fileinto', 'copy', 'vacation', 
'comparator-i;ascii-numeric'
  *
  * The following are the capabilities that are suported by MFM, 
according to:
  * http://www.mvmf.org/mfl/language.shtml#sieve
  *  'envelope', 'fileinto', 'reject', 'relational', 'subaddress', 'regex',
  *  'editheader', 'copy', 'vacation', 'comparator-i;ascii-casemap',
  *  'comparator-i;octet'
  *
  * The following capabilities have been reported to work with Dovecot LDA:
  *  'envelope', 'fileinto', 'copy', 'vacation', 
'comparator-i;ascii-numeric',
  *  'imapflags', 'subaddress','relational','regex'
  *
  */
/* global $avelsieve_hardcoded_capabilities;
  * $avelsieve_hardcoded_capabilities = array(
  *     'envelope', 'fileinto', 'copy', 'vacation', 
'comparator-i;ascii-numeric'
  * );
  */

global $avelsieve_hardcoded_capabilities;
$avelsieve_hardcoded_capabilities = array(
     'fileinto', 'reject', 'envelope', 'encoded-character', 'vacation',
     'subaddress', 'comparator-i;ascii-numeric', 'relational', 'regex',
     'imap4flags', 'copy', 'include', 'variables', 'body', 'enotify',
     'environment', 'mailbox', 'date'
);


/** @var boolean Enable ImapProxy mode.
  * If you use imapproxy, because imapproxy cannot understand and proxy the
  * SIEVE protocol, you must connect to the SIEVE daemon (usually on the 
IMAP
  * server) itself. So you need to set $imapproxymode to true, and define a
  * mapping, from the imapproxy host (usually localhost) to your real IMAP
  * server (usually the same that is defined on Imapproxy's configuration).
  *
  * This will not work if you use a perdition-style proxy, where 
different users
  * go to different IMAP servers; it applies mostly to people running 
imapproxy
  * for speed and want a quick hack. */

global $avelsieve_imapproxymode, $avelsieve_imapproxyserv;
$avelsieve_imapproxymode = false;
$avelsieve_imapproxyserv = array(
     'localhost' => 'YOURDOMAINNAMEHERE.com'
);

/** @var boolean Ldapuserdata mode: Gets user's email addresses (including
  * mailAlternate & mailAuthorized) from LDAP Prefs Backend plugin's 
cache */

global $avelsieve_ldapuserdatamode;
$avelsieve_ldapuserdatamode = false;

/** @var array Map of cyrus administrator users, for proxy authentication */

global $avelsieve_cyrusadmins_map;
$avelsieve_cyrusadmins_map = array(
     'cyrusimap' => 'cyrussieve'
);



/* 
======================================================================== */
/* =============== Avelsieve Interface / Behavior Setup  
================== */
/* 
======================================================================== */

/* Be conservative to our updates on the SIEVE server? If true, a button
  * entitled "Save Changes" will appear, which will give the user the
  * functionality to register her changes. 'false' is recommended. */
$conservative = false;

/* Use images for the move up / down, delete rule buttons and STOP? */

$useimages = true;

/* Translate the messages returned by the "Reject" and "Vacation" 
actions? The
  * default behaviour since 0.9 is not to translate them. Change to true 
if in
  * an intranet environment or in a same-language environment. */

global $translate_return_msgs;
$translate_return_msgs = false;

/* Theme to use for the images. A directory with the same name must 
exist under
  * plugins/avelsieve/$imagetheme, that contains the files: up.png, 
down.png,
  * del.png, dup.png, edit.png, top.png, bottom.png. */

$imagetheme = 'famfamfam';
//$imagetheme = 'bluecurve_24x24';
//$imagetheme = 'bluecurve_16x16';

/* Number of items to display _initially_, when displaying the header match
  * rule */
global $startitems;
$startitems = 3;

/* Maximum number of items to allow in one header match rule. */
global $maxitems;
$maxitems = 10;

/* Headers to display in listbox widget, when adding a new header rule. */

/* global $headers;
* $headers = array(
*  'From', 'To', 'Cc', 'Bcc', 'Subject', 'Reply-To', 'Sender', 'List-Id',
*  'MailingList', 'Mailing-List', 'X-ML-Name', 'X-List', 'X-List-Name', 
'X-Mailing-List',
*  'Resent-From',  'Resent-To', 'X-Mailer', 'X-Mailing-List',
*  'X-Spam-Flag', 'X-Spam-Status',
*  'X-Priority', 'Importance', 'X-MSMail-Priority', 'Precedence',
*  'Return-Path', 'Received', 'Auto-Submitted',
*  'X-Spam-Flag', 'X-Spam-Status','X-Spam-Tests'
*  ); */

global $headers;
$headers = array(
  'From', 'To', 'Cc', 'Bcc', 'Subject', 'Sender', 'Reply-To', 'List-Id',
  'MailingList', 'Mailing-List', 'X-DKIM-Authentication-Results',
  'X-ML-Name', 'X-List', 'X-List-Name', 'X-Mailing-List',
  'Resent-From',  'Resent-To', 'X-Mailer', 'X-Mailing-List',
  'X-SpamTest-Status-Extended',
  'X-Priority', 'Importance', 'X-MSMail-Priority', 'Precedence',
  'Return-Path', 'Received', 'Auto-Submitted',
  );

/* Available :method's for the :notify extension (if applicable) */
global $notifymethods;
$notifymethods = array(
'mailto', 'sms'
);
/* use the value "false" if you want to provide a simple input box so that
  * users can edit the method themselves : */
//$notifymethods = false;


/* Capabilities to disable. If you would like to force avelsieve not to 
display
  * certain features, even though there _is_ a capability for them in Sieve
  * server, you should specify these here. For instance, if you would
  * like to disable the notify extension, even though ManageSieve 
advertises it,
  * you should add 'notify' in this array: 
$force_disable_avelsieve_capability =
  * array("notify");. This will still leave the defined feature on, and 
if the
  * user can upload her own scripts then she can use that feature; this 
option
  * just disables the GUI of it. Leave as-is (empty array) if you do not 
need
  * that.
  *
  * Look in $implemented_capabilities array in include/constants.inc.php for
  * valid values */

// $disable_avelsieve_capabilities = array("notify");
global $disable_avelsieve_capabilities;
$disable_avelsieve_capabilities = array();

/* Display Filters link in the top Squirrelmail header? */

global $avelsieveheaderlink;
$avelsieveheaderlink = true;

/* Default rules table display mode, one of 'verbose' or 'terse' */
global $avelsieve_default_mode;
$avelsieve_default_mode = 'terse';



/* 
======================================================================== */
/* ========================= Custom rules Configuration 
=================== */
/* 
======================================================================== */

/**
  * @var array
  * List of additional rules to enable. This must be the numeric id of the
  * rule.
  *
  * 10: Spam Rule (as existed in Avelsieve)
  * 11: Junk-Mail Rule (new-style SPAM Rule, only one exists per Sieve 
script)
  * 12: Global Whitelist (only one exists per Sieve script)
  * 13: Custom Sieve Code (allows users to enter whatever Sieve code 
they like -
  *     Alpha/Experimental)
  *
  * Example:
  * array(11, 12);
  */
global $avelsieve_enable_rules;
$avelsieve_enable_rules = array();

global $avelsieve_rules_settings;
$avelsieve_rules_settings = array();
foreach($avelsieve_enable_rules as $r) {
     if(file_exists(SM_PATH . 'plugins/avelsieve/config/rule.'.$r.'.php')) {
         require(SM_PATH . 'plugins/avelsieve/config/rule.'.$r.'.php');
     } else {
         require(SM_PATH . 
'plugins/avelsieve/config/rule.'.$r.'.default.php');
     }
}

/* Please keep the following setting false; it is alpha + needs Squirrelmail
  * to be patched in three or four places. */

$avelsieve_spam_highlight_enable = false;
###############################



Hi Daminto,

That looks pretty much unconfigured. No wonder nothing is coming up.

I have attached the avelsieve config file we are using on one of our 
domains. Don't copy it blindly. At least you should configure $sieveport 
to the port you are using on your server for Sieve. And put your domain 
name where it reads YOURDOMAINNAMEHERE.com.
For the arrays at $headers you should tune the filters you are using 
with your headers.

Hope this helps (working fine with our domain and Squirrel-Mail).

Rgds
Tamsy


Daminto Lie wrote the following on 17.04.2012 13:14:
> Thank you for your reply.
>
> Here it is as follows
>
>
> if(!defined('AVELSIEVE_DEBUG')) {
>      define('AVELSIEVE_DEBUG', 0);
> }
>
> global $avelsieve_backend;
> $avelsieve_backend = 'File';
>
> /*global $sieveport;
> $sieveport = 2000;*/
>
> global $sieve_preferred_sasl_mech;
> $sieve_preferred_sasl_mech = 'PLAIN';
>
> global $avelsieve_disabletls;
> $avelsieve_disabletls = false;
>
> global $avelsieve_file_backend_options, $data_dir, $username;
> $avelsieve_file_backend_options = array(
>      'avelsieve_default_file' =>  "$data_dir/$username.sievesource"
> );
>
> /*global $avelsieve_oldcyrus;
> $avelsieve_oldcyrus = true;*/
>
> global $avelsieve_enable_envelope_auth;
> $avelsieve_enable_envelope_auth = true;
>
> global $avelsieve_custom_sieve_implementation;
> $avelsieve_custom_sieve_implementation = '';
>
> global $avelsieve_striproot;
> $avelsieve_striproot = '';
>
> global $avelsieve_hardcoded_capabilities;
> $avelsieve_hardcoded_capabilities = array(
>      'envelope', 'fileinto', 'copy', 'vacation', 'comparator-i;ascii-numeric'
> );
>
> /*global $avelsieve_imapproxymode, $avelsieve_imapproxyserv;
> $avelsieve_imapproxymode = false;
> $avelsieve_imapproxyserv = array(
>      'localhost' =>  'imap.example.org'
> );*/
>
> global $avelsieve_ldapuserdatamode;
> $avelsieve_ldapuserdatamode = false;
>
> /*global $avelsieve_cyrusadmins_map;
> $avelsieve_cyrusadmins_map = array(
>      'cyrusimap' =>  'cyrussieve'
> );*/
>
> $conservative = false;
>
> $useimages = true;
>
> global $translate_return_msgs;
> $translate_return_msgs = false;
>
> $imagetheme = 'famfamfam';
> //$imagetheme = 'bluecurve_24x24';
> //$imagetheme = 'bluecurve_16x16';
>
> global $startitems;
> $startitems = 3;
>
> global $maxitems;
> $maxitems = 10;
>
> global $headers;
> $headers = array(
>   'From', 'To', 'Cc', 'Bcc', 'Subject', 'Reply-To', 'Sender', 'List-Id',
>   'MailingList', 'Mailing-List', 'X-ML-Name', 'X-List', 'X-List-Name', 'X-Mailing-List',
>   'Resent-From',  'Resent-To', 'X-Mailer', 'X-Mailing-List',
>   'X-Spam-Flag', 'X-Spam-Status',
>   'X-Priority', 'Importance', 'X-MSMail-Priority', 'Precedence',
>   'Return-Path', 'Received', 'Auto-Submitted',
>   'X-Spam-Flag', 'X-Spam-Status','X-Spam-Tests'
>   );
>
> global $notifymethods;
> $notifymethods = array(
> 'mailto', 'sms'
> );
>
> //$notifymethods = false;
>
> // $disable_avelsieve_capabilities = array("notify");
> global $disable_avelsieve_capabilities;
> $disable_avelsieve_capabilities = array();
>
> global $avelsieveheaderlink;
> $avelsieveheaderlink = true;
>
> global $avelsieve_default_mode;
> $avelsieve_default_mode = 'terse';
>
> global $avelsieve_enable_rules;
> $avelsieve_enable_rules = array();
>
> global $avelsieve_rules_settings;
> $avelsieve_rules_settings = array();
> foreach($avelsieve_enable_rules as $r) {
>      if(file_exists(SM_PATH . 'plugins/avelsieve/config/rule.'.$r.'.php')) {
>          require(SM_PATH . 'plugins/avelsieve/config/rule.'.$r.'.php');
>      } else {
>          require(SM_PATH . 'plugins/avelsieve/config/rule.'.$r.'.default.php');
>      }
> }
>
> $avelsieve_spam_highlight_enable = false;
>
>
> Hope this help you to help me.
>
> Thank you
>
>
>
>
> ________________________________
>   From: Tamsy<dovecot-list at mohtex.net>
> To: "dovecot at dovecot.org"<dovecot at dovecot.org>
> Sent: Tuesday, 17 April 2012 1:25 PM
> Subject: Re: [Dovecot] vacation plugins for squirrelmail
>
> Show us your avelsieve-config in
> your-squirrelmail-dir/plugins/avelsieve/config/config.php
>
>
> Daminto Lie wrote the following on 17.04.2012 09:31:
>> Thank you folks for your replies.
>>
>>
>> I realised that the dovecot 1.2.9 that I installed via ubuntu synaptic package manager has already come with sieve plugins. After making some modifications on the dovecot.conf file, I went to download and install avelsieve 1.0.1 (stable version) onto the squirrelmail. Then, I run in squirrelmail conf.pl and added the plugin. I logged in and could see "Filter" option right on the top header row. I went to click it and nothing came up. I checked in the mail.log but did not see any errors there.
>>
>> Here is my snapshot of dovecot configuration
>> # 1.2.9: /etc/dovecot/dovecot.conf
>> # OS: Linux 2.6.32-40-generic-pae i686 Ubuntu 10.04.4 LTS ext4
>> log_timestamp: %Y-%m-%d %H:%M:%S
>> protocols: imap
>> listen: *:143
>> ssl:
>>     no
>> disable_plaintext_auth: no
>> login_dir: /var/run/dovecot/login
>> login_executable: /usr/lib/dovecot/imap-login
>> verbose_proctitle: yes
>> first_valid_uid: 1001
>> last_valid_uid: 600
>> mail_privileged_group: mail
>> mail_location: maildir:/var/vmail/%u/Maildir
>> mbox_write_locks: fcntl dotlock
>> imap_client_workarounds: outlook-idle delay-newmail netscape-eoh tb-extra-mailbox-sep
>> lda:
>>      postmaster_address: postmaster at ourcompany.com
>>      mail_plugins: sieve
>>      quota_full_tempfail: yes
>>      deliver_log_format: msgid=%m: %$
>>      sendmail_path: /usr/lib/sendmail
>>      rejection_reason: Your message to<%t>   was automatically rejected:%n%r
>>      auth_socket_path: /var/run/dovecot-auth-master
>> auth default:
>>      mechanisms: plain login
>>      username_format: %Lu
>>      verbose: yes
>>      debug: yes
>>      debug_passwords: yes
>>      passdb:
>>        driver:
>>     pam
>>      passdb:
>>        driver: ldap
>>        args: /etc/dovecot/dovecot-ldap.conf
>>      userdb:
>>        driver: passwd
>>      userdb:
>>        driver: static
>>        args: uid=1001 gid=1001 home=/var/vmail/%u allow_all_users=yes
>>      socket:
>>        type: listen
>>        client:
>>          path: /var/spool/postfix/private/auth
>>          mode: 432
>>          user: postfix
>>          group: mail
>>        master:
>>          path: /var/run/dovecot-auth-master
>>          mode: 432
>>          user: vmail
>>          group: vmail
>> plugin:
>>      sieve: /var/vmail/%u/.sieve
>>
>> Also, I have restarted dovecot after making changes to the dovecot.conf.
>>
>> Any help would be very much appreciated.
>>
>> Thank you
>>
>>   
>>
>>
>> ________________________________
>>     From: Artur Zaprzała<artur.zaprzala at talex.pl>
>> To: Dovecot Mailing List<dovecot at dovecot.org>
>> Cc: Daminto Lie<dlie76 at yahoo.com.au>
>> Sent: Thursday, 12 April 2012 11:46 PM
>> Subject: Re: [Dovecot] vacation plugins for squirrelmail
>>
>> Daminto Lie wrote:
>>> Hi,
>>>
>>> I am afraid I
>>     have a question to ask of you all. I have just completed setting up a mail server running on Ubuntu Server 10.04. It has postfix, dovecot 1.2.19, LDAP and squirrelmail as the webmail. I have also created virtual users accounts on the system through LDAP. I can send and receive mails which is great. Now, what I am trying to do is to set up a vacation auto-reply on the squirrelmail so that users who are about to go on vacation can set it up themselves. I was looking around for the vacation plugins for dovecot that I can incorporate it into squirrelmail.
>>> Any help would be very much appreciated.
>>>
>>> Thank you
>>>
>> I'm using Avelsieve 1.9.9 with a set of my own bugfixes:
>> http://email.uoa.gr/avelsieve/
>>
>>



More information about the dovecot mailing list