comparison lisp/gnus/nnmail.el @ 28:1917ad0d78d7 r19-15b97

Import from CVS: tag r19-15b97
author cvs
date Mon, 13 Aug 2007 08:51:55 +0200
parents 441bb1e64a06
children ec9a17fef872
comparison
equal deleted inserted replaced
27:0a3286277d9b 28:1917ad0d78d7
530 (when (and (file-exists-p nnmail-crash-box) 530 (when (and (file-exists-p nnmail-crash-box)
531 (zerop (nnheader-file-size (file-truename nnmail-crash-box)))) 531 (zerop (nnheader-file-size (file-truename nnmail-crash-box))))
532 (delete-file nnmail-crash-box)) 532 (delete-file nnmail-crash-box))
533 (let ((inbox (file-truename (expand-file-name inbox))) 533 (let ((inbox (file-truename (expand-file-name inbox)))
534 (tofile (file-truename (expand-file-name nnmail-crash-box))) 534 (tofile (file-truename (expand-file-name nnmail-crash-box)))
535 movemail popmail errors) 535 movemail popmail errors result)
536 (if (setq popmail (string-match 536 (if (setq popmail (string-match
537 "^po:" (file-name-nondirectory inbox))) 537 "^po:" (file-name-nondirectory inbox)))
538 (setq inbox (file-name-nondirectory inbox)) 538 (setq inbox (file-name-nondirectory inbox))
539 (setq movemail t) 539 (setq movemail t)
540 ;; On some systems, /usr/spool/mail/foo is a directory 540 ;; On some systems, /usr/spool/mail/foo is a directory
580 (setq errors (generate-new-buffer " *nnmail loss*")) 580 (setq errors (generate-new-buffer " *nnmail loss*"))
581 (buffer-disable-undo errors) 581 (buffer-disable-undo errors)
582 (let ((default-directory "/")) 582 (let ((default-directory "/"))
583 (if (nnheader-functionp nnmail-movemail-program) 583 (if (nnheader-functionp nnmail-movemail-program)
584 (funcall nnmail-movemail-program inbox tofile) 584 (funcall nnmail-movemail-program inbox tofile)
585 (apply 585 (setq result
586 'call-process 586 (apply
587 (append 587 'call-process
588 (list 588 (append
589 (expand-file-name 589 (list
590 nnmail-movemail-program exec-directory) 590 (expand-file-name
591 nil errors nil inbox tofile) 591 nnmail-movemail-program exec-directory)
592 (when nnmail-internal-password 592 nil errors nil inbox tofile)
593 (list nnmail-internal-password)))))) 593 (when nnmail-internal-password
594 (if (not (buffer-modified-p errors)) 594 (list nnmail-internal-password)))))))
595 (if (and (not (buffer-modified-p errors))
596 (zerop result))
595 ;; No output => movemail won 597 ;; No output => movemail won
596 (progn 598 (progn
597 (unless popmail 599 (unless popmail
598 (when (file-exists-p tofile) 600 (when (file-exists-p tofile)
599 (set-file-modes tofile nnmail-default-file-modes))) 601 (set-file-modes tofile nnmail-default-file-modes)))
615 (delete-region (point) (point-max)) 617 (delete-region (point) (point-max))
616 (goto-char (point-min)) 618 (goto-char (point-min))
617 (when (looking-at "movemail: ") 619 (when (looking-at "movemail: ")
618 (delete-region (point-min) (match-end 0))) 620 (delete-region (point-min) (match-end 0)))
619 (unless (yes-or-no-p 621 (unless (yes-or-no-p
620 (format "movemail: %s. Continue? " 622 (format "movemail: %s (%d return). Continue? "
621 (buffer-string))) 623 (buffer-string) result))
622 (error "%s" (buffer-string))) 624 (error "%s" (buffer-string)))
623 (setq tofile nil))))))) 625 (setq tofile nil)))))))
624 (message "Getting mail from %s...done" inbox) 626 (message "Getting mail from %s...done" inbox)
625 (and errors 627 (and errors
626 (buffer-name errors) 628 (buffer-name errors)
1571 (apply 'format prompt args) 1573 (apply 'format prompt args)
1572 prompt))) 1574 prompt)))
1573 (unless nnmail-read-passwd 1575 (unless nnmail-read-passwd
1574 (if (load "passwd" t) 1576 (if (load "passwd" t)
1575 (setq nnmail-read-passwd 'read-passwd) 1577 (setq nnmail-read-passwd 'read-passwd)
1576 (autoload 'ange-ftp-read-passwd "ange-ftp") 1578 (unless (fboundp 'ange-ftp-read-passwd)
1579 (autoload 'ange-ftp-read-passwd "ange-ftp"))
1577 (setq nnmail-read-passwd 'ange-ftp-read-passwd))) 1580 (setq nnmail-read-passwd 'ange-ftp-read-passwd)))
1578 (funcall nnmail-read-passwd prompt))) 1581 (funcall nnmail-read-passwd prompt)))
1579 1582
1580 (defun nnmail-check-syntax () 1583 (defun nnmail-check-syntax ()
1581 "Check (and modify) the syntax of the message in the current buffer." 1584 "Check (and modify) the syntax of the message in the current buffer."