diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-02-11 16:46:02 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-02-11 16:46:02 +0000 |
commit | 99e0f03da664c9b607eaf37b6451911bb3fa5d00 (patch) | |
tree | 51e334255f6e3eb16ed383a85db59ab0872d06bc /examples | |
parent | b56654bd9b73948880570b381ea73f7769b445f2 (diff) | |
download | anubis-99e0f03da664c9b607eaf37b6451911bb3fa5d00.tar.gz anubis-99e0f03da664c9b607eaf37b6451911bb3fa5d00.tar.bz2 |
Split msg-process into two procedures: one for rotating the subject header
and another for rotating the message body.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/anubis.scm | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/examples/anubis.scm b/examples/anubis.scm index d87334d..5836348 100644 --- a/examples/anubis.scm +++ b/examples/anubis.scm @@ -75,8 +75,8 @@ is preserved in X-Anubis-Preserved-Header header" (else #t)))) (else #t)))) -;;; This function illustrates the concept of Anubis message processing -;;; functions. +;;; The three functions below illustrate the concept of Anubis message +;;; processing functions. ;;; A processing function takes two arguments: ;;; ;;; HDR -- A list of message headers. Each list element is a cons @@ -96,10 +96,10 @@ is preserved in X-Anubis-Preserved-Header header" ;;; #f -- delete entire body. ;;; #t -- preserve the body as is. -(define (msg-process hdr body) +(define (anubis-rot-13-all hdr body) "Encode the \"Subject\" header and the body using ROT-13. Add X-Processed-By header." - (DEBUG 1 "postprocess called with hdr=" hdr " and body=\"" body "\"") + (DEBUG 1 "anubis-rot-13-all called with hdr=" hdr " and body=\"" body "\"") (cons (append (map (lambda (x) (if (string-ci=? (car x) "subject") @@ -109,6 +109,23 @@ X-Processed-By header." (list (cons "X-Processed-By" "GNU Anubis"))) (rot-13 body))) +(define (anubis-rot-13-header hdr body) + "Encode the \"Subject\" header using ROT-13." + (DEBUG 1 "anubis-rot-13-header called with hdr=" hdr + " and body=\"" body "\"") + (cons (map (lambda (x) + (if (string-ci=? (car x) "subject") + (cons (car x) (rot-13 (cdr x))) + x)) + hdr) + #t)) + +(define (anubis-rot-13-body hdr body) + "Encode the message body using ROT-13." + (DEBUG 1 "anubis-rot-13-body called with hdr=" hdr " and body=\"" body "\"") + (cons #t + (rot-13 body))) + ;; To test your output redirection: (DEBUG 1 "LOADED anubis.scm") |