Squirrelmail with Server Side Filtering

Discussion in 'Installation/Configuration' started by [email protected], Jan 7, 2007.

  1. james@thereidsonline.com

    [email protected] New Member

    Hi,

    Has anyone manged to get the Squirrelmail Server Side Filtering plugin working?

    I've followed the instructions that come with the package, but get a blank page when I try to enter Options -> Mail Filters within Squirrelmail (suspect it is either a permission or config issue)

    Thanks!
    James.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your logs? Do you use Squirrelmail on port 80 or 81?
     
  3. james@thereidsonline.com

    [email protected] New Member

    Hi Falko,

    I think my core problem is that I have not got it configured correctly.

    Below is my config.php:

    Code:
    <?php
    
    /**
      * SquirrelMail Serverside Filter Plugin
      * Copyright (c) 2000-2005 Patrick Swieskowski, Rick Sheaffer, Jon Stroud,  
      *                         Tony Lownds, Paul Lesneiwski
      * Licensed under the GNU GPL. For full terms see the file COPYING.
      *
      * @package plugins
      * @subpackage serversidefilter
      *
      *   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_LDAP,
           $USE_MAILDIRS, $SEPERATOR, $USE_MYSQL, $USE_SPECIAL_SPAM_FILTER_RULE;
    
    
    
    // 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 full path to the filter files.  Note that this
    // must be set to the same value as $FILTER_FILE_NAME when 
    // using database lookups (see below).
    //
    //$FILTER_FILE_PATH = '/home/email/[DOMUSER]/users/[USERNAME]/.procmailrc';
    //$FILTER_FILE_PATH = '.mailfilter';
    //$FILTER_FILE_PATH = '/home/email/[DOMUSER]/users/[USERNAME]/.mailfilter';
    $FILTER_FILE_PATH = '/var/www/www.[DOMAIN]/user/[USERNAME]/.procmailrc';
    
    
    
    // This is the expected name of filter files stored in the user's
    // home directory (the path to which is stored in a database backend).
    //
    $FILTER_FILE_NAME = '.procmailrc';
    //$FILTER_FILE_NAME = '.mailfilter';
    
    
    
    // This is the full path of the filter application you use.
    // Supported filter apps are:
    //   procmail
    //   maildrop
    //
    $FILTER_APP_PATH = '/usr/bin/procmail';
    //$FILTER_APP_PATH = '/usr/local/bin/maildrop';
    
    
    
    // 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.  Some virtual domain
    // implementations may require this.
    //
    //$DEFAULT_DELIVERY = '| forward'; //use command "forward" to deliver message
    $DEFAULT_DELIVERY = '$MAILDIR';    //deliver to the Inbox
    
    
    
    // Uncomment the following line to allow filtering to unsubscribed 
    // mailboxes.  Comment line out to disable to only allow filtering 
    // to subscribed mailboxes.
    //
    $ALLOW_UNSUBSCRIBED = true;
    
    
    
    // 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/sb_filter.py';
    //$SPAMHEADER = 'X-SpamBayes-Classification';
    //$SPAMVALUE = 'spam';
    //$UNSUREVALUE = 'unsure';
    
    //$SPAMFILTER = '/usr/bin/spamc -u [USERNAME]';
    //$SPAMHEADER = 'X-Spam-Flag';
    //$SPAMVALUE = 'YES';
    
    
            
    // Limits messages sent through the spam filter to be below this
    // size (in kilobytes). Set to 0 if you do not want any limit.
    //
    $SPAMFILTERMAXKB = 256;
    
    
    
    // If you run a Spam tagging tool such as SpamAssassin from another
    // location (such as amavis, etc.), but would still like the special
    // spam filter included with this plugin, make sure $SPAMFILTER above 
    // is commented out but that $SPAMHEADER and $SPAMVALUE (and optionally
    // $UNSUREVALUE) are correctly configured and set this to 1.  If you 
    // are using the $SPAMFILTER setting above, you should leave this 
    // turned off.
    //
    $USE_SPECIAL_SPAM_FILTER_RULE = 0;
    
    
    
    // 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/user/[USERNAME]/';  // This example is compatible with 
                                                 // vmailmgr virtual domains 
    //$LOCAL_MAILDIR = '$DEFAULT/';              // In many cases, Maildrop's $DEFAULT
                                                 // environment variable already points
                                                 // to the Maildir
    
    
    
    // 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
    // (but *NOT* if you will be using database lookups (see below))
    //
    $VIRTUAL_DOMAINS = 0;
    
    
    
    // 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
    // Note that the path name should be identical to the file name
    // when using database lookups (see below)
    //
    $FORWARD_FILE_TYPE = "qmail";
    //$FORWARD_FILE_TYPE = "forward";
    $FORWARD_FILE_PATH = "/home/email/[DOMUSER]/.qmail-[USERNAME]";
    $FORWARD_FILE_NAME = ".qmail-[USERNAME]";
    
    
    
    // Set this to 1 if your user information (UID, GID, home directory)
    // is stored in a MySQL database.  You also need to configure two
    // other files to use MySQL user lookups:
    //
    //   serversidefilter/script/serversidefilter_mysql.conf
    //   serversidefilter/script/Makefile
    //
    // If you use this setting, please make sure that $VIRTUAL_DOMAINS
    // is set to zero!
    //
    $USE_MYSQL = 0;
    
    
    
    // Set this to 1 if your user information (UID, GID, home directory)
    // is stored in a LDAP database.  You also need to configure two
    // other files to use LDAP user lookups:
    //
    //   serversidefilter/script/serversidefilter_ldap.conf
    //   serversidefilter/script/Makefile
    //
    // If you use this setting, please make sure that $VIRTUAL_DOMAINS
    // is set to zero!
    //
    $USE_LDAP = 0;
    
    
    
    ///////////////////////////////////////////////////////////////////////////
    //
    // VACATION FILE SETTINGS
    //
    
    
    // These are used to manage vacation type RC Files
    //
    // Note that no path should be given here (just the 
    // file name) when using database lookups (see above)
    //
    $VAC_MSG_FILE_PATH = "vacation.txt";
    $VAC_SUBJ_FILE_PATH = "vacation_subject.txt";
    $VAC_CC_FILE_PATH = "vacation_cc_addresses.txt";
    $VAC_KEEP_FILE_PATH = "vacation_keep_messages.txt";
    
    
    
    ?>
    
    I suspicious in particularly of whether I've got the $FILTER_FILE_PATH set correctly, but can't see how to actually test it without just making small changes and retesting over and over again!

    I suspect that I have currently got quite a few options wrong in this file, but don't know enough to know how it should really be set.

    Thanks for your help!

    James.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Do you use Squirrelmail on port 80 or 81?
     
  5. james@thereidsonline.com

    [email protected] New Member

    I am using it on port 80 - set up a separate site just for squirrelmail.
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Then check your main Apache's error log for errors. Should be in /var/log/apache2 or /var/log/httpd or something like this.
     

Share This Page