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

List:       squirrelmail-plugins
Subject:    Re: [SM-PLUGINS] server side filter plugin problem about $DEFAULT prefix
From:       Bu Xiaobing <bushurui () gmail ! com>
Date:       2013-07-01 14:02:34
Message-ID: 51D18BFA.70002 () gmail ! com
[Download RAW message or body]

On 2013-7-1 19:36, Bu Xiaobing wrote:
> 
> Another problem about procmail configurations, here is my /etc/procmailrc file:
> 
> MAILDIR=$HOME/mail
> ORGMAIL=/var/mail/$USER
> LOGFILE=$HOME/.maillog
> SHELL=/bin/sh
> LOCKFILE=$HOME/.lockmail
> VERBOSE=no
> DEFAULT=$ORGMAIL #procmail said the default DEFAULT value is the same as $ORGMAIL
> 
> 
> I add a filter rule:
> If From Contains bushurui@gmail.com then Move to Folder gmail
> Then it will be saved into /home/buxiaobing/.procmailrc as the following:
> 
> ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES  ##########
> ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ##########
> #
> ####RULE#### From-''-bushurui@gmail.com-''-gmail-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''-
>  :0H:
> * ^From: .*bushurui@gmail\.com
> $DEFAULT/gmail
> 
> 
> #
> ########## END SQUIRRELMAIL SERVER SIDE FILTER RULES    ##########
> ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ##########
> 
> So the mail sent from bushurui@gmail.com will saved to \
> $DEFAULT/gmail(/var/mail/buxiaobing/gmail), /var/mail/buxiaobing is a file, I use \
> mbox format, in fact it should be saved to $MAILDIR/gmail 
> How can I remove the $DEFAULT/ prefix and directly save as follows?
> 
> * ^From: .*bushurui@gmail\.com
> gmail
> 
> 
> I have already defined my mailbox format at server_side_filters_procmail/config.php
> // Indicates whether or not your mail store is organized using
> // mailboxes or maildirs.  If you do not know which, you should
> // make that determination before proceeding here, or filtering
> // will not work.
> //
> //        1 = use maildir syntax
> // 0 (zero) = use mailbox syntax
> //
> $use_maildirs = 0;
> 
> And if I set $use_maildirs = 1;
> 
> Then add the filter rule, the onlu difference is there will be a "/"  appended at \
> the end of the gmail and the prefix $DEFAULT/ still alive. 
> ########## BEGIN SQUIRRELMAIL SERVER SIDE FILTER RULES  ##########
> ########## DO NOT EDIT ANYTHING IN THIS SECTION BY HAND ##########
> #
> ####RULE#### From-''-bushurui@gmail.com-''-gmail-''-MOVE-''-ON-''-OFF-''--''-CONTAINS-''-
>  :0H:
> * ^From: .*bushurui@gmail\.com
> $DEFAULT/gmail/
> 
> 
> 
> 

I changed the server_side_filters_procmail/functions.php as the followings where \
MAILDIR=$HOME/mail was configured in /etc/procmailrc

     161    // determine the right path to the user's mail store
     162    //
     163    if (empty($custom_mail_location))
     164    {
     165       $mail_location = NULL;
     166       $folder_path_prefix = '$MAILDIR';
     167       //$folder_path_prefix = '$DEFAULT';
     168    }
     169    else
     170    {

And now it can works as I want, unfiltered mails will delivered to the \
DEFAULT=/var/mail/$USER location, and filtered mails will delivered to \
MAILDIR=$HOME/mail/folder_name.



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
-----
squirrelmail-plugins mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-plugins@lists.sourceforge.net
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): \
https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins


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

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