(lambda (output-port)
(call-with-mime-decoding-output-port encoding output-port #t
(lambda (output-port)
- (write-substring string start end output-port)))))))))
+ (with-mime-best-effort
+ (lambda ()
+ (write-substring string start end output-port)))))))))))
(define (mime:get-boundary parameters)
(let ((parameter (assq 'BOUNDARY parameters)))
decode:initialize decode:finalize decode:update
make-port call-with-port))
name)
-
+\f
(define (define-identity-mime-encoding name)
(hash-table/put! mime-encodings
name
'CALL-WITH-MIME-DECODING-OUTPUT-PORT)
encoding)))
port text? generator))
+
+(define (with-mime-best-effort thunk)
+ (call-with-current-continuation
+ (lambda (exit)
+ (bind-condition-handler (list condition-type:decode-mime)
+ (lambda (condition)
+ condition
+ (exit unspecific))
+ thunk))))
\f
(define-identity-mime-encoding '7BIT)
(define-identity-mime-encoding '8BIT)
port
text?
(lambda (port)
- (write-mime-body body port)))))))))
+ (with-mime-best-effort
+ (lambda ()
+ (write-mime-body body port)))))))))))
(define (filter-mime-attachment-filename filename)
(let ((filename
port
#t
(lambda (port)
- (write-mime-body body port))))))
+ (with-mime-best-effort
+ (lambda ()
+ (write-mime-body body port))))))))
(define-method insert-mime-body-inline*
(entity (body <mime-body-message>) selector context mark)