[Pkg-mailman-hackers] Pkg-mailman commit - rev 72 - in branches/pkg-split/core/debian: . contrib patches

Bernd S. Brentrup bsb@haydn.debian.org
Mon, 19 Apr 2004 13:02:59 -0600


Author: bsb
Date: 2004-04-19 13:02:47 -0600 (Mon, 19 Apr 2004)
New Revision: 72

Removed:
   branches/pkg-split/core/debian/contrib/SpamAssassin.py
   branches/pkg-split/core/debian/contrib/savannah
   branches/pkg-split/core/debian/contrib/spamd.py
Modified:
   branches/pkg-split/core/debian/control
   branches/pkg-split/core/debian/patches/00list
   branches/pkg-split/core/debian/rules
Log:
Remove savannah and spamassassin from debian/contrib,
they will have their own source packages.


Deleted: branches/pkg-split/core/debian/contrib/SpamAssassin.py
===================================================================
--- branches/pkg-split/core/debian/contrib/SpamAssassin.py	2004-04-19 18:07:10 UTC (rev 71)
+++ branches/pkg-split/core/debian/contrib/SpamAssassin.py	2004-04-19 19:02:47 UTC (rev 72)
@@ -1,94 +0,0 @@
-# Copyright (C) 2002-2003 by James Henstridge <james@daa.com.au>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
-
-"""Perform spam detection with SpamAssassin.
-
-Messages are passed to a spamd (SpamAssassin) daemon for spam checking.
-Depending on the score returned, messages may be rejected or held for
-moderation.
-"""
-
-import string
-import spamd
-
-from Mailman import mm_cfg
-from Mailman import Errors
-from Mailman.Logging.Syslog import syslog
-from Mailman.Handlers import Hold
-from Mailman.Handlers.Moderate import matches_p
-
-SPAMD_HOST    = getattr(mm_cfg, 'SPAMASSASSIN_HOST', '')
-DISCARD_SCORE = getattr(mm_cfg, 'SPAMASSASSIN_DISCARD_SCORE', 10)
-HOLD_SCORE    = getattr(mm_cfg, 'SPAMASSASSIN_HOLD_SCORE', 5)
-MEMBER_BONUS  = getattr(mm_cfg, 'SPAMASSASSIN_MEMBER_BONUS', 2)
-
-class SpamAssassinDiscard(Errors.DiscardMessage):
-    '''The message was scored above the discard threshold'''
-    reason = 'SpamAssassin identified this message as spam'
-    rejection = 'Your message has been discarded as spam'
-
-class SpamAssassinHold(Errors.HoldMessage):
-    '''The message was scored above the hold threshold'''
-    def __init__(self, score=-1, symbols=''):
-        Errors.HoldMessage.__init__(self)
-        self.reason = 'SpamAssassin identified this message as possible ' \
-                      'spam (score %g)' % score
-        self.rejection = 'Your message was held for moderation because ' \
-                         'SpamAssassin gave the message a score of %g ' \
-                         'for the following reasons:\n\n%s' % \
-                         (score, symbols)
-
-def check_message(mlist, message):
-    '''Check a message against a SpamAssassin spamd process.
-    Returns a tuple of the form (score, symbols)'''
-    try:
-        connection = spamd.SpamdConnection(SPAMD_HOST)
-        # identify as the mailing list, to allow storing per-list
-        # AWL and bayes databases.
-        connection.addheader('User', mlist.internal_name())
-        res = connection.check(spamd.SYMBOLS, message)
-
-        score = connection.getspamstatus()[1]
-        symbols = connection.response_message.replace(',', ', ')
-
-        return score, symbols
-    except spamd.error, ex:
-        syslog('error', 'spamd: %s' % str(ex))
-        return -1, ''
-
-def process(mlist, msg, msgdata):
-    if msgdata.get('approved'):
-        return
-    
-    score, symbols = check_message(mlist, str(msg))
-
-    if MEMBER_BONUS != 0:
-        for sender in msg.get_senders():
-            if mlist.isMember(sender) or \
-                   matches_p(sender, mlist.accept_these_nonmembers):
-                score -= MEMBER_BONUS
-                break
-
-    if score > DISCARD_SCORE:
-        listname = mlist.real_name
-        sender = msg.get_sender()
-        syslog('vette', '%s post from %s discarded: '
-                        'SpamAssassin score was %g (discard threshold is %g)'
-                          % (listname, sender, score, DISCARD_SCORE))
-        raise SpamAssassinDiscard
-    elif score > HOLD_SCORE:
-        Hold.hold_for_approval(mlist, msg, msgdata,
-                               SpamAssassinHold(score, symbols))

Deleted: branches/pkg-split/core/debian/contrib/savannah
===================================================================
--- branches/pkg-split/core/debian/contrib/savannah	2004-04-19 18:07:10 UTC (rev 71)
+++ branches/pkg-split/core/debian/contrib/savannah	2004-04-19 19:02:47 UTC (rev 72)
@@ -1,69 +0,0 @@
-#
-# Copyright (C) 2001 Guillaume Morin
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-"""Verify that the admin password of a mailing list in a parsable way
-"""
-
-# No lock needed in this script, because we don't change data.
-
-import os
-import string
-import cgi
-
-from Mailman import mm_cfg
-from Mailman import Utils
-from Mailman import MailList
-from Mailman import Errors
-from Mailman.htmlformat import *
-from Mailman.Logging.Syslog import syslog
-
-def main():
-	form = cgi.FieldStorage()
-
-	if form.has_key('password') and form.has_key('list'):
-		
-		password = form['password']
-		if type(password) == type([]): password = password[0]
-		password = password.value
-
-		list = form['list']
-		if type(list) == type([]): list = list[0]
-		list = list.value
-
-		try:
-			mlist = MailList.MailList(list, lock=0)
-			result = mlist.ConfirmAdminPassword(password)
-			result = "%d" % result
-			result = result+' '+mlist.GetAdminEmail()+' '+str(mlist.advertised)+' '+mlist.description
-			result = string.replace(result,"\n"," ")
-		except Errors.MMListError:
-			result = 0
-		except Errors.MMBadPasswordError:
-			result = 2
-	
-	else:
-		result = 0
-	
-	print "Content-type: text/html\n"
-	print "<HTML>"
-	print "<BODY>"
-	print result
-	print "</BODY>"
-	print "</HTML>"
-
-if __name__ == "__main__":
-	main()

Deleted: branches/pkg-split/core/debian/contrib/spamd.py
===================================================================
--- branches/pkg-split/core/debian/contrib/spamd.py	2004-04-19 18:07:10 UTC (rev 71)
+++ branches/pkg-split/core/debian/contrib/spamd.py	2004-04-19 19:02:47 UTC (rev 72)
@@ -1,159 +0,0 @@
-# Copyright (C) 2002-2003 by James Henstridge <james@daa.com.au>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software 
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
-
-'''Module used to communicate with a SpamAssassin spamd process to check
-or tag messages.
-
-Usage is as follows:
-  >>> conn = spamd.SpamdConnection()
-  >>> conn.addheader('User', 'username')
-  >>> conn.check(spamd.SYMBOLS, 'From: user@example.com\n...')
-  >>> print conn.getspamstatus()
-  (True, 4.0)
-  >>> print conn.response_message
-  ...
-'''
-
-import socket
-import mimetools, StringIO
-
-import __builtin__
-if not hasattr(__builtin__, 'True'):
-    __builtin__.True = (1 == 1)
-    __builtin__.False = (1 != 1)
-del __builtin__
-
-class error(Exception): pass
-
-SPAMD_PORT = 783
-
-# available methods
-SKIP          = 'SKIP'
-PROCESS       = 'PROCESS'
-CHECK         = 'CHECK'
-SYMBOLS       = 'SYMBOLS'
-REPORT        = 'REPORT'
-REPORT_IFSPAM = 'REPORT_IFSPAM'
-
-# error codes
-EX_OK          = 0
-EX_USAGE       = 64
-EX_DATAERR     = 65
-EX_NOINPUT     = 66
-EX_NOUSER      = 67
-EX_NOHOST      = 68
-EX_UNAVAILABLE = 69
-EX_SOFTWARE    = 70
-EX_OSERR       = 71
-EX_OSFILE      = 72
-EX_CANTCREAT   = 73
-EX_IOERR       = 74
-EX_TEMPFAIL    = 75
-EX_PROTOCOL    = 76
-EX_NOPERM      = 77
-EX_CONFIG      = 78
-
-class SpamdConnection:
-    '''Class to handle talking to SpamAssassin spamd servers.'''
-    # default spamd 
-    host = 'localhost'
-    port = SPAMD_PORT
-
-    PROTOCOL_VERSION = 'SPAMC/1.3'
-
-    def __init__(self, host='', port=0):
-        if not port and ':' in host:
-            host, port = host.split(':', 1)
-            port = int(port)
-        if host: self.host = host
-        if port: self.port = port
-
-        # message structure to hold request headers
-        self.request_headers = mimetools.Message(StringIO.StringIO(), seekable=False)
-        self.request_headers.fp = None
-
-        # stuff that will be filled in after check()
-        self.server_version = None
-        self.result_code = None
-        self.response_message = None
-        self.response_headers = mimetools.Message(StringIO.StringIO(), seekable=False)
-
-    def addheader(self, header, value):
-        '''Adds a header to the request.'''
-        self.request_headers[header] = value
-
-    def check(self, method='PROCESS', message=''):
-        '''Sends a request to the spamd process.'''
-        try:
-            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-            sock.connect((self.host, self.port))
-        except socket.error:
-            raise error('could not connect to spamd on %s' % self.host)
-
-        # set content length request header
-        del self.request_headers['Content-length']
-        self.request_headers['Content-length'] = str(len(message))
-
-        request = '%s %s\r\n%s\r\n' % \
-                  (method, self.PROTOCOL_VERSION,
-                   str(self.request_headers).replace('\n', '\r\n'))
-
-        try:
-            sock.send(request)
-            sock.send(message)
-            sock.shutdown(1) # shut down the send half of the socket
-        except (socket.error, IOError):
-            raise error('could not send request to spamd')
-
-        fp = sock.makefile('rb')
-        response = fp.readline()
-        words = response.split(None, 2)
-        if len(words) != 3:
-            raise error('not enough words in response header')
-        if words[0][:6] != 'SPAMD/':
-            raise error('bad protocol name in response string')
-        self.server_version = float(words[0][6:])
-        if self.server_version < 1.0 or self.server_version >= 2.0:
-            raise error('incompatible server version')
-        self.result_code = int(words[1])
-        if self.result_code != 0:
-            raise error('spamd server returned error %s' % words[2])
-
-        try:
-            # parse header
-            self.response_headers = mimetools.Message(fp, seekable=False)
-            self.response_headers.fp = None
-        except IOError:
-            raise error('could not read in response headers')
-
-        try:
-            # read in response message
-            self.response_message = fp.read()
-        except IOError:
-            raise error('could not read in response message')
-            
-        fp.close()
-        sock.close()
-
-    def getspamstatus(self):
-        '''Decode the "Spam" response header.'''
-        if not self.response_headers.has_key('Spam'):
-            raise error('Spam header not found in response')
-
-        isspam, score = self.response_headers['Spam'].split(';', 1)
-        isspam = (isspam.strip() != 'False')
-        score = float(score.split('/',1)[0])
-        return isspam, score

Modified: branches/pkg-split/core/debian/control
===================================================================
--- branches/pkg-split/core/debian/control	2004-04-19 18:07:10 UTC (rev 71)
+++ branches/pkg-split/core/debian/control	2004-04-19 19:02:47 UTC (rev 72)
@@ -48,27 +48,3 @@
 Description: Powerful, web-bases mailing list manager (Documentation)
  Documentation and examples for mailman.
 
-Package: mailman-spamassassin
-Architecture: all
-Depends: mailman (= ${Source-Version}), spamassassin
-Description: Mixin integrating spamassassin into mailman.
- Dunno yet, have to look into it.
-
-Package: mailman-spamprobe
-Architecture: all
-Depends: mailman (= ${Source-Version}), spamprobe (>= 0.9h-2)
-Description: Mixin integrating spamprobe into mailman.
- Dunno yet, have to look into it.
-
-Package: mailman-savannah
-Architecture: all
-Depends: mailman (= ${Source-Version})
-Description: Savannah patches for mailman
- Dunno yet, have to look into it.
-
-Package: mailman-clamav
-Architecture: all
-Depends: mailman (= ${Source-Version})
-Description: Mixin integrating Clam Antivirus into Mailman.
- Dunno yet, have to look into it.
-

Modified: branches/pkg-split/core/debian/patches/00list
===================================================================
--- branches/pkg-split/core/debian/patches/00list	2004-04-19 18:07:10 UTC (rev 71)
+++ branches/pkg-split/core/debian/patches/00list	2004-04-19 19:02:47 UTC (rev 72)
@@ -3,7 +3,6 @@
 07_snooze
 10_wrapper_uid
 11_handle_propfind
-12_savannah_wrapper
 15_mailmanctl_daemonize
 16_update_debian
 20_qmail_to_mailman.debian

Modified: branches/pkg-split/core/debian/rules
===================================================================
--- branches/pkg-split/core/debian/rules	2004-04-19 18:07:10 UTC (rev 71)
+++ branches/pkg-split/core/debian/rules	2004-04-19 19:02:47 UTC (rev 72)
@@ -1,6 +1,9 @@
 #!/usr/bin/make -f
 # -*- makefile -*- made with the aid of debmake, by Christoph Lameter,
 # based on the sample debian/rules file for GNU hello by Ian Jackson.
+#
+# $URL$
+# $Id$
 
 package=mailman
 PACKAGE=$(package)


Property changes on: branches/pkg-split/core/debian/rules
___________________________________________________________________
Name: svn:keywords
   + Id URL