Commits

Zhang Huangbin committed 2112bcc

Code cleanup: Remove pysieved related stuffs.

  • Participants
  • Parent commits 232569d

Comments (0)

Files changed (6)

iRedMail/conf/global

 
 # For managesieve service and software.
 export USE_MANAGESIEVE='YES'    # Use managesieve service.
-export USE_PYSIEVED='YES'       # Use pysieved to provide managesieve service.
 
 # vmail user. uid and gid should be export after user added. Reference:
 # functions/user_vmail.sh

iRedMail/conf/managesieve

 # along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
 #---------------------------------------------------------------------
 
-# Variables for pysieved.
-export PYSIEVED_INI='/etc/pysieved.ini'
-export PYSIEVED_BINDADDR='127.0.0.1'
-export PYSIEVED_PORT='2000'    # default is '2000'
-
-# We will run pysieved service as vmail user/group, but they can't
-# write pid file under '/var/run/', so we create a subdirectory for
-# this purpose.
-export PYSIEVED_PIDFILE='/var/run/pysieved/pysieved.pid'
-
 # Variables for managesieve service.
-export MANAGESIEVE_BINDADDR="${PYSIEVED_BINDADDR}"
+export MANAGESIEVE_BINDADDR='127.0.0.1'
 export MANAGESIEVE_PORT='2000'
 
 if [ X"${DISTRO}" == X"RHEL" -a X"${DISTRO_VERSION}" == X"6" ]; then

iRedMail/functions/dovecot1.sh

 # Per-user sieve mail filter.
 plugin {
     # For maildir format.
-    sieve = ${SIEVE_DIR}/%Ld/%Ln/${SIEVE_RULE_FILENAME}
+    #sieve = ${SIEVE_DIR}/%Ld/%Ln/${SIEVE_RULE_FILENAME}
+    sieve = /%Lh/sieve/${SIEVE_RULE_FILENAME}
 }
 EOF
     else
 namespace private {
     separator = /
     prefix =
-    #location defaults to mail_location.
     inbox = yes
+    # location defaults to mail_location.
 }
 
 namespace shared {

iRedMail/functions/managesieve.sh

 # along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
 #---------------------------------------------------------------------
 
-# Configure pysieved.
-pysieved_config()
-{
-    ECHO_INFO "Configure Pysieved (managesieve server)."
-
-    backup_file ${PYSIEVED_INI}
-
-    ECHO_DEBUG "Setting up managesieve server: pysieved."
-
-    cat > ${PYSIEVED_INI} <<EOF
-${CONF_MSG}
-[main]
-# Authentication back-end to use
-auth    = Dovecot
-
-# User DB back-end to use
-userdb  = Virtual
-
-# Storage back-end to use
-storage = Dovecot
-
-# Bind to what address?  (Ignored with --stdin)
-#bindaddr = ${PYSIEVED_BINDADDR}
-
-# Listen on what port?  (Ignored with --stdin)
-port    = ${PYSIEVED_PORT}
-
-# Write a pidfile here
-pidfile = ${PYSIEVED_PIDFILE}
-
-[Virtual]
-# Append username to this for home directories
-base = ${SIEVE_DIR}
-
-# What UID and GID should own all files?  -1 to not bother
-uid = ${VMAIL_USER_UID}
-gid = ${VMAIL_USER_GID}
-
-# Switch user@host.name to host.name/user?
-hostdirs = True
-
-[Dovecot]
-# How do we identify ourself to Dovecot? Default is 'pysieved'.
-service = sieve
-
-# Path to Dovecot's auth socket (do not set unless you're using
-# Dovecot auth)
-mux = ${DOVECOT_SOCKET_MUX}
-
-# Path to Dovecot's master socket (if using Dovecot userdb lookup)
-master = ${DOVECOT_AUTH_SOCKET_PATH}
-
-# Path to sievec
-sievec = ${DOVECOT_SIEVEC}
-
-# Where in user directory to store scripts.
-scripts = .
-
-# Filename used for the active SIEVE filter (see README.Dovecot)
-active = ${SIEVE_RULE_FILENAME}
-
-# What user/group owns the mail storage (-1 to never setuid/setgid)
-uid = ${VMAIL_USER_UID}
-gid = ${VMAIL_USER_GID}
-EOF
-
-    # Modify pysieved source, replace 'os.mkdir' by 'os.makedirs'.
-    pysieved_dovecot_py="$(eval ${LIST_FILES_IN_PKG} pysieved|grep 'dovecot.py$')"
-    [ ! -z ${pysieved_dovecot_py} ] && perl -pi -e 's#os.mkdir#os.makedirs#' ${pysieved_dovecot_py}
-
-    # Create directory to store pid file.
-    pysieved_pid_dir="$(dirname ${PYSIEVED_PIDFILE})"
-    mkdir -p ${pysieved_pid_dir} 2>/dev/null
-    chown ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME} ${pysieved_pid_dir}
-
-    # Copy init script and enable it.
-    cp -f ${SAMPLE_DIR}/pysieved.init.rhel ${DIR_RC_SCRIPTS}/pysieved
-    chmod +x ${DIR_RC_SCRIPTS}/pysieved
-    eval ${enable_service} pysieved
-    ENABLED_SERVICES="${ENABLED_SERVICES} pysieved"
-
-    # Disable pysieved in xinetd.
-    pysieved_xinetd_conf="$(eval ${LIST_FILES_IN_PKG} pysieved | grep 'xinetd' | grep 'pysieved$')"
-    if [ ! -z ${pysieved_xinetd_conf} ]; then
-        perl -pi -e 's#(.*disable.*=).*#${1} yes#' ${pysieved_xinetd_conf}
-    else
-        :
-    fi
-
-    cat >> ${TIP_FILE} <<EOF
-pysieved:
-    * Configuration files:
-        - ${PYSIEVED_INI}
-    * RC script:
-        - ${DIR_RC_SCRIPTS}/pysieved (RHEL/CentOS only)
-
-EOF
-
-    echo 'export status_pysieved_config="DONE"' >> ${STATUS_FILE}
-}
-
 managesieve_config()
 {
     if [ X"${USE_MANAGESIEVE}" == X"YES" ]; then

iRedMail/functions/packages.sh

         :
     fi
 
-    # pysieved.
-    # Warning: Do *NOT* add 'pysieved' service in 'ENABLED_SERVICES' here.
-    #          We don't have rc/init script under ${DIR_RC_SCRIPTS} till
-    #          package is installed.
-    #if [ X"${USE_MANAGESIEVE}" == X"YES" ]; then
-    #    # Note for Ubuntu & Debian:
-    #    # Dovecot shipped in Debian/Ubuntu has managesieve plugin patched.
-    #    [ X"${DISTRO}" == X"RHEL" ] && ALL_PKGS="${ALL_PKGS} pysieved.noarch"
-    #else
-    #    :
-    #fi
 
     ############
     # iRedAPD.

iRedMail/samples/pysieved.init.rhel

-#!/bin/sh
-
-# Author: Zhang Huangbin (zhb(at)iredmail.org)
-# Date: 2008.09.05
-
-#---------------------------------------------------------------------
-# This file is part of iRedMail, which is an open source mail server
-# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
-#
-# iRedMail is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# iRedMail is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
-#---------------------------------------------------------------------
-
-# chkconfig: 345 99 99
-# description: run pysieved as daemon.
-
-. /etc/rc.d/init.d/functions
-
-PROG='pysieved'
-
-PYSIEVED_BIN='/usr/sbin/pysieved'
-OPTIONS='-c /etc/pysieved.ini'
-PID='/var/run/pysieved/pysieved.pid'
-
-start()
-{
-    if [ -e ${PID} ]; then
-        status -p ${PID} ${PROG} > /dev/null
-
-        if [ X"$?" == X"0" ]; then
-            echo -n "${PROG} is already running: "
-            echo -n "$(pidof ${PROG})" && success && echo
-        else
-            rm -f ${PID} >/dev/null 2>&1
-            echo -n "Starting ${PROG}:"
-            ${PYSIEVED_BIN} ${OPTIONS} && success || failure
-            echo
-        fi
-    else
-        echo -n "Starting ${PROG}:"
-        daemon ${PYSIEVED_BIN} ${OPTIONS} && success || failure
-        echo
-    fi
-}
-
-stop()
-{
-    if [ -e ${PID} ]; then
-        status -p ${PID} ${PROG} > /dev/null
-
-        if [ X"$?" == X"0" ]; then
-            echo -n "Stopping ${PROG}:"
-            kill $(cat ${PID}) && success || failure
-            echo
-            rm -f ${PID} >/dev/null 2>&1
-        else
-            echo -n "${PROG} is already stopped." && success
-            echo
-            rm -f ${PID} >/dev/null 2>&1
-        fi
-    else
-        echo -n "${PROG} is already stopped." && success
-        echo
-    fi
-}
-
-reload()
-{
-    if [ -e ${PID} ]; then
-        echo -n "Reloading ${PROG}:"
-        kill -HUP $(cat ${PID}) && success || failure
-        echo
-    else
-        echo -n "${PROG} isn't running." && failure
-        echo
-    fi
-}
-
-usage()
-{
-    echo "Usage: $0 [start|stop|restart|status|reload]"
-}
-
-case $1 in
-    start) start ;;
-    stop) stop ;;
-    restart) stop; start ;;
-    status) status -p ${PID} ${PROG};;
-    reload) reload ;;
-    *) usage ;;
-esac