Commit d785147d d785147d9159e488bbf1f0311103041072bd7ac2 by Sergey Poznyakoff

Always load mailutils module

(sieve-main): Use (mu-mail-directory) instead of mu-path-maildir.
1 parent 14d03c97
;;;; GNU Mailutils -- a suite of utilities for electronic mail
;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
;;;; Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
;;;;
;;;; GNU Mailutils is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
......@@ -17,6 +17,9 @@
;;;; This module provides core functionality for the sieve scripts.
(set! %load-path (append %load-path (list sieve-libdir)))
(use-modules (mailutils))
;;; The email address for originator of error messages. Should be <>
;;; but current mailutils API is unable to parse and handle it.
;;; Site administrators are supposed to replace it with the
......@@ -173,7 +176,7 @@
;; FIXME: This is very inefficient, but I have to use this
;; provided (string-index str (string-ref key 0)) may not
;; work...
((comp (make-shared-substring str index (+ index key-len))
((comp (substring str index (+ index key-len))
key)
(xx #t))
(else
......@@ -434,14 +437,11 @@
(define (sieve-main)
(cond
((not (guimb?))
; (DEBUG 1 "Loading mailutils")
(set! %load-path (append %load-path (list sieve-libdir)))
(use-modules (mailutils))
(let* ((cl (sieve-command-line))
(name (if (and (not (null? (cdr cl)))
(string? (cadr cl)))
(cadr cl)
(string-append mu-path-maildir "/"
(string-append (mu-mail-directory) "/"
(passwd:name (mu-getpwuid (getuid)))))))
; (DEBUG 2 "mailbox name " name)
(set! sieve-mailbox (mu-mailbox-open name "rw"))
......