1622 |
supplied as a separate argument to `movemail' or nil otherwise, GOT-PASSWORD |
supplied as a separate argument to `movemail' or nil otherwise, GOT-PASSWORD |
1623 |
is non-nil if the user has supplied the password interactively. |
is non-nil if the user has supplied the password interactively. |
1624 |
" |
" |
1625 |
(if (string-match "^\\([^:]+\\)://\\(\\([^:@]+\\)\\(:\\([^@]+\\)\\)?@\\)?.*" file) |
(cond |
1626 |
|
((string-match "^\\([^:]+\\)://\\(\\([^:@]+\\)\\(:\\([^@]+\\)\\)?@\\)?.*" file) |
1627 |
(let (got-password supplied-password |
(let (got-password supplied-password |
1628 |
(proto (match-string 1 file)) |
(proto (match-string 1 file)) |
1629 |
(user (match-string 3 file)) |
(user (match-string 3 file)) |
1630 |
(pass (match-string 5 file)) |
(pass (match-string 5 file)) |
1631 |
(host (substring file (or (match-end 2) |
(host (substring file (or (match-end 2) |
1632 |
(+ 3 (match-end 1)))))) |
(+ 3 (match-end 1)))))) |
1633 |
|
|
1634 |
(if (not pass) |
(if (not pass) |
1635 |
(when rmail-remote-password-required |
(when rmail-remote-password-required |
1636 |
(setq got-password (not (rmail-have-password))) |
(setq got-password (not (rmail-have-password))) |
1647 |
(list file |
(list file |
1648 |
(or (string-equal proto "pop") (string-equal proto "imap")) |
(or (string-equal proto "pop") (string-equal proto "imap")) |
1649 |
supplied-password |
supplied-password |
1650 |
got-password))) |
got-password)))) |
1651 |
(list file nil nil nil))) |
|
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)))) |
1666 |
|
|
1667 |
(defun rmail-insert-inbox-text (files renamep) |
(defun rmail-insert-inbox-text (files renamep) |
1668 |
;; Detect a locked file now, so that we avoid moving mail |
;; Detect a locked file now, so that we avoid moving mail |
1702 |
(expand-file-name buffer-file-name)))) |
(expand-file-name buffer-file-name)))) |
1703 |
;; Always use movemail to rename the file, |
;; Always use movemail to rename the file, |
1704 |
;; since there can be mailboxes in various directories. |
;; since there can be mailboxes in various directories. |
1705 |
(setq movemail t) |
(if (not popmail) |
|
;;; ;; If getting from mail spool directory, |
|
|
;;; ;; use movemail to move rather than just renaming, |
|
|
;;; ;; so as to interlock with the mailer. |
|
|
;;; (setq movemail (string= file |
|
|
;;; (file-truename |
|
|
;;; (concat rmail-spool-directory |
|
|
;;; (file-name-nondirectory file))))) |
|
|
(if (and movemail (not popmail)) |
|
1706 |
(progn |
(progn |
1707 |
;; On some systems, /usr/spool/mail/foo is a directory |
;; On some systems, /usr/spool/mail/foo is a directory |
1708 |
;; and the actual inbox is /usr/spool/mail/foo/foo. |
;; and the actual inbox is /usr/spool/mail/foo/foo. |
1724 |
((or (file-exists-p tofile) (and (not popmail) |
((or (file-exists-p tofile) (and (not popmail) |
1725 |
(not (file-exists-p file)))) |
(not (file-exists-p file)))) |
1726 |
nil) |
nil) |
|
((and (not movemail) (not popmail)) |
|
|
;; Try copying. If that fails (perhaps no space) and |
|
|
;; we're allowed to blow away the inbox, rename instead. |
|
|
(if rmail-preserve-inbox |
|
|
(copy-file file tofile nil) |
|
|
(condition-case nil |
|
|
(copy-file file tofile nil) |
|
|
(error |
|
|
;; Third arg is t so we can replace existing file TOFILE. |
|
|
(rename-file file tofile t)))) |
|
|
;; Make the real inbox file empty. |
|
|
;; Leaving it deleted could cause lossage |
|
|
;; because mailers often won't create the file. |
|
|
(if (not rmail-preserve-inbox) |
|
|
(condition-case () |
|
|
(write-region (point) (point) file) |
|
|
(file-error nil)))) |
|
1727 |
(t |
(t |
1728 |
(with-temp-buffer |
(with-temp-buffer |
1729 |
(let ((errors (current-buffer))) |
(let ((errors (current-buffer))) |