Mercurial > emacs
comparison lisp/mail/rmail.el @ 24220:33f8216be2f1
(rmail-insert-inbox-text): Handle POP mailboxes
where the userid contains directory separators.
author | Andrew Innes <andrewi@gnu.org> |
---|---|
date | Fri, 29 Jan 1999 18:13:30 +0000 |
parents | d0853770c8e7 |
children | 1100d4e5201b |
comparison
equal
deleted
inserted
replaced
24219:0bb9e5990c22 | 24220:33f8216be2f1 |
---|---|
1303 (or (memq (file-locked-p buffer-file-name) '(nil t)) | 1303 (or (memq (file-locked-p buffer-file-name) '(nil t)) |
1304 (error "RMAIL file %s is locked" | 1304 (error "RMAIL file %s is locked" |
1305 (file-name-nondirectory buffer-file-name))) | 1305 (file-name-nondirectory buffer-file-name))) |
1306 (let (file tofile delete-files movemail popmail got-password password) | 1306 (let (file tofile delete-files movemail popmail got-password password) |
1307 (while files | 1307 (while files |
1308 (setq file (file-truename | 1308 ;; Handle POP mailbox names specially; don't expand as filenames |
1309 (expand-file-name (substitute-in-file-name (car files)))) | 1309 ;; in case the userid contains a directory separator. |
1310 tofile (expand-file-name | 1310 (setq file (car files)) |
1311 (setq popmail (string-match "^po:" file)) | |
1312 (if popmail | |
1313 (setq renamep t) | |
1314 (setq file (file-truename | |
1315 (expand-file-name (substitute-in-file-name file))))) | |
1316 (setq tofile (expand-file-name | |
1311 ;; Generate name to move to from inbox name, | 1317 ;; Generate name to move to from inbox name, |
1312 ;; in case of multiple inboxes that need moving. | 1318 ;; in case of multiple inboxes that need moving. |
1313 (concat ".newmail-" (file-name-nondirectory file)) | 1319 (concat ".newmail-" (file-name-nondirectory file)) |
1314 ;; Use the directory of this rmail file | 1320 ;; Use the directory of this rmail file |
1315 ;; because it's a nuisance to use the homedir | 1321 ;; because it's a nuisance to use the homedir |
1325 ;;; ;; so as to interlock with the mailer. | 1331 ;;; ;; so as to interlock with the mailer. |
1326 ;;; (setq movemail (string= file | 1332 ;;; (setq movemail (string= file |
1327 ;;; (file-truename | 1333 ;;; (file-truename |
1328 ;;; (concat rmail-spool-directory | 1334 ;;; (concat rmail-spool-directory |
1329 ;;; (file-name-nondirectory file))))) | 1335 ;;; (file-name-nondirectory file))))) |
1330 (setq popmail (string-match "^po:" (file-name-nondirectory file))) | 1336 (if (and movemail (not popmail)) |
1331 (if popmail (setq file (file-name-nondirectory file) | |
1332 renamep t)) | |
1333 (if movemail | |
1334 (progn | 1337 (progn |
1335 ;; On some systems, /usr/spool/mail/foo is a directory | 1338 ;; On some systems, /usr/spool/mail/foo is a directory |
1336 ;; and the actual inbox is /usr/spool/mail/foo/foo. | 1339 ;; and the actual inbox is /usr/spool/mail/foo/foo. |
1337 (if (file-directory-p file) | 1340 (if (file-directory-p file) |
1338 (setq file (expand-file-name (user-login-name) | 1341 (setq file (expand-file-name (user-login-name) |
1343 (setq password (rmail-get-pop-password)))) | 1346 (setq password (rmail-get-pop-password)))) |
1344 (if (eq system-type 'windows-nt) | 1347 (if (eq system-type 'windows-nt) |
1345 ;; cannot have "po:" in file name | 1348 ;; cannot have "po:" in file name |
1346 (setq tofile | 1349 (setq tofile |
1347 (expand-file-name | 1350 (expand-file-name |
1348 (concat ".newmail-pop-" (substring file (+ popmail 3))) | 1351 (concat ".newmail-pop-" |
1352 (file-name-nondirectory (substring file 3))) | |
1349 (file-name-directory | 1353 (file-name-directory |
1350 (expand-file-name buffer-file-name))))) | 1354 (expand-file-name buffer-file-name))))) |
1351 (message "Getting mail from post office ...")) | 1355 (message "Getting mail from post office ...")) |
1352 ((and (file-exists-p tofile) | 1356 ((and (file-exists-p tofile) |
1353 (/= 0 (nth 7 (file-attributes tofile)))) | 1357 (/= 0 (nth 7 (file-attributes tofile)))) |