1 |
;;; pop3.el --- Post Office Protocol (RFC 1460) interface |
;;; pop3.el --- Post Office Protocol (RFC 1460) interface |
2 |
|
|
3 |
;; Copyright (C) 1996, 1997, 1998, 1999, 2000 |
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 |
4 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Author: Richard L. Pieri <ratinox@peorth.gweep.net> |
;; Author: Richard L. Pieri <ratinox@peorth.gweep.net> |
244 |
(looking-at "\001\001\001\001\n") ; MMDF |
(looking-at "\001\001\001\001\n") ; MMDF |
245 |
(looking-at "BABYL OPTIONS:") ; Babyl |
(looking-at "BABYL OPTIONS:") ; Babyl |
246 |
)) |
)) |
247 |
(let ((from (mail-strip-quoted-names (mail-fetch-field "From"))) |
(let* ((from (mail-strip-quoted-names (mail-fetch-field "From"))) |
248 |
(date (split-string (or (mail-fetch-field "Date") |
(tdate (mail-fetch-field "Date")) |
249 |
(pop3-make-date)) |
(date (split-string (or (and tdate |
250 |
" ")) |
(not (string= "" tdate)) |
251 |
(From_)) |
tdate) |
252 |
|
(pop3-make-date)) |
253 |
|
" ")) |
254 |
|
(From_)) |
255 |
;; sample date formats I have seen |
;; sample date formats I have seen |
256 |
;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT) |
;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT) |
257 |
;; Date: 08 Jul 1996 23:22:24 -0400 |
;; Date: 08 Jul 1996 23:22:24 -0400 |
258 |
;; should be |
;; should be |
259 |
;; Tue Jul 9 09:04:21 1996 |
;; Tue Jul 9 09:04:21 1996 |
260 |
(setq date |
(setq date |
261 |
(cond ((string-match "[A-Z]" (nth 0 date)) |
(cond ((not date) |
262 |
|
"Tue Jan 1 00:00:0 1900") |
263 |
|
((string-match "[A-Z]" (nth 0 date)) |
264 |
(format "%s %s %s %s %s" |
(format "%s %s %s %s %s" |
265 |
(nth 0 date) (nth 2 date) (nth 1 date) |
(nth 0 date) (nth 2 date) (nth 1 date) |
266 |
(nth 4 date) (nth 3 date))) |
(nth 4 date) (nth 3 date))) |