File: scmail-refile.in

package info (click to toggle)
scmail 1.3-4.1
  • links: PTS
  • area: main
  • in suites: bullseye, forky, sid, trixie
  • size: 592 kB
  • sloc: lisp: 1,535; sh: 178; makefile: 145
file content (41 lines) | stat: -rw-r--r-- 1,478 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! @GOSH@
;;; -*- scheme -*-
;;;
;;; scmail - a mail filter written in Scheme
;;;
;;; Copyright (C) 2002-2004 Satoru Takabayashi <satoru@namazu.org> 
;;;     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.
;;;

(use scmail)
(use scmail.config-core)
(use scmail.config)
(use scmail.mail)
(use scmail.mailbox)
(use file.util)

(define (main-process mailbox target-folder dry-run-mode)
  (for-each (lambda (file)
              (if (file-exists? file)
                  (let* ((mailbox-type (ref (scmail-config) 'mailbox-type))
                         (mail (make-scmail-mail mailbox-type
                                                 :file file
                                                 :mailbox mailbox
                                                 :dry-run-mode dry-run-mode)))
                    (scmail-filter mail))))
            (scmail-mailbox-mail-list mailbox target-folder)))


(define (main args)
  (scmail-main args main-process 'refile-rules #f)
  0)