[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-plugins
Subject:    [SM-PLUGINS] serversidefilter with maildrop doesn't create .mailfilter files
From:       Seather <seather () scygro ! za ! net>
Date:       2004-06-27 6:08:38
Message-ID: 40DE6466.5070409 () scygro ! za ! net
[Download RAW message or body]

I am trying to get Server Side Filter (1.42) working on squirrelmail 
1.4.3a on a Gentoo Linux install (squirrelmail installed through ports) 
so that my users can filter their mail to folders themselves (Virtual 
mail setup, with mysql and postfix). Maildrop (1.5.3) is already 
installed and working. If I go to the "mail filters" options in 
squirrelmail after enabling and configuring the plugin, I can add a new 
filter, but it doesn't stay there. There is also no file created in 
/home/vmail/domainname/username/.mailfilter. I have tried recompiling 
filtercmd as well, but it hasn't got me any further. And unfortunately 
I'm not sure how to debug this problem either. My virtual domains are 
all located in /home/vmail with their users underneath them, eg, 
/home/vmail/domain.name/username/.maildir Everything underneath 
/home/vmail is chowned vmail:vmail. Anyone have any idea what I might 
try, or what I am doing wrong? Please. Below find my configuration files:


# Make test went fine:
roxy script # make test
sh test.sh
IMAP username: username@domain.heh
IMAP password: accountpassword
Pass: Filter get
Pass: Filter put
Pass: You are able to correctly retrieve and save your filter file.
      Your filter file is saved in the current directory as 'filter'
If you do not need to perform additional tests, remove the file test_creds
Remove now? (Y/n): y
roxy script #


# 
/var/www/localhost/htdocs/squirrelmail/plugins/serversidefilter/virtualdomains
scygro.ath.cx:vmail


# /var/www/localhost/htdocs/squirrelmail/plugins/serversidefilter/config.php
<?php

/*
 *      ServersideFilter - Serverside filter plugin for SquirrelMail
 *      By Jon Stroud and Tony Lownds
 *
 *      This config file controls how your filter files will be generated
 *      All variables that ask for a path can use the following constructs:
 *         [USERNAME]  = will get replaced with the actual username of 
the person logged in
 *         [DOMAIN]    = will get replaced with the email domain name
 *         [DOMUSER]   = in a virtual domain setting, this gets replaced 
with the system user
 *                          that owns the virtual domain.
 */


        global $ALWAYS_CREATE, $FILTER_APP_PATH, $DEFAULT_DELIVERY,
               $ALLOW_UNSUBSCRIBED, $SPAMFILTER, $SPAMHEADER, 
$SPAMFILTERMAXKB,
               $SPAMVALUE, $UNSUREVALUE, $VIRTUAL_DOMAINS, $LOCAL_MAILDIR,
               $USE_MAILDIRS, $SEPERATOR;

        /**
         * ALWAYS_CREATE
         *    Setting this value to true will create a filter file when
         *    the user logs in if they do not already have one.  This is
         *    useful if you want to have spamassassin run from a filterfile
         *    but the user has not setup mail filters.
         */
        $ALWAYS_CREATE = false;
                

        /*
         * This is the directory where the filter files will be stored
         */
        $FILTER_FILE_PATH = '/home/vmail/[DOMAIN]/[USERNAME]/.mailfilter';
        //$FILTER_FILE_PATH = 
'/home/email/[DOMUSER]/users/[USERNAME]/.procmailrc';

        /*
         * FILTER_APP_PATH
         *    This is the full path of the filter application you use.
         *    Currently supported Filter apps are:
         *   'procmail'
         *   'maildrop'
         */
        $FILTER_APP_PATH = '/usr/bin/maildrop';
        //$FILTER_APP_PATH = '/usr/bin/procmail';

        /**
         * DEFAULT_DELIVERY
         *   if you would like to include a default delivery method in your
         *   filter files, include that here.  If you do not want a default
         *   delivery method, comment this line out.
         *   Note: if you are using virtual domains, you will almost 
certainly
         *   need to set this.
         */
         $DEFAULT_DELIVERY = '$MAILDIR';    //deliver to the Inbox
         //$DEFAULT_DELIVERY = '| forward'; //use command "forward" to 
deliver message


        /**
         * ALLOW_UNSUBSCRIBED
         *  Uncomment the following line to allow filtering to 
unsubscribed mailboxes
         *  Comment line out to disable and only allow filtering to 
subscribed mailboxes.
         */
         $ALLOW_UNSUBSCRIBED = true;

        /**
         * SPAMFILTER
         *   If you use a spam filter like spamassassin and would like 
to enable it and filter
         *   based on a spam header, set this to the location of the 
spam filter, otherwise comment out.
         */
         #$SPAMFILTER = '/usr/bin/spamc -u [USERNAME] -f';
         #$SPAMHEADER = 'X-Spam-Flag';
         #$SPAMVALUE = 'Yes';
         //$SPAMFILTER= '/usr/bin/sb_filter.py';
         //$SPAMHEADER = 'X-SpamBayes-Classification';
         //$SPAMVALUE = 'spam';
         //$UNSUREVALUE = 'unsure';

        
        /**
         * SPAMFILTERMAXKB
         *   Limits messages sent through the spam filter to be below this
         *   size. Set to 0 if you do not want any limit.
         */
         $SPAMFILTERMAXKB = 150;
        
        
        /*
         * LOCAL_MAILDIR
         *    Set the path to the Maildir here.  This is used in the filter
         *    file itself.
         */
        //$LOCAL_MAILDIR = '$HOME/Maildir/';         // This would be a 
good example for a
                                                     // standard email setup
        $LOCAL_MAILDIR = '/home/vmail/[DOMAIN]/[USERNAME]/.maildir/';  
// This example is compatible with
                                                     // vmailmgr virtual 
domains

        /**
         * USE_MAILDIRS
         *   Set this to 1 if your mailbox uses maildirs, set to 0 for 
mbox style mailboxs
         */
        $USE_MAILDIRS = 1;

  /**** Virtual Domain Settings ****/

        // Set this to 1 if you host virtual domains and have virtual users
        $VIRTUAL_DOMAINS = 1;

        // Character that seperates username from domain name
        $SEPERATOR = '@';

        // Plugin will create appropriate .qmail or .forward file for 
your filter
        // application if these variables are defined.
        // Comment these lines out if you do not wish to have forward 
files created
        #$FORWARD_FILE_TYPE = "qmail";
        //$FORWARD_FILE_TYPE = "forward";
        #$FORWARD_FILE_PATH = "/home/email/[DOMUSER]/.qmail-[USERNAME]";

?>


# 
/var/www/localhost/htdocs/squirrelmail/plugins/serversidefilter/script/Makefile
# Makefile for filtercmd, part of serversidefilter
# See README for background information
#

### GENERAL OPTIONS ###

# change this to match the group your HTTPD server runs as.
# The resulting binary will be owned by this group.
HTTPD_GROUP=apache

# If you are having problems connecting, recompile with this
# flag changed and send the output to the mailing list.
CFLAGS=
#CFLAGS=-DDEBUG

# Use the following argument to tell the linker to make
# a statically linked binary
#LFLAGS=
LFLAGS=-static

# Edit the location of the squirrelmail config file here.
SQUIRRELMAILCONFIGFILE=/var/www/localhost/htdocs/squirrelmail/config/config.php
FILTERCMD_CFLAGS=-DSQUIRRELMAILCONFIGFILE='"$(SQUIRRELMAILCONFIGFILE)"'

# The default location for the serversidefilter directory should work.
# Uncomment the line below, and change the test.sh file, if you want to
# change it.
SERVERSIDEFILTERHOME=../plugins/serversidefilter
#FILTERCMD_CFLAGS=$(FILTERCMD_CFLAGS) 
-DSERVERSIDEFILTERHOME='"$(SERVERSIDEFILTERHOME)"'

### C-CLIENT OPTIONS ###

# filtercmd validates usernames and passwords with the c-client library from
# UW. This library is part of pine and UW IMAP and is installed separately
# on many Linux systems.  See http://www.washington.edu/imap/ for more
# information.

# This line selects c-client credentials checking. This is currently the
# only option.
CHECKCREDS=checkcreds_cclient.o

# You may need to adjust the following line.
LIBS=/usr/lib/c-client.a -lssl -lpam -L/usr/kerberos/lib/ -lcrypt 
-lresolv -lcom_err -ldl -lz -lcrypto

# This directory should contain a file named mail.h
I=/usr/include/imap

# These settings should work fine.
CCLIENT_CFLAGS=-I$I '-DMAIL_H="mail.h"' '-DLINKAGE_C="linkage.c"' 
-DIMAP_TIMEOUT=2

# filtercmd uses c-client's mailbox naming conventions to control how the
# connection to the IMAP server will happen. The standard mailbox name will
# look like: {localhost/imap4/user=.../norsh}
# See http://www.washington.edu/imap/documentation/naming.txt.html for 
more details.
# You can add more flags, and/or remove the /norsh flag, by uncommenting 
the
# line below.

# The default settings (uncomment and edit)
#CCLIENT_CFLAGS=$(CCLIENT_CFLAGS) -DMAILBOXFLAGS=/norsh

# The /notls flag will work around SSL problems.
#CCLIENT_CFLAGS=$(CCLIENT_CFLAGS) -DMAILBOXFLAGS=/norsh/notls

### END OF C-CLIENT OPTIONS ###

### END OF CONFIGURABLE OPTIONS ###

all: filtercmd

filtercmd: filtercmd.o Makefile $(CHECKCREDS)
        gcc -o filtercmd filtercmd.o $(CHECKCREDS) $(LIBS) $(LFLAGS)
        chmod 4750 filtercmd
        chown root:$(HTTPD_GROUP) filtercmd

filtercmd.o: filtercmd.c Makefile
        gcc -c filtercmd.c $(CFLAGS) $(FILTERCMD_CFLAGS)

checkcreds_cclient.o: checkcreds_cclient.c Makefile
        gcc -c checkcreds_cclient.c $(CFLAGS) $(CCLIENT_CFLAGS)

test: test.sh filtercmd
        sh test.sh

clean:
        -rm *.o *~ test_creds filter


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
--
squirrelmail-plugins mailing list
List Address: squirrelmail-plugins@lists.sourceforge.net
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins
http://squirrelmail.org/cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic