comparison lisp/gnus/pop3.el @ 19969:5f1ab3dd344d

*** empty log message ***
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Wed, 24 Sep 1997 01:50:24 +0000
parents 25317a11d7a1
children 789be3d7ef2d
comparison
equal deleted inserted replaced
19968:88dd57f50303 19969:5f1ab3dd344d
1 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface 1 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface
2 2
3 ;; Copyright (C) 1996, Free Software Foundation, Inc. 3 ;; Copyright (C) 1996,1997 Free Software Foundation, Inc.
4 4
5 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net> 5 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
6 ;; Keywords: mail, pop3 6 ;; Keywords: mail, pop3
7 ;; Version: 1.3e 7 ;; Version: 1.3g
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
35 ;;; Code: 35 ;;; Code:
36 36
37 (require 'mail-utils) 37 (require 'mail-utils)
38 (provide 'pop3) 38 (provide 'pop3)
39 39
40 (defconst pop3-version "1.3c") 40 (defconst pop3-version "1.3g")
41 41
42 (defvar pop3-maildrop (or user-login-name (getenv "LOGNAME") (getenv "USER") nil) 42 (defvar pop3-maildrop (or user-login-name (getenv "LOGNAME") (getenv "USER") nil)
43 "*POP3 maildrop.") 43 "*POP3 maildrop.")
44 (defvar pop3-mailhost (or (getenv "MAILHOST") nil) 44 (defvar pop3-mailhost (or (getenv "MAILHOST") nil)
45 "*POP3 mailhost.") 45 "*POP3 mailhost.")
150 match-end) 150 match-end)
151 (save-excursion 151 (save-excursion
152 (set-buffer (process-buffer process)) 152 (set-buffer (process-buffer process))
153 (goto-char pop3-read-point) 153 (goto-char pop3-read-point)
154 (while (not (search-forward "\r\n" nil t)) 154 (while (not (search-forward "\r\n" nil t))
155 (accept-process-output process) 155 (accept-process-output process 3)
156 (goto-char pop3-read-point)) 156 (goto-char pop3-read-point))
157 (setq match-end (point)) 157 (setq match-end (point))
158 (goto-char pop3-read-point) 158 (goto-char pop3-read-point)
159 (if (looking-at "-ERR") 159 (if (looking-at "-ERR")
160 (error (buffer-substring (point) (- match-end 2))) 160 (error (buffer-substring (point) (- match-end 2)))
203 (forward-char))) 203 (forward-char)))
204 (set-marker end nil)) 204 (set-marker end nil))
205 205
206 (defun pop3-munge-message-separator (start end) 206 (defun pop3-munge-message-separator (start end)
207 "Check to see if a message separator exists. If not, generate one." 207 "Check to see if a message separator exists. If not, generate one."
208 (if (not (fboundp 'message-make-date)) (autoload 'message-make-date "message"))
208 (save-excursion 209 (save-excursion
209 (save-restriction 210 (save-restriction
210 (narrow-to-region start end) 211 (narrow-to-region start end)
211 (goto-char (point-min)) 212 (goto-char (point-min))
212 (if (not (or (looking-at "From .?") ; Unix mail 213 (if (not (or (looking-at "From .?") ; Unix mail
213 (looking-at "\001\001\001\001\n") ; MMDF 214 (looking-at "\001\001\001\001\n") ; MMDF
214 (looking-at "BABYL OPTIONS:") ; Babyl 215 (looking-at "BABYL OPTIONS:") ; Babyl
215 )) 216 ))
216 (let ((from (mail-strip-quoted-names (mail-fetch-field "From"))) 217 (let ((from (mail-strip-quoted-names (mail-fetch-field "From")))
217 (date (pop3-string-to-list (mail-fetch-field "Date"))) 218 (date (pop3-string-to-list (or (mail-fetch-field "Date")
219 (message-make-date))))
218 (From_)) 220 (From_))
219 ;; sample date formats I have seen 221 ;; sample date formats I have seen
220 ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT) 222 ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT)
221 ;; Date: 08 Jul 1996 23:22:24 -0400 223 ;; Date: 08 Jul 1996 23:22:24 -0400
222 ;; should be 224 ;; should be
313 (pop3-read-response process) 315 (pop3-read-response process)
314 (let ((start pop3-read-point) end) 316 (let ((start pop3-read-point) end)
315 (save-excursion 317 (save-excursion
316 (set-buffer (process-buffer process)) 318 (set-buffer (process-buffer process))
317 (while (not (re-search-forward "^\\.\r\n" nil t)) 319 (while (not (re-search-forward "^\\.\r\n" nil t))
318 (accept-process-output process) 320 (accept-process-output process 3)
319 ;; bill@att.com ... to save wear and tear on the heap 321 ;; bill@att.com ... to save wear and tear on the heap
320 (if (> (buffer-size) 20000) (sleep-for 1)) 322 (if (> (buffer-size) 20000) (sleep-for 1))
321 (if (> (buffer-size) 50000) (sleep-for 1)) 323 (if (> (buffer-size) 50000) (sleep-for 1))
322 (if (> (buffer-size) 100000) (sleep-for 1)) 324 (if (> (buffer-size) 100000) (sleep-for 1))
323 (if (> (buffer-size) 200000) (sleep-for 1)) 325 (if (> (buffer-size) 200000) (sleep-for 1))