diff --git a/collects/sirmail/doc.txt b/collects/sirmail/doc.txt index e455799c93..4aa3409e41 100644 --- a/collects/sirmail/doc.txt +++ b/collects/sirmail/doc.txt @@ -126,3 +126,8 @@ entry is a list of at least two elements: The overriding-options feature was a quick hack for what I needed, and it should be replaced eventually. There's a lot of duplication of information in the current format. + + +For an individual folder, if your "mailbox" file gets corrupted, you +can run the "recover.ss" script with the mail folder's directory as +the current directory. diff --git a/collects/sirmail/recover.ss b/collects/sirmail/recover.ss index d0f28401c5..e9629681f2 100644 --- a/collects/sirmail/recover.ss +++ b/collects/sirmail/recover.ss @@ -3,8 +3,9 @@ (lib "head.ss" "net")) (define msgs - (sort (filter (lambda (x) (regexp-match "^[0-9]*$" x)) (directory-list)) - (lambda (a b) (< (string->number a) (string->number b))))) + (sort (filter (lambda (x) (regexp-match #rx"^[0-9]*$" (path->string x))) (directory-list)) + (lambda (a b) (< (string->number (path->string a)) + (string->number (path->string b)))))) (define mailbox (let loop ([msgs msgs][p 1]) @@ -15,7 +16,7 @@ (let ([header (with-input-from-file msg (lambda () (read-string (file-size msg))))]) (cons (list - (string->number msg) + (string->number (path->string msg)) p (file-exists? (format "~abody" msg)) (extract-field "From" header)