aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2005-04-02 11:32:18 +0000
committerEli Zaretskii2005-04-02 11:32:18 +0000
commit2f2e23735660707d2fae26b2c596ebe1c45b69b8 (patch)
tree2401286683a26b5bd6bfeb76564bf189d302dfdd
parent07778743cf6c70fbef3699fb62768822cd4cf881 (diff)
downloademacs-2f2e23735660707d2fae26b2c596ebe1c45b69b8.tar.gz
emacs-2f2e23735660707d2fae26b2c596ebe1c45b69b8.zip
(rmail-parse-url): Bugfix. Parse traditional mailbox specifications
as well as URLs. (rmail-insert-inbox-text): Remove unused conditional branches.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/mail/rmail.el49
2 files changed, 26 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7836779618d..feb47979405 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12005-04-02 Sergey Poznyakoff <gray@Mirddin.farlep.net> (tiny change)
2
3 * mail/rmail.el (rmail-parse-url): Bugfix. Parse traditional
4 mailbox specifications as well as URLs.
5 (rmail-insert-inbox-text): Remove unused conditional branches.
6
12005-04-01 Jay Belanger <belanger@truman.edu> 72005-04-01 Jay Belanger <belanger@truman.edu>
2 8
3 * calc/calc-graph.el (calc-gnuplot-name, calc-gnuplot-plot-command) 9 * calc/calc-graph.el (calc-gnuplot-name, calc-gnuplot-plot-command)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 559963589a1..de88b37d91e 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1622,13 +1622,15 @@ a remote mailbox, PASSWORD is the password if it should be
1622supplied as a separate argument to `movemail' or nil otherwise, GOT-PASSWORD 1622supplied as a separate argument to `movemail' or nil otherwise, GOT-PASSWORD
1623is non-nil if the user has supplied the password interactively. 1623is non-nil if the user has supplied the password interactively.
1624" 1624"
1625 (if (string-match "^\\([^:]+\\)://\\(\\([^:@]+\\)\\(:\\([^@]+\\)\\)?@\\)?.*" file) 1625 (cond
1626 ((string-match "^\\([^:]+\\)://\\(\\([^:@]+\\)\\(:\\([^@]+\\)\\)?@\\)?.*" file)
1626 (let (got-password supplied-password 1627 (let (got-password supplied-password
1627 (proto (match-string 1 file)) 1628 (proto (match-string 1 file))
1628 (user (match-string 3 file)) 1629 (user (match-string 3 file))
1629 (pass (match-string 5 file)) 1630 (pass (match-string 5 file))
1630 (host (substring file (or (match-end 2) 1631 (host (substring file (or (match-end 2)
1631 (+ 3 (match-end 1)))))) 1632 (+ 3 (match-end 1))))))
1633
1632 (if (not pass) 1634 (if (not pass)
1633 (when rmail-remote-password-required 1635 (when rmail-remote-password-required
1634 (setq got-password (not (rmail-have-password))) 1636 (setq got-password (not (rmail-have-password)))
@@ -1645,8 +1647,22 @@ is non-nil if the user has supplied the password interactively.
1645 (list file 1647 (list file
1646 (or (string-equal proto "pop") (string-equal proto "imap")) 1648 (or (string-equal proto "pop") (string-equal proto "imap"))
1647 supplied-password 1649 supplied-password
1648 got-password))) 1650 got-password))))
1649 (list file nil nil nil))) 1651
1652 ((string-match "^po:\\([^:]+\\)\\(:\\(.*\\)\\)?" file)
1653 (let (got-password supplied-password
1654 (proto "pop")
1655 (user (match-string 1 file))
1656 (host (match-string 3 file)))
1657
1658 (when rmail-remote-password-required
1659 (setq got-password (not (rmail-have-password)))
1660 (setq supplied-password (rmail-get-remote-password nil)))
1661
1662 (list file "pop" supplied-password got-password)))
1663
1664 (t
1665 (list file nil nil nil))))
1650 1666
1651(defun rmail-insert-inbox-text (files renamep) 1667(defun rmail-insert-inbox-text (files renamep)
1652 ;; Detect a locked file now, so that we avoid moving mail 1668 ;; Detect a locked file now, so that we avoid moving mail
@@ -1686,15 +1702,7 @@ is non-nil if the user has supplied the password interactively.
1686 (expand-file-name buffer-file-name)))) 1702 (expand-file-name buffer-file-name))))
1687 ;; Always use movemail to rename the file, 1703 ;; Always use movemail to rename the file,
1688 ;; since there can be mailboxes in various directories. 1704 ;; since there can be mailboxes in various directories.
1689 (setq movemail t) 1705 (if (not popmail)
1690;;; ;; If getting from mail spool directory,
1691;;; ;; use movemail to move rather than just renaming,
1692;;; ;; so as to interlock with the mailer.
1693;;; (setq movemail (string= file
1694;;; (file-truename
1695;;; (concat rmail-spool-directory
1696;;; (file-name-nondirectory file)))))
1697 (if (and movemail (not popmail))
1698 (progn 1706 (progn
1699 ;; On some systems, /usr/spool/mail/foo is a directory 1707 ;; On some systems, /usr/spool/mail/foo is a directory
1700 ;; and the actual inbox is /usr/spool/mail/foo/foo. 1708 ;; and the actual inbox is /usr/spool/mail/foo/foo.
@@ -1716,23 +1724,6 @@ is non-nil if the user has supplied the password interactively.
1716 ((or (file-exists-p tofile) (and (not popmail) 1724 ((or (file-exists-p tofile) (and (not popmail)
1717 (not (file-exists-p file)))) 1725 (not (file-exists-p file))))
1718 nil) 1726 nil)
1719 ((and (not movemail) (not popmail))
1720 ;; Try copying. If that fails (perhaps no space) and
1721 ;; we're allowed to blow away the inbox, rename instead.
1722 (if rmail-preserve-inbox
1723 (copy-file file tofile nil)
1724 (condition-case nil
1725 (copy-file file tofile nil)
1726 (error
1727 ;; Third arg is t so we can replace existing file TOFILE.
1728 (rename-file file tofile t))))
1729 ;; Make the real inbox file empty.
1730 ;; Leaving it deleted could cause lossage
1731 ;; because mailers often won't create the file.
1732 (if (not rmail-preserve-inbox)
1733 (condition-case ()
1734 (write-region (point) (point) file)
1735 (file-error nil))))
1736 (t 1727 (t
1737 (with-temp-buffer 1728 (with-temp-buffer
1738 (let ((errors (current-buffer))) 1729 (let ((errors (current-buffer)))