Re: server side filter plugin problem about $DEFAULT prefix

Bu Xiaobing <[email protected]> Mon, 01 Jul 2013 22:02:34 +0800
Newsgroups gmane.mail.squirrelmail.plugins
Message-ID <[email protected]>
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 [email protected] 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-''[email protected]''-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 [email protected] 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-''[email protected]''-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: [email protected]
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins