+ (mm-url-insert (concat (car webmail-open-url) attachment))
+ (push (current-buffer) webmail-buffer-list)
+ (setq bufname (buffer-name)))
+ (insert "<#part type=" type)
+ (insert " buffer=\"" bufname "\"")
+ (insert " disposition=\"inline\"")
+ (insert "><#/part>\n")
+ (setq p (point))))
+ (delete-region p p1)
+ (narrow-to-region
+ p
+ (if (search-forward
+ "<TABLE border=\"0\" WIDTH=\"98%\" cellpadding=0 cellspacing=0>"
+ nil t)
+ (match-beginning 0)
+ (point-max)))
+ (webmail-netaddress-single-part)
+ (goto-char (point-max))
+ (setq p (point))
+ (widen)))
+ (unless mime
+ (narrow-to-region p (point-max))
+ (setq mime (webmail-netaddress-single-part))
+ (widen))
+ (goto-char (point-min))
+ ;; Some blank line to separate mails.
+ (insert "\n\nFrom nobody " (current-time-string) "\n")
+ (insert "X-Gnus-Webmail: " (symbol-value 'user)
+ "@" (symbol-name webmail-type) "\n")
+ (if id
+ (insert (format "X-Message-ID: <%s@%s>\n" id webmail-address)))
+ (unless (looking-at "$")
+ (if (search-forward "\n\n" nil t)
+ (forward-line -1)
+ (webmail-error "article@2")))
+ (when mime
+ (narrow-to-region (point-min) (point))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (if (looking-at "MIME-Version\\|Content-Type")
+ (delete-region (point)
+ (progn
+ (forward-line 1)
+ (if (re-search-forward "^[^ \t]" nil t)
+ (goto-char (match-beginning 0))
+ (point-max))))
+ (forward-line 1)))
+ (goto-char (point-max))
+ (widen)
+ (narrow-to-region (point) (point-max))
+ (insert "MIME-Version: 1.0\n"
+ (prog1
+ (mml-generate-mime)
+ (delete-region (point-min) (point-max))))
+ (goto-char (point-min))
+ (widen))
+ (let (case-fold-search)
+ (while (re-search-forward "^From " nil t)
+ (beginning-of-line)
+ (insert ">"))))
+ (mm-append-to-file (point-min) (point-max) file)))
+
+(defun webmail-netscape-article (file id)
+ (let (p p1 attachment count mime type)
+ (save-restriction
+ (webmail-encode-8bit)
+ (goto-char (point-min))
+ (if (not (search-forward "Trash" nil t))
+ (webmail-error "article@1"))
+ (if (not (search-forward "<form>" nil t))
+ (webmail-error "article@2"))
+ (delete-region (point-min) (match-beginning 0))
+ (if (not (search-forward "</form>" nil t))
+ (webmail-error "article@3"))
+ (narrow-to-region (point-min) (match-end 0))
+ (goto-char (point-min))
+ (while (re-search-forward "[\040\t\r\n]+" nil t)
+ (replace-match " "))
+ (goto-char (point-min))
+ (while (re-search-forward "<a href=[^>]*>[^<]*</a>" nil t)
+ (replace-match ""))
+ (goto-char (point-min))
+ (while (search-forward "<b>" nil t)
+ (replace-match "\n"))
+ (mm-url-remove-markup)
+ (mm-url-decode-entities-nbsp)
+ (goto-char (point-min))
+ (delete-blank-lines)
+ (goto-char (point-min))
+ (while (re-search-forward "^\040+\\|\040+$" nil t)
+ (replace-match ""))
+ (goto-char (point-min))
+ (while (re-search-forward "\040+" nil t)
+ (replace-match " "))
+ (goto-char (point-max))
+ (widen)
+ (insert "\n\n")
+ (setq p (point))
+ (unless (search-forward "<!-- Data -->" nil t)
+ (webmail-error "article@4"))
+ (forward-line 14)
+ (delete-region p (point))
+ (goto-char (point-max))
+ (unless (re-search-backward
+ "<form name=\"Transfer2\"" p t)
+ (webmail-error "article@5"))
+ (delete-region (point) (point-max))
+ (goto-char p)
+ (while (search-forward
+ "<TABLE border=\"0\" WIDTH=\"98%\" cellpadding=0 cellspacing=0>"
+ nil t 2)
+ (setq mime t)
+ (unless (search-forward "</TABLE>" nil t)
+ (webmail-error "article@6"))
+ (setq p1 (point))
+ (if (search-backward "<IMG " p t)
+ (progn
+ (unless (re-search-forward "HREF=\"\\(/tpl/Attachment/[^/]+/\\([^/]+/[^\?]+\\)[^\"]+\\)\"" p1 t)
+ (webmail-error "article@7"))
+ (setq attachment (match-string 1))
+ (setq type (match-string 2))
+ (unless (search-forward "</TABLE>" nil t)
+ (webmail-error "article@8"))
+ (delete-region p (point))
+ (let (bufname);; Attachment
+ (save-excursion
+ (set-buffer (generate-new-buffer " *webmail-att*"))
+ (mm-url-insert (concat (car webmail-open-url) attachment))