;; Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-;; Free Software Foundation, Inc.
+; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
(declare-function mail-position-on-field "sendmail" (field &optional soft))
(declare-function mail-text-start "sendmail" ())
(declare-function pmail-update-summary "pmailsum" (&rest ignore))
+(declare-function unrmail "unrmail" (file to-file))
+(declare-function rmail-dont-reply-to "mail-utils" (destinations))
+(declare-function pmail-summary-goto-msg "pmailsum" (&optional n nowarn skip-pmail))
+(declare-function pmail-summary-pmail-update "pmailsum" ())
+(declare-function pmail-summary-update "pmailsum" (n))
(defun pmail-probe (prog)
"Determine what flavor of movemail PROG is.
;;;###autoload
(defcustom pmail-ignored-headers
(concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:"
- "\\|^status:\\|^received:\\|^content-transfer-encoding:"
- "\\|^x400-\\(received\\|mts-identifier\\|content-type\\|originator\\|recipients\\):"
- "\\|^list-\\(help\\|post\\|subscribe\\|id\\|unsubscribe\\|archive\\):"
- "\\|^resent-\\(face\\|x-.*\\|organization\\|openpgp\\|date\\|message-id\\):"
- "\\|^thread-\\(topic\\|index\\)"
- "\\|^summary-line:\\|^precedence:\\|^message-id:"
- "\\|^path:\\|^face:\\|^delivered-to:\\|^lines:"
- "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:"
- "\\|^content-\\(length\\|type\\|class\\|disposition\\):"
+ "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:"
+ "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:"
+ "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:"
"\\|^nntp-posting-host:\\|^path:\\|^x-char.*:\\|^x-face:\\|^face:"
+ "\\|^x-mailer:\\|^delivered-to:\\|^lines:"
+ "\\|^content-transfer-encoding:\\|^x-coding-system:"
+ "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:"
+ "\\|^precedence:\\|^list-help:\\|^list-post:\\|^list-subscribe:"
+ "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:"
+ "\\|^content-length:\\|^nntp-posting-date:\\|^user-agent"
"\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:"
- "\\|^mbox-line:\\|^cancel-lock:\\|^in-reply-to:\\|^comment:"
- "\\|^x-.*:\\|^domainkey-signature:"
- "\\|^original-recipient:\\|^from ")
+ "\\|^mbox-line:\\|^cancel-lock:\\|^DomainKey-Signature:"
+ "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:"
+ "\\|^x-.*:\\|^domainkey-signature:\\|^original-recipient:\\|^from ")
"*Regexp to match header fields that Pmail should normally hide.
\(See also `pmail-nonignored-headers', which overrides this regexp.)
This variable is used for reformatting the message header,
(unwind-protect
(progn
(write-region (point-min) (point-max) old-file)
- (unpmail old-file new-file)
+ (unrmail old-file new-file)
(message "Replacing BABYL format with mbox format...")
(let ((inhibit-read-only t))
(erase-buffer)
(or pass supplied-password)
got-password)
(error "Emacs movemail does not support %s protocol" proto))
- (list file
+ (list (concat proto "://" user "@" host)
(or (string-equal proto "pop") (string-equal proto "imap"))
- supplied-password
+ (or supplied-password pass)
got-password))))
((string-match "^po:\\([^:]+\\)\\(:\\(.*\\)\\)?" file)
;; in case of multiple inboxes that need moving.
(concat ".newmail-"
(file-name-nondirectory
- (if (memq system-type '(windows-nt cygwin))
- ;; cannot have "po:" in file name
- (substring file 3)
+ (if (memq system-type '(windows-nt cygwin ms-dos))
+ ;; cannot have colons in file name
+ (replace-regexp-in-string ":" "-" file)
file)))
;; Use the directory of this pmail file
;; because it's a nuisance to use the homedir
(buffer-disable-undo errors)
(let ((args
(append
- (list pmail-movemail-program nil errors nil)
+ (list (or pmail-movemail-program "movemail") nil errors nil)
(if pmail-preserve-inbox
(list "-p")
nil)
;; Remove unwanted names from reply-to, since Mail-Followup-To
;; header causes all the names in it to wind up in reply-to, not
;; in cc. But if what's left is an empty list, use the original.
- (let* ((reply-to-list (pmail-dont-reply-to reply-to)))
+ (let* ((reply-to-list (rmail-dont-reply-to reply-to)))
(if (string= reply-to-list "") reply-to reply-to-list))
subject
(pmail-make-in-reply-to-field from date message-id)
(if just-sender
nil
;; mail-strip-quoted-names is NOT necessary for
- ;; pmail-dont-reply-to to do its job.
- (let* ((cc-list (pmail-dont-reply-to
+ ;; rmail-dont-reply-to to do its job.
+ (let* ((cc-list (rmail-dont-reply-to
(mail-strip-quoted-names
(if (null cc) to (concat to ", " cc))))))
(if (string= cc-list "") nil cc-list)))
;; Now start sending new message; default header fields from original.
;; Turn off the usual actions for initializing the message body
;; because we want to get only the text from the failure message.
- ;;
- ;; NOTE: the use of pmail-msgref-vector is a red flag. I'm not
- ;; sure (yet) what the right thing to do here is but I strongly
- ;; suspect it needs something along the lines of:
- ;; ...(pmail-desc-set-attribute pmail-desc-resent-index nil n)...
- ;; The test to run to see the breakage and figure out what needs
- ;; to be done is to cause a "resend" to happen and verify that it
- ;; is either broken or works properly. For now the unbound
- ;; variable is being left intact. -pmr 8/12/2008
(let (mail-signature mail-setup-hook)
(if (pmail-start-mail nil nil nil nil nil pmail-this-buffer
(list (list 'pmail-mark-message
pmail-this-buffer
- (aref pmail-msgref-vector msgnum)
+ (with-current-buffer pmail-buffer
+ (pmail-desc-get-start msgnum))
"retried")))
;; Insert original text as initial text of new draft message.
;; Bind inhibit-read-only since the header delimiter
;; completion. It is better to use strings with the label functions
;; and let them worry about making the label.
-(provide 'pmailkwd)
-
(eval-when-compile
(require 'mail-utils))
"Keywords used to label messages.
These are all user-defined, unlike `pmail-attributes'.")
\f
+
+;; External library declarations.
+(declare-function mail-comma-list-regexp "mail-utils" (labels))
+(declare-function mail-parse-comma-list "mail-utils" ())
+(declare-function pmail-desc-add-keyword "pmaildesc" (keyword n))
+(declare-function pmail-desc-get-end "pmaildesc" (n))
+(declare-function pmail-desc-get-keywords "pmaildesc" (n))
+(declare-function pmail-desc-get-start "pmaildesc" (n))
+(declare-function pmail-desc-remove-keyword "pmaildesc" (keyword n))
+(declare-function pmail-display-labels "pmail" ())
+(declare-function pmail-maybe-set-message-counters "pmail" ())
+(declare-function pmail-message-labels-p "pmail" (msg labels))
+(declare-function pmail-msgbeg "pmail" (n))
+(declare-function pmail-set-attribute "pmail" (attr state &optional msgnum))
+(declare-function pmail-set-message-deleted-p "pmail" (n state))
+(declare-function pmail-show-message "pmail" (&optional n no-summary))
+(declare-function pmail-summary-exists "pmail" ())
+(declare-function pmail-summary-update "pmailsum" (n))
+
;;;; Low-level functions.
(defun pmail-attribute-p (s)
;; return the string, not the symbol
result)))
-(declare-function pmail-maybe-set-message-counters "pmail" ())
-(declare-function pmail-display-labels "pmail" ())
-(declare-function pmail-msgbeg "pmail" (n))
-(declare-function pmail-set-message-deleted-p "pmail" (n state))
-(declare-function pmail-message-labels-p "pmail" (msg labels))
-(declare-function pmail-show-message "pmail" (&optional n no-summary))
-(declare-function mail-comma-list-regexp "mail-utils" (labels))
-(declare-function mail-parse-comma-list "mail-utils.el" ())
-
(defun pmail-set-label (l state &optional n)
"Add or remove label L in message N.
The label L is added when STATE is non-nil, otherwise it is
(pmail-desc-remove-keyword str n))))))
(pmail-display-labels)
;; Deal with the summary buffer.
- (when pmail-summary-buffer
+ (when (pmail-summary-exists)
(pmail-summary-update n)))
\f
;; Motion on messages with keywords.
(when (> n 0)
(message "No following message with labels %s" labels)))))
+(provide 'pmailkwd)
+
;; arch-tag: 1149979c-8e47-4333-9629-cf3dc887a6a7
;;; pmailkwd.el ends here
;;; Code:
+;; For ...
+(require 'pmail)
+
;;; Variables
(defcustom pmail-mime-media-type-handlers-alist
;; of the preceding part.
;; We currently don't handle that.
(let ((boundary (cdr (assq 'boundary content-type)))
- beg next)
+ beg end next)
(unless boundary
- (error "No boundary defined" content-type content-disposition
- content-transfer-encoding))
+ (pmail-mm-get-boundary-error-message
+ "No boundary defined" content-type content-disposition
+ content-transfer-encoding))
(setq boundary (concat "\n--" boundary))
;; Hide the body before the first bodypart
(goto-char (point-min))
((looking-at "[ \t]*\n")
(setq next (copy-marker (match-end 0))))
(t
- (error "Malformed boundary" content-type
- content-disposition content-transfer-encoding)))
+ (pmail-mm-get-boundary-error-message
+ "Malformed boundary" content-type content-disposition
+ content-transfer-encoding)))
(delete-region end next)
;; Handle the part.
(save-match-data
(pmail-mime-show t))
(view-buffer buf)))
+(defun pmail-mm-get-boundary-error-message (message type disposition encoding)
+ "Return MESSAGE with more information on the main mime components."
+ (error "%s; type: %s; disposition: %s; encoding: %s"
+ message type disposition encoding))
+
(provide 'pmailmm)
;; arch-tag: 3f2c5e5d-1aef-4512-bc20-fd737c9d5dd9