diff options
-rw-r--r-- | mumi/messages.scm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mumi/messages.scm b/mumi/messages.scm index 2e0f8ca..f228687 100644 --- a/mumi/messages.scm +++ b/mumi/messages.scm @@ -224,10 +224,16 @@ multipart messages." (let* ((boundary (string-append "--" (assoc-ref attributes "boundary"))) (final-boundary (string-append boundary "--"))) - (if (string=? boundary line) - (collect-parts boundary port) - ;; Invalid multipart message - '())))) + (cond + ((or (string=? boundary line) + ;; It's possible that the first line is + ;; empty and is followed by the boundary. + (and (string-null? line) + (string=? boundary (get-line port)))) + (collect-parts boundary port)) + (else + ;; Invalid multipart message + '()))))) ;; TODO: there might be some white space after the end of ;; this embedded multipart message. Not sure what to do ;; with it, though. |