Commit 59c262ad 59c262ad3411069e9998d088ba89441a84df2e1a by Sergey Poznyakoff

Use handle-exception where necessary

1 parent f6006384
1 ;;;; GNU Mailutils -- a suite of utilities for electronic mail 1 ;;;; GNU Mailutils -- a suite of utilities for electronic mail
2 ;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 ;;;; Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
3 ;;;; 3 ;;;;
4 ;;;; GNU Mailutils is free software; you can redistribute it and/or modify 4 ;;;; GNU Mailutils is free software; you can redistribute it and/or modify
5 ;;;; it under the terms of the GNU General Public License as published by 5 ;;;; it under the terms of the GNU General Public License as published by
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
37 37
38 ;;; redirect action 38 ;;; redirect action
39 (define (action-redirect address) 39 (define (action-redirect address)
40 (sieve-verbose-print "REDIRECT" "to address " address)
41 (handle-exception
40 (if sieve-my-email 42 (if sieve-my-email
41 (cond 43 (cond
42 ((sent-from-me? sieve-current-message) 44 ((sent-from-me? sieve-current-message)
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
47 (mu-message-set-header out-msg "X-Sender" sieve-my-email) 49 (mu-message-set-header out-msg "X-Sender" sieve-my-email)
48 (mu-message-send out-msg #f sender address) 50 (mu-message-send out-msg #f sender address)
49 (mu-message-destroy out-msg)) 51 (mu-message-destroy out-msg))
50 (mu-message-delete sieve-current-message))))) 52 (mu-message-delete sieve-current-message))))))
51 53
52 ;;; Register action 54 ;;; Register action
53 (if sieve-parser 55 (if sieve-parser
......
1 ;;;; GNU Mailutils -- a suite of utilities for electronic mail 1 ;;;; GNU Mailutils -- a suite of utilities for electronic mail
2 ;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 ;;;; Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
3 ;;;; 3 ;;;;
4 ;;;; GNU Mailutils is free software; you can redistribute it and/or modify 4 ;;;; GNU Mailutils is free software; you can redistribute it and/or modify
5 ;;;; it under the terms of the GNU General Public License as published by 5 ;;;; it under the terms of the GNU General Public License as published by
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
20 (define sieve-option-quote #t) 20 (define sieve-option-quote #t)
21 21
22 (define (action-reject reason) 22 (define (action-reject reason)
23 (sieve-verbose-print "REJECT")
24 (handle-exception
23 (let ((mime (mu-mime-create 0)) 25 (let ((mime (mu-mime-create 0))
24 (datestr (strftime "%a, %b %d %H:%M:%S %Y %Z" 26 (datestr (strftime "%a, %b %d %H:%M:%S %Y %Z"
25 (localtime (current-time)))) 27 (localtime (current-time))))
...@@ -81,7 +83,7 @@ ...@@ -81,7 +83,7 @@
81 (mu-mime-add-part mime mesg)) 83 (mu-mime-add-part mime mesg))
82 84
83 (mu-message-send (mu-mime-get-message mime) #f sieve-daemon-email sender) 85 (mu-message-send (mu-mime-get-message mime) #f sieve-daemon-email sender)
84 (mu-message-delete sieve-current-message))) 86 (mu-message-delete sieve-current-message))))
85 87
86 ;;; Register action 88 ;;; Register action
87 (if sieve-parser 89 (if sieve-parser
......
1 ;;;; GNU Mailutils -- a suite of utilities for electronic mail 1 ;;;; GNU Mailutils -- a suite of utilities for electronic mail
2 ;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 2 ;;;; Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
3 ;;;; 3 ;;;;
4 ;;;; GNU Mailutils is free software; you can redistribute it and/or modify 4 ;;;; GNU Mailutils is free software; you can redistribute it and/or modify
5 ;;;; it under the terms of the GNU General Public License as published by 5 ;;;; it under the terms of the GNU General Public License as published by
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
160 (mu-message-send mesg #f #f sender))) 160 (mu-message-send mesg #f #f sender)))
161 161
162 (define (action-vacation text . opt) 162 (define (action-vacation text . opt)
163 (sieve-verbose-print "VACATION")
163 (set! vacation-debug (member #:debug opt)) 164 (set! vacation-debug (member #:debug opt))
164 (if vacation-debug 165 (if vacation-debug
165 (begin 166 (begin
......