debian/0000755000000000000000000000000011511275366007175 5ustar debian/source/0000755000000000000000000000000011506506354010473 5ustar debian/source/format0000644000000000000000000000001411506506354011701 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000010011506506664010217 0ustar version=3 http://namazu.org/~satoru/scmail/scmail-(.*)\.tar\.gz debian/patches/0000755000000000000000000000000011506525730010621 5ustar debian/patches/series0000644000000000000000000000020511506522525012032 0ustar 00-debian-changes.diff 01-fix-module.diff 02-use-scmail-config-core.diff 03-fix-scmail.diff 04-fix-lock.diff 05-fix-tail-option.diff debian/patches/00-debian-changes.diff0000644000000000000000000000406711506525714014531 0ustar Description: Debian specific changes to install Author: NIIBE Yutaka Last-Update: 2010-12-29 --- scmail-1.3.orig/Makefile +++ scmail-1.3/Makefile @@ -1,8 +1,11 @@ VERSION = 1.3 -PREFIX = /usr/local +DESTDIR= + +PREFIX = /usr BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/scmail +SAMPLEDIR=$(PREFIX)/share/doc/scmail/examples SITELIBDIR = `gauche-config --sitelibdir` DIST = AUTHORS \ @@ -68,19 +71,21 @@ scbayes: scbayes.in Makefile clean: rm -f $(TARGET) + cd doc && make clean + cd tests && make clean check: all cd tests && make check install: - mkdir -p $(BINDIR) - mkdir -p $(DATADIR) - mkdir -p $(SITELIBDIR)/scmail - mkdir -p $(DATADIR)/dot.scmail - cp -fp scmail-deliver scmail-refile scbayes $(BINDIR) - cp -fp dot.scmail/*.sample $(DATADIR)/dot.scmail - cp -fp scmail.scm $(SITELIBDIR) - cp -fp scmail/*.scm $(SITELIBDIR)/scmail + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(DATADIR) + mkdir -p $(DESTDIR)$(SITELIBDIR)/scmail + mkdir -p $(DESTDIR)$(SAMPLEDIR) + cp -fp scmail-deliver scmail-refile scbayes $(DESTDIR)$(BINDIR) + cp -fp dot.scmail/*.sample $(DESTDIR)$(SAMPLEDIR) + cp -fp scmail.scm $(DESTDIR)$(SITELIBDIR) + cp -fp scmail/*.scm $(DESTDIR)$(SITELIBDIR)/scmail dist: all rm -rf scmail-$(VERSION) --- scmail-1.3.orig/doc/embed.scm +++ scmail-1.3/doc/embed.scm @@ -1,4 +1,6 @@ (use gauche.regexp) +(use gauche.charconv) + (define (escape str) (set! str (regexp-replace-all #/&/ str "&")) (set! str (regexp-replace-all #/string in))))) + (escape (port->string in))) + :encoding 'utf-8)) (define (main args) (call-with-input-file (cadr args) @@ -22,5 +25,6 @@ "
\n"
                                              (read-file-and-escape (rxmatch-substring m 1))
                                              "
\n"))))) - (display content)))) + (display content))) + :encoding 'eucjp) 0) debian/patches/03-fix-scmail.diff0000644000000000000000000000112311506516424013724 0ustar Description: Fix scmail.scm for eprintf Author: NIIBE Yutaka Last-Update: 2010-12-29 --- scmail-1.3.orig/scmail.scm 2010-12-29 11:18:28.000000000 +0900 +++ scmail-1.3/scmail.scm 2010-12-29 11:17:24.000000000 +0900 @@ -265,7 +265,7 @@ (unless (eq? status :last) (scmail-filter-iter mail (cdr filter-rules)))))) (unless (is-a? mail ) - (scmail-eprintf " required but got ~a" (class-of mail))) + (scmail-eformat " required but got ~a" (class-of mail))) (scmail-filter-iter mail (filter-rules))) debian/patches/04-fix-lock.diff0000644000000000000000000000233611506521707013414 0ustar Description: Fix scmail.scm for eprintf Author: NIIBE Yutaka Last-Update: 2010-12-29 --- scmail-1.3.orig/scbayes.in~ 2010-12-29 11:30:02.000000000 +0900 +++ scmail-1.3/scbayes.in 2010-12-29 11:55:21.000000000 +0900 @@ -131,8 +131,16 @@ (sys-rename (temporary-table-file) (table-file)) (sys-rename (temporary-digest-file) (digest-file))))) +(define (create-file-exclusively name) + (let ((p (open-output-file name :if-exists #f :if-does-not-exist :create))) + (if p + (begin + (close-output-port p) + #t) + #f))) + (define (lock) - (unless (eq? (create-directory* (lock-file)) #t) + (unless (eq? (create-file-exclusively (lock-file)) #t) (scmail-wformat "~a is now being updated" (table-file)) (scmail-wformat "or perhaps ~a is staled." (lock-file)) (scmail-eformat "(Please remove the lock file if it is staled.)")) @@ -301,7 +309,7 @@ (sys-unlink (temporary-table-file))) (if (file-exists? (temporary-digest-file)) (sys-unlink (temporary-digest-file))) - (sys-rmdir (lock-file))) + (sys-unlink (lock-file))) (let1 mailbox (make-scmail-mailbox (ref (scmail-config) 'mailbox-type) (ref (scmail-config) 'mailbox)) debian/patches/01-fix-module.diff0000644000000000000000000001416211506514361013744 0ustar Description: Module usage changes Author: NIIBE Yutaka Last-Update: 2010-12-29 --- /dev/null 2010-12-13 22:47:48.325718848 +0900 +++ scmail-1.3.orig/scmail/config-core.scm 2010-12-29 11:07:21.000000000 +0900 @@ -0,0 +1,85 @@ +;;; +;;; scmail - a mail filter written in Scheme +;;; +;;; Copyright (C) 2002-2004 Satoru Takabayashi +;;; All rights reserved. +;;; This is free software with ABSOLUTELY NO WARRANTY. +;;; +;;; Permission to use, copy, modify, distribute this software and +;;; accompanying documentation for any purpose is hereby granted, +;;; provided that existing copyright notices are retained in all +;;; copies and that this notice is included verbatim in all +;;; distributions. +;;; This software is provided as is, without express or implied +;;; warranty. In no circumstances the author(s) shall be liable +;;; for any damages arising out of the use of this software. +;;; + +(define-module scmail.config-core + (use file.util) + (use gauche.parameter) + (export + scmail-config + scmail-config-set-verbose-mode! + scmail-config-verbose-mode? + )) +(select-module scmail.config-core) + +(define-class () + ((mailbox :init-value "~/Mail" + :init-keyword :mailbox) + (mailbox-type :init-value 'mh + :init-keyword :mailbox-type) + (inbox :init-value "inbox" + :init-keyword :inbox) + (spam :init-value "spam" + :init-keyword :spam) + (umask :init-value #o077 + :init-keyword :umask) + (size-limit :init-value (* (* 1024 1024) 10) ; 10 MB + :init-keyword :size-limit) + (smtp-host :init-value "localhost" + :init-keyword :smtp-host) + (log-file :init-value "log" + :init-keyword :log-file) + (deliver-rules :init-value "deliver-rules" + :init-keyword :deliver-rules) + (refile-rules :init-value "refile-rules" + :init-keyword :refile-rules) + (token-table :init-value "token-table.dbm" + :init-keyword :token-table) + (digest :init-value "digest.dbm" + :init-keyword :digest) + (verbose-mode :init-value #f) + + ;; for backward compatibility + (junk :init-value #f + :init-keyword :junk) + )) + +(define-method initialize ((config ) initargs) + (next-method) + (if (not (or (eq? (ref config 'mailbox-type) 'mh) + (eq? (ref config 'mailbox-type) 'maildir))) + (errorf "unsupported mailbox-type: ~a" (ref config 'mailbox-type))) + (if (ref config 'junk) + (slot-set! config 'spam (ref config 'junk))) + + (for-each (lambda (slot) + (slot-set! config slot (expand-path (ref config slot)))) + (list 'log-file 'refile-rules 'deliver-rules 'mailbox + 'token-table 'digest)) +) + +(define-method write-object ((config ) port) + (format port "[config]")) + +(define scmail-config (make-parameter (make ))) + +(define (scmail-config-set-verbose-mode!) + (slot-set! (scmail-config) 'verbose-mode #t)) + +(define (scmail-config-verbose-mode?) + (ref (scmail-config) 'verbose-mode)) + +(provide "scmail/config-core") --- scmail-1.3.orig/scmail/config.scm +++ scmail-1.3/scmail/config.scm @@ -18,6 +18,8 @@ (define-module scmail.config (use file.util) (use gauche.parameter) + (use scmail.config-core) + (use scmail.util) (export scmail-config-set-directory! scmail-config-default-file @@ -35,57 +37,11 @@ (define (scmail-config-set-directory! directory) (scmail-config-directory directory)) -(define-class () - ((mailbox :init-value "~/Mail" - :init-keyword :mailbox) - (mailbox-type :init-value 'mh - :init-keyword :mailbox-type) - (inbox :init-value "inbox" - :init-keyword :inbox) - (spam :init-value "spam" - :init-keyword :spam) - (umask :init-value #o077 - :init-keyword :umask) - (size-limit :init-value (* (* 1024 1024) 10) ; 10 MB - :init-keyword :size-limit) - (smtp-host :init-value "localhost" - :init-keyword :smtp-host) - (log-file :init-value "log" - :init-keyword :log-file) - (deliver-rules :init-value "deliver-rules" - :init-keyword :deliver-rules) - (refile-rules :init-value "refile-rules" - :init-keyword :refile-rules) - (token-table :init-value "token-table.dbm" - :init-keyword :token-table) - (digest :init-value "digest.dbm" - :init-keyword :digest) - (verbose-mode :init-value #f) - - ;; for backward compatibility - (junk :init-value #f - :init-keyword :junk) - )) - (define (build-config-path path) (if (absolute-path? path) path (build-path (scmail-config-directory) path))) -(define-method initialize ((config ) initargs) - (next-method) - (if (not (or (eq? (ref config 'mailbox-type) 'mh) - (eq? (ref config 'mailbox-type) 'maildir))) - (errorf "unsupported mailbox-type: ~a" (ref config 'mailbox-type))) - (if (ref config 'junk) - (slot-set! config 'spam (ref config 'junk))) - - (for-each (lambda (slot) - (slot-set! config slot (expand-path (ref config slot)))) - (list 'log-file 'refile-rules 'deliver-rules 'mailbox - 'token-table 'digest)) -) - (define (scmail-config-read config-file) (with-error-handler (lambda (e) (make )) @@ -95,18 +51,6 @@ (scmail-config (apply make options)) (scmail-config))))) -(define-method write-object ((config ) port) - (format port "[config]")) - -(define scmail-config (make-parameter (make ))) - -(define (scmail-config-set-verbose-mode!) - (slot-set! (scmail-config) 'verbose-mode #t)) - -(define (scmail-config-verbose-mode?) - (ref (scmail-config) 'verbose-mode)) - - ;; Return an old path if it is existed for backward compatibility. (define (choose path) (define table --- scmail-1.3.orig/scmail/util.scm +++ scmail-1.3/scmail/util.scm @@ -19,7 +19,7 @@ (use file.util) (use srfi-13) (use gauche.parameter) - (use scmail.config) + (use scmail.config-core) (use scmail.progress) (use gauche.version) (export filter safe-rxmatch debian/patches/02-use-scmail-config-core.diff0000644000000000000000000000344211506516430016125 0ustar Description: Use scmail.config-core module Author: NIIBE Yutaka Last-Update: 2010-12-29 --- scmail-1.3.orig/scbayes.in +++ scmail-1.3/scbayes.in @@ -27,6 +27,7 @@ (use scmail) (use scmail.mail) (use scmail.mailbox) +(use scmail.config-core) (use scmail.config) (use scmail.progress) (use scmail.util) --- scmail-1.3.orig/scmail-refile.in +++ scmail-1.3/scmail-refile.in @@ -18,6 +18,7 @@ ;;; (use scmail) +(use scmail.config-core) (use scmail.config) (use scmail.mail) (use scmail.mailbox) --- scmail-1.3.orig/scmail-deliver.in +++ scmail-1.3/scmail-deliver.in @@ -18,6 +18,7 @@ ;;; (use scmail) +(use scmail.config-core) (use scmail.config) (use scmail.mail) --- scmail-1.3.orig/scmail.scm +++ scmail-1.3/scmail.scm @@ -23,6 +23,7 @@ (use gauche.parseopt) (use gauche.parameter) (use file.util) + (use scmail.config-core) (use scmail.config) (use scmail.util) (use scmail.mail) --- scmail-1.3.orig/tests/config.scm +++ scmail-1.3/tests/config.scm @@ -4,6 +4,7 @@ (test-start "scmail.config") +(use scmail.config-core) (use scmail.config) (test-module 'scmail.config) --- scmail-1.3.orig/tests/scmail.scm +++ scmail-1.3/tests/scmail.scm @@ -8,6 +8,7 @@ (use scmail) (use scmail.mail) (use scmail.mailbox) +(use scmail.config-core) (use scmail.config) (test-module 'scmail) --- scmail-1.3.orig/tests/util.scm +++ scmail-1.3/tests/util.scm @@ -3,6 +3,7 @@ (test-start "scmail.util") (use scmail.util) +(use scmail.config-core) (use scmail.config) (use scmail.progress) --- scmail-1.3.orig/tests/bayesian-filter.scm.in +++ scmail-1.3/tests/bayesian-filter.scm.in @@ -4,6 +4,7 @@ (use srfi-13) (test-start "scmail.bayesian-filter") (use scmail.bayesian-filter) +(use scmail.config-core) (use scmail.config) (use scmail.mail) (use file.util) debian/patches/05-fix-tail-option.diff0000644000000000000000000000075111506522357014725 0ustar Description: fix tail option Author: NIIBE Yutaka Last-Update: 2010-12-29 --- scmail-1.3.orig/tests/scmail-commands +++ scmail-1.3/tests/scmail-commands @@ -209,7 +209,7 @@ scbayes_learn test.config2 scbayes_unlearn test.config2 gosh -I.. ../scbayes -c test.config2 --table-stat > test.stat4 -tail +2 test.stat4 > test.stat4.1 +tail -n +2 test.stat4 > test.stat4.1 grep ' 0w/ .* 0m .* 0w/ .* 0m' test.stat4 > test.stat4.2 cmp test.stat4.1 test.stat4.2 || exit 1 debian/changelog0000644000000000000000000000261211511275134011041 0ustar scmail (1.3-4) unstable; urgency=low * debian/control (Build-Depends): Added gauche-gdbm (Closes: #608558). Thanks to Salvatore Bonaccorso -- NIIBE Yutaka Thu, 06 Jan 2011 17:16:28 +0900 scmail (1.3-3) unstable; urgency=low * debian/control (Build-Depends): Added gauche-dev and quilt. Require newer debhelper (Closes: #608205). Thanks to Jakub Wilk. (Depends): Added ${misc:Depends}. (Standards-Version): Conforms to 3.9.1. * debian/compat: Updated to 7. * debian/source/format: New file. * debian/watch: Adopted version 3 format. * debian/patches/00-debian-changes.diff: New file from diff of 1.3-2. * debian/patches/01-fix-module.diff: New file because of Gauche module change. * debian/patches/02-use-scmail-config-core.diff: Ditto. * debian/patches/03-fix-scmail.diff: New file for old bug fix. * debian/patches/04-fix-lock.diff: New file because of Gauche sys-mkdir change. * debian/patches/04-fix-tail-option.diff: New file because of 'tail' command. -- NIIBE Yutaka Wed, 29 Dec 2010 10:19:26 +0900 scmail (1.3-2) unstable; urgency=low * debian/control (Depends): Added gauche-gdbm (closes: #344891). -- NIIBE Yutaka Wed, 4 Jan 2006 17:59:52 +0900 scmail (1.3-1) unstable; urgency=low * Initial Release (closes: #291791). -- NIIBE Yutaka Mon, 21 Feb 2005 18:55:10 +0900 debian/compat0000644000000000000000000000000211506505711010365 0ustar 7 debian/dirs0000644000000000000000000000001011506505642010045 0ustar usr/bin debian/control0000644000000000000000000000133311511274776010604 0ustar Source: scmail Section: mail Priority: optional Maintainer: NIIBE Yutaka Build-Depends: quilt (>= 0.46-7~), debhelper (>= 7.0.50~), gauche, gauche-dev (>= 0.9), gauche-gdbm Standards-Version: 3.9.1 Homepage: http://www.namazu.org/~satoru/scmail/index.html.en Package: scmail Architecture: all Depends: gauche, gauche-gdbm, ${misc:Depends} Description: a mail filter written in Scheme Scmail is a mail filter written in Scheme, you can write processing recipes in S-expression. Scmail can be used as a filter for an incoming mail, invoked each time by .forward, or it can be used as a mail processor to distribute existing mails into the right mailbox. It comes with a bayesian spam filter called scbayes. debian/docs0000644000000000000000000000005711506505642010047 0ustar NEWS README doc/scmail-ja.html doc/scmail.html debian/rules0000755000000000000000000000023011506507065010246 0ustar #!/usr/bin/make -f # -*- makefile-gmake -*- # # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DH_OPTIONS %: dh --with quilt $@ debian/copyright0000644000000000000000000000560111506505642011127 0ustar This package was debianized by NIIBE Yutaka on Mon, 21 Feb 2005 18:55:10 +0900. It was downloaded from: http://namazu.org/~satoru/scmail/ Copyright: (C) 2002, 2003, 2004 Satoru Takabayashi Upstream Author: Satoru Takabayashi License: In short, scmail is distributed under so called "BSD license", that is, as far as you retain the copyrignt notice and disclaimer below, you can use, copy, modify and redistribute your modification freely. The formal term is specified in each copyright notices. Copyright and condition of use of main portion of the source: ----------------------------------------------------------------------------- Copyright (c) 2002-2004 Satoru Takabayashi, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- Copyright of scbayes.in, scmail/bayesian-filter.scm ------------------------- ;;; Copyright(C) 2003 by Shiro Kawai (shiro@acm.org) ;;; ;;; Permission to use, copy, modify, distribute this software and ;;; accompanying documentation for any purpose is hereby granted, ;;; provided that existing copyright notices are retained in all ;;; copies and that this notice is included verbatim in all ;;; distributions. ;;; This software is provided as is, without express or implied ;;; warranty. In no circumstances the author(s) shall be liable ;;; for any damages arising out of the use of this software.