Fwd: Re: [imp] Patch to delete spam after - report as spam - Updated

Jan Schneider jan at horde.org
Wed Jul 16 09:24:38 PDT 2003



----- Weitergeleitete Nachricht von rudi at darx.com -----
    Datum: Thu, 17 Jul 2003 02:00:24 +1000
    Von: Rudi Heitbaum <rudi at darx.com>
Antwort an: Rudi Heitbaum <rudi at darx.com>
 Betreff: Re: [imp] Patch to delete spam after - report as spam - Updated
      An: Jan Schneider <jan at horde.org>

Thanks for your comments.

Modifications made as requested. The new diff is attached.

On Wed, Jul 16, 2003 at 03:49:51PM +0200, Jan Schneider wrote:
> Zitat von Rudi Heitbaum <rudi at darx.com>:
>
> > Here is an update to the patch by David Chang.
> >
> > There is a problem with the previous patch in that the previous
> > message body was maintained. Could this be checked into the CVS tree.
> > I have been using David's patch for a couple of months now.
>
> I think this should rather be a preference than a configuration.
>
> Jan.
>
> --
> http://www.horde.org - The Horde Project
> http://www.ammma.de - discover your knowledge
> http://www.tip4all.de - Deine private Tippgemeinschaft
>
> --
> IMP mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
Regards

Rudi

--
Rudi Heitbaum                Ph:  +61-3-8371 7444
Managing Director            Fax: +61-3-8371 7445
DARX Consulting Pty Ltd      Mobile: 04-1122 6244
mailto:rudi at darx.com         http://www.darx.com/


----- Ende der weitergeleiteten Nachricht -----


Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
-------------- next part --------------
Index: imp/mailbox.php
===================================================================
RCS file: /data/derwurfel/software/horde/rsync/imp/mailbox.php,v
retrieving revision 2.507
diff -c -r2.507 mailbox.php
*** imp/mailbox.php	16 Jul 2003 01:45:08 -0000	2.507
--- imp/mailbox.php	16 Jul 2003 15:56:11 -0000
***************
*** 168,173 ****
--- 168,189 ----
              $notification->push(_("1 message has been reported as spam to your system administrator."), 'horde.message');
          }
      }
+ 
+     /* Delete Spam after report */
+     if ($prefs->getValue('spam_delete_after_report') && !empty($indices)) {
+        require_once IMP_BASE . '/lib/Message.php';
+        $imp_message = &new IMP_Message();
+        $imp_message->delete($indices);
+        /* For POP3, redirect so that refreshing the page doesn't */
+        /* delete more messages accidentally. */
+        if (strstr($imp['base_protocol'], 'pop3')) {
+           header('Location: ' . Horde::url($mailbox_url, true));
+           exit;
+        }
+        $notification->push(sprintf(_("%d message(s) have been deleted."),
+                                    $msg_count), 'horde.message');
+ 
+     }
      break;
  
  case 'message_missing':
Index: imp/message.php
===================================================================
RCS file: /data/derwurfel/software/horde/rsync/imp/message.php,v
retrieving revision 2.474
diff -c -r2.474 message.php
*** imp/message.php	17 Jun 2003 07:53:45 -0000	2.474
--- imp/message.php	16 Jul 2003 15:56:11 -0000
***************
*** 146,151 ****
--- 146,166 ----
          $notification->push(_("This message has been reported as spam to your system administrator."), 'horde.message');
      }
  
+     /* Delete Spam after report */
+     if ($prefs->getValue('spam_delete_after_report')) {
+         require_once IMP_BASE . '/lib/Message.php';
+         $imp_message = &new IMP_Message();
+         $imp_message->setMailboxObject($imp_mailbox);
+         $imp_message->delete();
+         if ($prefs->getValue('mailbox_return')) {
+             _returnToMailbox($imp_mailbox->getMessageIndex());
+             require IMP_BASE . '/mailbox.php';
+             exit;
+         }
+         unset($imp_contents);
+         unset($raw_msg);
+         $notification->push(_("The message has been deleted."), 'horde.message');
+     }
      break;
  
  case 'flag_message':
Index: imp/config/prefs.php.dist
===================================================================
RCS file: /data/derwurfel/software/horde/rsync/imp/config/prefs.php.dist,v
retrieving revision 1.165
diff -c -r1.165 prefs.php.dist
*** imp/config/prefs.php.dist	16 Jul 2003 02:02:51 -0000	1.165
--- imp/config/prefs.php.dist	16 Jul 2003 15:56:11 -0000
***************
*** 63,69 ****
      'column' => _("Mail Management"),
      'label' => _("Message Viewing"),
      'desc' => _("Set preferences for filtering messages for unwanted content."),
!     'members' => array('filtering', 'strip_attachments', 'html_image_replacement', 'html_image_addrbook'));
  
  $prefGroups['delmove'] = array(
      'column' => _("Mail Management"),
--- 63,69 ----
      'column' => _("Mail Management"),
      'label' => _("Message Viewing"),
      'desc' => _("Set preferences for filtering messages for unwanted content."),
!     'members' => array('filtering', 'strip_attachments', 'spam_delete_after_report', 'html_image_replacement', 'html_image_addrbook'));
  
  $prefGroups['delmove'] = array(
      'column' => _("Mail Management"),
***************
*** 453,458 ****
--- 453,468 ----
      'type' => 'checkbox',
      'desc' => _("Show an icon to allow stripping of attachments from messages?"));
  
+ // By default, Don't delete spam messages. Leave this as an option for the user
+ // a value of 0 = no, 1 = yes
+ $_prefs['spam_delete_after_report'] = array(
+     'value' => 0,
+     'locked' => false,
+     'shared' => false,
+     'type' => 'checkbox',
+     'desc' => _("Delete SPAM messages after they have been reported as spam?")
+ );
+ 
  // Replace image tags in HTML messages with blank images?
  // a value of 0 = no, 1 = yes
  $_prefs['html_image_replacement'] = array(
***************


More information about the imp mailing list