|
From: Paul L. <pdo...@us...> - 2011-05-07 06:49:19
|
Update of /cvsroot/serverfilters/server_side_filters_maildrop
In directory vz-cvs-3.sog:/tmp/cvs-serv28410
Modified Files:
functions.php
Log Message:
Add custom action capability
Index: functions.php
===================================================================
RCS file: /cvsroot/serverfilters/server_side_filters_maildrop/functions.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** functions.php 11 Jan 2011 02:00:50 -0000 1.2
--- functions.php 7 May 2011 06:49:16 -0000 1.3
***************
*** 83,87 ****
* folder for moving or copying
* filtered message
! * ACTION -- "MOVE", "COPY", or "DELETE",
* indicating how to handle a
* filtered message
--- 83,90 ----
* folder for moving or copying
* filtered message
! * ACTION -- "MOVE", "COPY", "DELETE" or any
! * custom action that is defined in
! * $custom_actions in the Server
! * Side Filters main configuration,
* indicating how to handle a
* filtered message
***************
*** 190,194 ****
* folder for moving or copying
* filtered message
! * ACTION -- "MOVE", "COPY", or "DELETE",
* indicating how to handle a
* filtered message
--- 193,200 ----
* folder for moving or copying
* filtered message
! * ACTION -- "MOVE", "COPY", "DELETE" or any
! * custom action that is defined in
! * $custom_actions in the Server
! * Side Filters main configuration,
* indicating how to handle a
* filtered message
***************
*** 287,295 ****
$use_maildirs, $custom_mail_location,
$use_maildrop_1x, $default_maildrop_action,
! $spam_filter_command,
$spam_filter_maximum_message_size_in_kilobytes;
server_side_filters_maildrop_init();
--- 293,305 ----
$use_maildirs, $custom_mail_location,
$use_maildrop_1x, $default_maildrop_action,
! $spam_filter_command, $custom_actions,
$spam_filter_maximum_message_size_in_kilobytes;
+ // retrieve configuration settings for this plugin
+ // AND for parent plugin (custom actions)
+ //
server_side_filters_maildrop_init();
+ server_side_filters_init();
***************
*** 434,438 ****
// build this filter's action
//
! if ($rule['ACTION'] == 'DELETE')
{
$action = 'to /dev/null';
--- 444,474 ----
// build this filter's action
//
! if (!empty($custom_actions[$rule['ACTION']])
! && is_array($custom_actions[$rule['ACTION']]))
! {
! $action = $custom_actions[$rule['ACTION']]['FILTER_ACTION'];
! if (!empty($custom_actions[$rule['ACTION']]['SECONDARY_TRANSPORT'])
! && $custom_actions[$rule['ACTION']]['SECONDARY_TRANSPORT'] == 'FORBIDDEN')
! {
! $parsed_filter_rules[$index]['COPY_TO_FOLDER'] = 'OFF';
! $parsed_filter_rules[$index]['SEND_TO_ADDRESS'] = 'OFF';
! }
! else
! {
! if (!empty($custom_actions[$rule['ACTION']]['SECONDARY_TRANSPORT_COPY']))
! $deliver_action = 'cc';
! else
! $deliver_action = 'to';
!
! if ($rule['COPY_TO_FOLDER'] == 'ON' && $rule['SEND_TO_ADDRESS'] == 'ON')
! $action .= "\n" . ' cc "' . $rule['TARGET_FOLDER']
! . "\"\n $deliver_action \"!" . $rule['EMAIL_ADDRESS'] . '"';
! else if ($rule['COPY_TO_FOLDER'] == 'ON')
! $action .= "\n $deliver_action \"" . $rule['TARGET_FOLDER'] . '"';
! else if ($rule['SEND_TO_ADDRESS'] == 'ON')
! $action .= "\n $deliver_action \"!" . $rule['EMAIL_ADDRESS'] . '"';
! }
! }
! else if ($rule['ACTION'] == 'DELETE')
{
$action = 'to /dev/null';
|