debian/0000755000000000000000000000000012235032512007161 5ustar debian/upstream0000644000000000000000000000001211760605604010747 0ustar ChangeLog debian/source/0000755000000000000000000000000011760605604010473 5ustar debian/source/format0000644000000000000000000000001411760605604011701 0ustar 3.0 (quilt) debian/copyright0000644000000000000000000000247411760605604011135 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0 Upstream-Name: bmf Upstream-Contact: Tom Marshall Source: http://freshmeat.net/projects/bmf X-Upstream-Vcs: http://sourceforge.net/projects/bmf/develop X-Upstream-Bugs: http://sourceforge.net/tracker/?group_id=63555&atid=504404 X-Source: http://sourceforge.net/projects/bmf Files: * Copyright: 2002 Tom Marshall , License: GPL-2+ Files: debian/* Copyright: 2009-2012 Jari Aalto License: GPL-2+ License: GPL-2+ This package 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 package 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, see . . On Debian systems, the complete text of the GNU General Public License can be found in "/usr/share/common-licenses/GPL-2". debian/changelog0000644000000000000000000000656512235032512011047 0ustar bmf (0.9.4-9build1) trusty; urgency=low * No change rebuild against db 5.3. -- Dmitrijs Ledkovs Fri, 01 Nov 2013 23:12:10 +0000 bmf (0.9.4-9) unstable; urgency=low * debian/patches - (30): Revise. Instead of PATH_MAX allocate the exact amount of memory that is needed (FTBFS hurd; Closes: #674825). Patch thanks to Cyril Roelandt . -- Jari Aalto Mon, 28 May 2012 08:21:40 +0300 bmf (0.9.4-8) unstable; urgency=low * debian/control - (Build-Depends): Rm libdb5.1; would block upgrades (Closes: #669001). Patch thanks to Ondřej Surý . * debian/copyright - Update to format 1.0. -- Jari Aalto Mon, 16 Apr 2012 16:55:29 +0300 bmf (0.9.4-7) unstable; urgency=low * debian/control - (Build-Depends): Rm dpkg-dev; not needed with debhelper 9. - (standards-Version): Update to 3.9.3.1. * debian/rules - Enable all hardening flags. - Use DEB_*_MAINT_* variables (Closes: #665192). Patch thanks to Simon Ruderich . -- Jari Aalto Thu, 22 Mar 2012 13:52:09 -0400 bmf (0.9.4-6) unstable; urgency=low * debian/compat - Update to 9 * debian/control - (Build-Depends): Update to debhelper 9, dpkg-dev 1.16.1. - (Standards-Version): Update to 3.9.2. - Tweak description to address lintian warning. * debian/copyright - (X-*): Add headers Vcs and Bugs. * debian/patches - (40): New. Fix for folded headers. * debian/rules - Remove unnecessary rules. - Use hardened CFLAGS (release goal). http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags -- Jari Aalto Mon, 13 Feb 2012 02:48:03 -0500 bmf (0.9.4-5) unstable; urgency=low * debian/compat - Update to 8. * debian/control - (Build-Depends): debhelper 8. Use libdb5.1 (Closes: #621455). - (Standards-Version): Update to 3.9.1. * debian/copyright - Update to DEP5 format. -- Jari Aalto Sat, 09 Apr 2011 16:28:13 +0300 bmf (0.9.4-4) unstable; urgency=low * debian/patches - (10): Add new patch to update manual page's BUGS section to notify that only one bmf process can access the database at a time. Update also README location to absolute path. (Closes: #566265). -- Jari Aalto Wed, 27 Jan 2010 14:07:54 +0200 bmf (0.9.4-3) unstable; urgency=low * debian/patches - (30): Add GNU hurd compile fix. -- Jari Aalto Sat, 16 Jan 2010 10:28:20 +0200 bmf (0.9.4-2) unstable; urgency=low * Move to format: 3.0 (quilt). * debian/{clean,upstream} - Move content from 'rules' for dh(1) to use. * debian/control - (Build-Depends): Add libdb-dev, move libdb4.7 to libdb4.8. * debian/copyright - Use FSF URL. * debian/debian-vars.mk - Delete; obsoleted by dh(1). * debian/patches - Convert *.dpatch to quilt format. * debian/rules - (build-stamp): Adjust make call to include CFLAGS and SYSLIBS for Berkeley DB (FTBFS ia64; Closes: #561172) . -- Jari Aalto Tue, 15 Dec 2009 11:41:47 +0200 bmf (0.9.4-1) unstable; urgency=low * Initial release (ITP; Closes: #435347). -- Jari Aalto Fri, 04 Dec 2009 10:48:06 +0200 debian/control0000644000000000000000000000202612235032512010564 0ustar Source: bmf Section: mail Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Jari Aalto Build-Depends: debhelper (>= 9), libdb-dev (>= 5.1) Standards-Version: 3.9.3.1 Vcs-Browser: http://git.debian.org/?p=collab-maint/bmf.git Vcs-Git: git://git.debian.org/git/collab-maint/bmf.git Homepage: http://freshmeat.net/projects/bmf Package: bmf Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: e-mail filter for spam that learns A small, fast, flexible Bayesian filter for processing e-mail. It is "trained" by the user to categorize email as spam or non-spam. This implementation integrates well with existing tools such as procmail and mutt. It can use a variety of formats for storing data. A utility is supplied for converting data between the supported formats. . This package includes support for text and libdb formats. . See "A Plan for Spam" by Paul Graham for further information. debian/rules0000755000000000000000000000064411760605604010257 0ustar #!/usr/bin/make -f PACKAGE = bmf export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = \ -Wall -pedantic -DNDEBUG -D_UNIX -D_LINUX -Wall -DHAVE_LIBDB export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed override_dh_auto_configure: ./configure --with-package=libdb override_dh_auto_build: $(MAKE) LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS) $(CPPFLAGS)" SYSLIBS=-ldb %: dh $@ # End of file debian/watch0000644000000000000000000000007411760605604010225 0ustar version=3 http://sf.net/bmf/bmf-(\d+\.\d+\.[\d.]+)\.tar\.gz debian/patches/0000755000000000000000000000000011760605604010622 5ustar debian/patches/10-bmf.1-hyphen.patch0000644000000000000000000000133111760605604014253 0ustar From ba78345411ed704df62f9ffe997d4f473a1ad301 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Mon, 3 Nov 2008 09:22:59 +0200 Subject: [PATCH] bmf.1: Fix hyphens Signed-off-by: Jari Aalto --- bmf.1 | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bmf.1 b/bmf.1 index b7aa512..a8f9748 100644 --- a/bmf.1 +++ b/bmf.1 @@ -23,8 +23,8 @@ bmf \- efficient Bayesian mail filter .SH "SYNOPSIS" .nf -\fBbmf\fR [-t] [-n] [-s] [-N] [-S] [-f fmt] [-d db] [-i file] [-k n] [-m type] [-p] - [-v] [-V] [-h] +\fBbmf\fR [\-t] [\-n] [\-s] [\-N] [\-S] [\-f fmt] [\-d db] [\-i file] [\-k n] [\-m type] [\-p] + [\-v] [\-V] [\-h] .fi .SH "DESCRIPTION" -- 1.6.5 debian/patches/20-makefile.patch0000644000000000000000000000114511760605604013640 0ustar From 4bcfee1f42f0da3b281e3f98945d8c9a3deb36f3 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Tue, 18 Nov 2008 14:11:40 +0200 Subject: [PATCH] Makefile.in; (checkroot) disable Signed-off-by: Jari Aalto --- Makefile.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.in b/Makefile.in index cac2bcc..035ab83 100644 --- a/Makefile.in +++ b/Makefile.in @@ -78,4 +78,4 @@ rpmpkg: checkroot cd $(PWD)) checkroot: - [ "`whoami`" = root ] || (echo Need root; exit 1) + # [ "`whoami`" = root ] || (echo Need root; exit 1) -- 1.6.5 debian/patches/30-compile-gnu-hurd.patch0000644000000000000000000000405611760605604015247 0ustar From: Cyril Roelandt Subject: allocate the exact amount of memory that is needed diff --git a/dbdb.c b/dbdb.c index 8742dcc..87d8266 100644 --- a/dbdb.c +++ b/dbdb.c @@ -178,7 +178,7 @@ dbt_t* dbdb_db_opentable( dbhdb_t* pthis, cpchar table, bool_t rdonly ) DBT key; DBT val; - char szpath[PATH_MAX]; + char* szpath; ptable = (dbtdb_t*)malloc( sizeof(dbtdb_t) ); if( ptable == NULL ) @@ -194,6 +194,11 @@ dbt_t* dbdb_db_opentable( dbhdb_t* pthis, cpchar table, bool_t rdonly ) ptable->getcount = dbdb_table_getcount; ptable->dbp = NULL; + szpath = malloc( strlen ( pthis->dir ) + strlen( table ) + 5 ); + if( szpath == NULL ) + { + return NULL; + } sprintf( szpath, "%s/%s.db", pthis->dir, table ); #if !defined(DB_VERSION_MAJOR) if( (dbp = dbopen( szpath, O_CREAT|O_RDWR, 0644, DB_BTREE, NULL)) == NULL ) @@ -241,6 +246,7 @@ dbt_t* dbdb_db_opentable( dbhdb_t* pthis, cpchar table, bool_t rdonly ) bail: free( ptable ); + free( szpath ); return NULL; } diff --git a/dbtext.c b/dbtext.c index 4914ef1..4af33f3 100644 --- a/dbtext.c +++ b/dbtext.c @@ -125,7 +125,7 @@ dbt_t* dbtext_db_opentable( dbhtext_t* pthis, cpchar table, bool_t rdonly ) #ifndef NOLOCK struct flock lock; #endif /* ndef NOLOCK */ - char szpath[PATH_MAX]; + char* szpath = NULL; int flags; struct stat st; @@ -159,6 +159,11 @@ dbt_t* dbtext_db_opentable( dbhtext_t* pthis, cpchar table, bool_t rdonly ) ptable->nitems = 0; ptable->pitems = NULL; + szpath = malloc ( strlen( pthis->dir ) + strlen( table ) + 6 ); + if( szpath == NULL ) + { + goto bail; + } sprintf( szpath, "%s/%s.txt", pthis->dir, table ); flags = (rdonly ? O_RDONLY|O_CREAT : O_RDWR|O_CREAT); ptable->fd = open( szpath, flags, 0644 ); @@ -271,6 +276,10 @@ bail_uc: ptable->fd = -1; bail: + if( szpath != NULL ) + { + free( szpath ); + } free( ptable ); return NULL; } debian/patches/10-bmfconv.1-hyphen.patch0000644000000000000000000000117511760605604015147 0ustar From 1484cdcf268a358de16c10974334917eb672b6db Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Mon, 3 Nov 2008 09:24:43 +0200 Subject: [PATCH] bmfconv.1: Fix hyphens Signed-off-by: Jari Aalto --- bmfconv.1 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bmfconv.1 b/bmfconv.1 index 895258f..a05ceeb 100644 --- a/bmfconv.1 +++ b/bmfconv.1 @@ -23,7 +23,7 @@ bmfconv \- Database converter for bmf .SH "SYNOPSIS" .nf -\fBbmfconv\fR [-f fmt] [-d db] [-e] [-i] [-v] [-h] +\fBbmfconv\fR [\-f fmt] [\-d db] [\-e] [\-i] [\-v] [\-h] .fi .SH "DESCRIPTION" -- 1.6.5 debian/patches/10-bmf.1-hyphen=1-runtime.patch0000644000000000000000000000234611760605604016121 0ustar From 21895e91052e99a4a9a98129b44a3c71c312b131 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Wed, 27 Jan 2010 14:12:00 +0200 Subject: [PATCH] bmf.1: (BUGS): Add procmail example Signed-off-by: Jari Aalto --- bmf.1 | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bmf.1 b/bmf.1 index a8f9748..e34af2b 100644 --- a/bmf.1 +++ b/bmf.1 @@ -99,7 +99,7 @@ MIME and other attachments are not decoded. Experience from watching the token s .SH "INTEGRATION WITH OTHER TOOLS" .PP -Please see the README for samples and suggestions. +Please see the /usr/share/doc/bmf/README.gz for samples and suggestions. .SH "RETURN VALUES" @@ -130,10 +130,19 @@ List of bad tokens for libdb mode. .SH "BUGS" .PP -The lexer should recognize multiline headers. +Only one copy of +.B bmf(1) +instance can access the database (see options \-d and \-f). In Procmail +recipes, ensure sequential access with a lock file: + + :0 fw: bmf.lock + | bmf \-p + +.PP +The lexer does not recognize multiline headers. .PP -The lexer should recognize MIME attachments. +The lexer does not recognize MIME attachments. .PP Content-Transfer-Encoding is not decoded. -- 1.6.5 debian/patches/40-patch-lex.c0000644000000000000000000000261311760605604013076 0ustar Subject: Fix for RFC822 folded header line field From: https://sourceforge.net/tracker/?func=detail&aid=2816230&group_id=63555&atid=504404 $MirOS: ports/mailnews/bmf/patches/patch-lex_c,v 1.1 2009/07/03 09:14:12 tg Exp $ --- a/lex.c.orig Sun Oct 20 20:28:53 2002 +++ a/lex.c Fri Jul 3 09:06:51 2009 @@ -682,7 +682,7 @@ again: void lex_passthru( lex_t* pthis, bool_t is_spam, double hits ) { char szbuf[256]; - bool_t in_headers = true; + bool_t ign_header = false; assert( pthis->bom < pthis->buflen && pthis->eom <= pthis->buflen ); assert( pthis->bom <= pthis->eom ); @@ -701,7 +701,7 @@ void lex_passthru( lex_t* pthis, bool_t } /* existing headers */ - while( in_headers && pthis->pos < pthis->eom ) + while( pthis->pos < pthis->eom ) { cpchar pbuf = pthis->pbuf + pthis->pos; uint len = 0; @@ -722,9 +722,14 @@ void lex_passthru( lex_t* pthis, bool_t } /* write header, ignoring existing spam headers */ - if( strncasecmp( pbuf, "X-Spam-", 7 ) != 0 ) + if( ign_header && (pbuf[0] == ' ' || pbuf[0] == '\t') ) + /* continuation line of an ignored header */ ; + else if( strncasecmp( pbuf, "X-Spam-", 7 ) == 0 ) + ign_header = true; + else { write( STDOUT_FILENO, pbuf, len ); + ign_header = false; } pthis->pos += len; debian/patches/series0000644000000000000000000000021311760605604012033 0ustar 10-bmf.1-hyphen.patch 10-bmf.1-hyphen=1-runtime.patch 10-bmfconv.1-hyphen.patch 20-makefile.patch 30-compile-gnu-hurd.patch 40-patch-lex.c debian/docs0000644000000000000000000000001411760605604010041 0ustar README TODO debian/compat0000644000000000000000000000000211760605604010371 0ustar 9