unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4139: 23.1; rmailmm fails on multi-part messages (path)
@ 2009-08-13 16:43 David J. Biesack
  0 siblings, 0 replies; only message in thread
From: David J. Biesack @ 2009-08-13 16:43 UTC (permalink / raw)
  To: 4139


I found that the bug is easier to reproduce with sending
plain text (no HTML) and simply 2 or 3 attachements.

I debugged and found that the original code
was deleting the delimiter of the next attachment
so it was skipping it.

below is a patch

-- 
David J. Biesack, SAS
SAS Campus Dr. Cary, NC 27513
www.sas.com    (919) 531-7771

$ diff -csw rmailmm.el.orig rmailmm.el
*** rmailmm.el.orig     Thu Aug 13 11:54:46 2009
--- rmailmm.el  Thu Aug 13 12:26:22 2009
***************
*** 194,200 ****
    ;;    of the preceding part.
    ;; We currently don't handle that.
    (let ((boundary (cdr (assq 'boundary content-type)))
!       beg end next)
      (unless boundary
        (rmail-mm-get-boundary-error-message
         "No boundary defined" content-type content-disposition
--- 194,200 ----
    ;;    of the preceding part.
    ;; We currently don't handle that.
    (let ((boundary (cdr (assq 'boundary content-type)))
!       beg end end-delim next)
      (unless boundary
        (rmail-mm-get-boundary-error-message
         "No boundary defined" content-type content-disposition
***************
*** 212,218 ****
      ;; the beginning of the next part.
      (setq beg (point-min))
      (while (search-forward boundary nil t)
!       (setq end (match-beginning 0))
        ;; If this is the last boundary according to RFC 2046, hide the
        ;; epilogue, else hide the boundary only.  Use a marker for
        ;; `next' because `rmail-mime-show' may change the buffer.
--- 212,219 ----
      ;; the beginning of the next part.
      (setq beg (point-min))
      (while (search-forward boundary nil t)
!       (setq end (match-beginning 0)
!             end-delim (match-end 0))
        ;; If this is the last boundary according to RFC 2046, hide the
        ;; epilogue, else hide the boundary only.  Use a marker for
        ;; `next' because `rmail-mime-show' may change the buffer.
***************
*** 224,230 ****
             (rmail-mm-get-boundary-error-message
              "Malformed boundary" content-type content-disposition
              content-transfer-encoding)))
!       (delete-region end next)
        ;; Handle the part.
        (save-match-data
        (save-excursion
--- 225,231 ----
             (rmail-mm-get-boundary-error-message
              "Malformed boundary" content-type content-disposition
              content-transfer-encoding)))
!       (delete-region end-delim next)
        ;; Handle the part.
        (save-match-data
        (save-excursion
***************
*** 232,238 ****
            (narrow-to-region beg end)
            (rmail-mime-show))))
        (setq beg next)
!       (goto-char beg))))
  
  (defun test-rmail-mime-multipart-handler ()
    "Test of a mail used as an example in RFC 2046."
--- 233,242 ----
            (narrow-to-region beg end)
            (rmail-mime-show))))
        (setq beg next)
!       (goto-char beg)
!       (beginning-of-line 1)
!       (delete-region (point) beg)
!       (setq beg (point)))))
  
  (defun test-rmail-mime-multipart-handler ()
    "Test of a mail used as an example in RFC 2046."





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-13 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-13 16:43 bug#4139: 23.1; rmailmm fails on multi-part messages (path) David J. Biesack

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).