annotate lisp/gnus/pop3.el @ 111346:2d0c056a50d8

Fix unified mouse highlight after compiling on Unix. xdisp.c (x_consider_frame_title, tool_bar_lines_needed): Move prototypes to HAVE_WINDOW_SYSTEM-only part. frame.h (MOUSE_HL_INFO): Fix definition to work both for TTY-only and GUI builds.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 05 Nov 2010 20:07:42 +0200
parents ed9ff0bf7851
children 141d3f14d8c3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2
64754
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64085
diff changeset
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 100993
diff changeset
4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
26108
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
7 ;; Maintainer: FSF
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
8 ;; Keywords: mail
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; (at your option) any later version.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
21
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25 ;;; Commentary:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27 ;; Most of the standard Post Office Protocol version 3 (RFC 1460) commands
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
28 ;; are implemented. The LIST command has not been implemented due to lack
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
29 ;; of actual usefulness.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
30 ;; The optional POP3 command TOP has not been implemented.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
31
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
32 ;; This program was inspired by Kyle E. Jones's vm-pop program.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
33
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
34 ;;; Code:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
35
110224
3d216398af49 pop3.el (pop3-number-of-responses): Search for "+OK", not "+OK ".
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110210
diff changeset
36 (eval-when-compile (require 'cl))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
37 (require 'mail-utils)
86154
1cdfc94602cb * smime.el (from):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 85712
diff changeset
38 (defvar parse-time-months)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
39
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
40 (defgroup pop3 nil
63983
23c6b2acce05 (pop3): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 63495
diff changeset
41 "Post Office Protocol."
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
42 :group 'mail
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
43 :group 'mail-source)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
44
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
45 (defcustom pop3-maildrop (or (user-login-name)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
46 (getenv "LOGNAME")
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
47 (getenv "USER"))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
48 "*POP3 maildrop."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 58835
diff changeset
49 :version "22.1" ;; Oort Gnus
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
50 :type 'string
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
51 :group 'pop3)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
52
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
53 (defcustom pop3-mailhost (or (getenv "MAILHOST") ;; nil -> mismatch
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
54 "pop3")
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
55 "*POP3 mailhost."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 58835
diff changeset
56 :version "22.1" ;; Oort Gnus
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
57 :type 'string
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
58 :group 'pop3)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
59
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
60 (defcustom pop3-port 110
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
61 "*POP3 port."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 58835
diff changeset
62 :version "22.1" ;; Oort Gnus
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
63 :type 'number
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
64 :group 'pop3)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
65
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
66 (defcustom pop3-password-required t
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
67 "*Non-nil if a password is required when connecting to POP server."
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 58835
diff changeset
68 :version "22.1" ;; Oort Gnus
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
69 :type 'boolean
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
70 :group 'pop3)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
71
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
72 ;; Should this be customizable?
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 (defvar pop3-password nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74 "*Password to use when connecting to POP server.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
75
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
76 (defcustom pop3-authentication-scheme 'pass
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77 "*POP3 authentication scheme.
73269
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
78 Defaults to `pass', for the standard USER/PASS authentication. The other
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
79 valid value is 'apop'."
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
80 :type '(choice (const :tag "Normal user/password" pass)
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
81 (const :tag "APOP" apop))
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 58835
diff changeset
82 :version "22.1" ;; Oort Gnus
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
83 :group 'pop3)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84
110661
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
85 (defcustom pop3-stream-length 100
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
86 "How many messages should be requested at one time.
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
87 The lower the number, the more latency-sensitive the fetching
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
88 will be. If your pop3 server doesn't support streaming at all,
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
89 set this to 1."
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
90 :type 'number
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
91 :version "24.1"
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
92 :group 'pop3)
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
93
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
94 (defcustom pop3-leave-mail-on-server nil
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57442
diff changeset
95 "*Non-nil if the mail is to be left on the POP server after fetching.
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57442
diff changeset
96
73269
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
97 If `pop3-leave-mail-on-server' is non-nil the mail is to be left
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
98 on the POP server after fetching. Note that POP servers maintain
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
99 no state information between sessions, so what the client
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
100 believes is there and what is actually there may not match up.
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
101 If they do not, then you may get duplicate mails or the whole
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
102 thing can fall apart and leave you with a corrupt mailbox."
72810
709ee6c1e02a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
103 ;; We can't use the UILD support from XEmacs mail-lib or cvs.m17n.org:
709ee6c1e02a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
104 ;; http://thread.gmane.org/v9lld8fml4.fsf@marauder.physik.uni-ulm.de
709ee6c1e02a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
105 ;; http://thread.gmane.org/b9yy8hzy9ej.fsf@jpl.org
709ee6c1e02a Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
106 ;; Any volunteer to re-implement this?
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 58835
diff changeset
107 :version "22.1" ;; Oort Gnus
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
108 :type 'boolean
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
109 :group 'pop3)
51546
a5038d551293 (pop3-leave-mail-on-server): New user variable.
Sam Steingold <sds@gnu.org>
parents: 44544
diff changeset
110
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
111 (defvar pop3-timestamp nil
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112 "Timestamp returned when initially connected to the POP server.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113 Used for APOP authentication.")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115 (defvar pop3-read-point nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 (defvar pop3-debug nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
117
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
118 ;; Borrowed from nnheader-accept-process-output in nnheader.el. See the
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
119 ;; comments there for explanations about the values.
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
120
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
121 (eval-and-compile
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
122 (if (and (fboundp 'nnheader-accept-process-output)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
123 (boundp 'nnheader-read-timeout))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
124 (defalias 'pop3-accept-process-output 'nnheader-accept-process-output)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
125 ;; Borrowed from `nnheader.el':
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
126 (defvar pop3-read-timeout
110039
459fd421257a gnus-group-completing-read: Add 'substring to completion-styles for group selection; imap.el, mailcap.el, message.el, mm-util.el, nnheader.el, nnmail.el, pop3.el: Remove references to outdated systems; References to win32 w32 mswindows ms-windows emx were probably cargo-culted, and are removed for clarity; By Lars Magne Ingebrigtsen <larsi@gnus.org>.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 107473
diff changeset
127 (if (string-match "windows-nt\\|os/2\\|cygwin"
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
128 (symbol-name system-type))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
129 1.0
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
130 0.01)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
131 "How long pop3 should wait between checking for the end of output.
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57442
diff changeset
132 Shorter values mean quicker response, but are more CPU intensive.")
100993
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
133 (defun pop3-accept-process-output (process)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
134 (accept-process-output
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
135 process
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
136 (truncate pop3-read-timeout)
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
137 (truncate (* (- pop3-read-timeout
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
138 (truncate pop3-read-timeout))
a16e9f7c2536 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 100908
diff changeset
139 1000))))))
95491
32ac518a1ca9 (nnheader-accept-process-output): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 95193
diff changeset
140
110296
ef15e8533a1c Remove pop3-movemail and rename pop3-streaming-movemail to pop3-movemail.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110224
diff changeset
141 ;;;###autoload
ef15e8533a1c Remove pop3-movemail and rename pop3-streaming-movemail to pop3-movemail.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110224
diff changeset
142 (defun pop3-movemail (file)
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
143 "Transfer contents of a maildrop to the specified FILE.
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
144 Use streaming commands."
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
145 (let* ((process (pop3-open-server pop3-mailhost pop3-port))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
146 message-count message-total-size)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
147 (pop3-logon process)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
148 (with-current-buffer (process-buffer process)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
149 (let ((size (pop3-stat process)))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
150 (setq message-count (car size)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
151 message-total-size (cadr size)))
110740
ed9ff0bf7851 Avoid using plusp; cl may not be loaded.
Chong Yidong <cyd@stupidchicken.com>
parents: 110661
diff changeset
152 (when (> message-count 0)
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
153 (pop3-send-streaming-command
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
154 process "RETR" message-count message-total-size)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
155 (pop3-write-to-file file)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
156 (unless pop3-leave-mail-on-server
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
157 (pop3-send-streaming-command
110196
fcc33f6790e5 pop3.el (pop3-streaming-movemail): Always close the pop3 connection.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110195
diff changeset
158 process "DELE" message-count nil))))
110210
3d982e5c5f58 pop3.el (pop3-streaming-movemail): Return t for success; imap.el (imap-log): New convenience function used throughout instead of repeating the same code all over the place.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110201
diff changeset
159 (pop3-quit process)
3d982e5c5f58 pop3.el (pop3-streaming-movemail): Return t for success; imap.el (imap-log): New convenience function used throughout instead of repeating the same code all over the place.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110201
diff changeset
160 t))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
161
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
162 (defun pop3-send-streaming-command (process command count total-size)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
163 (erase-buffer)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
164 (let ((i 1))
110197
727cc5d69397 pop3.el (pop3-write-to-file): Don't output messages when saving; mail-source.el (mail-source-delete-crash-box): Really only check the incoming files once in a while; nnml.el (nnml-save-nov): Message around nnml-save-nov so that the culprit is more visible; pop3.el (pop3-send-streaming-command): Off-by-one error on the request loop (for debugging purposes) removed.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110196
diff changeset
165 (while (>= count i)
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
166 (process-send-string process (format "%s %d\r\n" command i))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
167 ;; Only do 100 messages at a time to avoid pipe stalls.
110661
2b8ece636433 Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110475
diff changeset
168 (when (zerop (% i pop3-stream-length))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
169 (pop3-wait-for-messages process i total-size))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
170 (incf i)))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
171 (pop3-wait-for-messages process count total-size))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
172
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
173 (defun pop3-wait-for-messages (process count total-size)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
174 (while (< (pop3-number-of-responses total-size) count)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
175 (when total-size
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
176 (message "pop3 retrieved %dKB (%d%%)"
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
177 (truncate (/ (buffer-size) 1000))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
178 (truncate (* (/ (* (buffer-size) 1.0)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
179 total-size) 100))))
110388
9c222728860c pop3.el (pop3-wait-for-messages): Use pop3-accept-process-output instead of nnheader-accept-process-output.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110296
diff changeset
180 (pop3-accept-process-output process)))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
181
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
182 (defun pop3-write-to-file (file)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
183 (let ((pop-buffer (current-buffer))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
184 (start (point-min))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
185 beg end
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
186 temp-buffer)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
187 (with-temp-buffer
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
188 (setq temp-buffer (current-buffer))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
189 (with-current-buffer pop-buffer
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
190 (goto-char (point-min))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
191 (while (re-search-forward "^\\+OK" nil t)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
192 (forward-line 1)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
193 (setq beg (point))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
194 (when (re-search-forward "^\\.\r?\n" nil t)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
195 (setq start (point))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
196 (forward-line -1)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
197 (setq end (point)))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
198 (with-current-buffer temp-buffer
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
199 (goto-char (point-max))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
200 (let ((hstart (point)))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
201 (insert-buffer-substring pop-buffer beg end)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
202 (pop3-clean-region hstart (point))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
203 (goto-char (point-max))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
204 (pop3-munge-message-separator hstart (point))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
205 (goto-char (point-max))))))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
206 (let ((coding-system-for-write 'binary))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
207 (goto-char (point-min))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
208 ;; Check whether something inserted a newline at the start and
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
209 ;; delete it.
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
210 (when (eolp)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
211 (delete-char 1))
110197
727cc5d69397 pop3.el (pop3-write-to-file): Don't output messages when saving; mail-source.el (mail-source-delete-crash-box): Really only check the incoming files once in a while; nnml.el (nnml-save-nov): Message around nnml-save-nov so that the culprit is more visible; pop3.el (pop3-send-streaming-command): Off-by-one error on the request loop (for debugging purposes) removed.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110196
diff changeset
212 (write-region (point-min) (point-max) file nil 'nomesg)))))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
213
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
214 (defun pop3-number-of-responses (endp)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
215 (let ((responses 0))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
216 (save-excursion
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
217 (goto-char (point-min))
110224
3d216398af49 pop3.el (pop3-number-of-responses): Search for "+OK", not "+OK ".
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110210
diff changeset
218 (while (or (and (re-search-forward "^\\+OK" nil t)
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
219 (or (not endp)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
220 (re-search-forward "^\\.\r?\n" nil t)))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
221 (re-search-forward "^-ERR " nil t))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
222 (incf responses)))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
223 responses))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
224
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
225 (defun pop3-logon (process)
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
226 (let ((pop3-password pop3-password))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
227 ;; for debugging only
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
228 (if pop3-debug (switch-to-buffer (process-buffer process)))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
229 ;; query for password
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
230 (if (and pop3-password-required (not pop3-password))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
231 (setq pop3-password
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 52401
diff changeset
232 (read-passwd (format "Password for %s: " pop3-maildrop))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
233 (cond ((equal 'apop pop3-authentication-scheme)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
234 (pop3-apop process pop3-maildrop))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
235 ((equal 'pass pop3-authentication-scheme)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
236 (pop3-user process pop3-maildrop)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
237 (pop3-pass process))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
238 (t (error "Invalid POP3 authentication scheme")))))
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
239
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
240 (defun pop3-get-message-count ()
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
241 "Return the number of messages in the maildrop."
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
242 (let* ((process (pop3-open-server pop3-mailhost pop3-port))
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
243 message-count
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
244 (pop3-password pop3-password))
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
245 ;; for debugging only
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
246 (if pop3-debug (switch-to-buffer (process-buffer process)))
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
247 ;; query for password
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
248 (if (and pop3-password-required (not pop3-password))
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
249 (setq pop3-password
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 52401
diff changeset
250 (read-passwd (format "Password for %s: " pop3-maildrop))))
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
251 (cond ((equal 'apop pop3-authentication-scheme)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
252 (pop3-apop process pop3-maildrop))
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
253 ((equal 'pass pop3-authentication-scheme)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
254 (pop3-user process pop3-maildrop)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
255 (pop3-pass process))
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 35453
diff changeset
256 (t (error "Invalid POP3 authentication scheme")))
35453
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
257 (setq message-count (car (pop3-stat process)))
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
258 (pop3-quit process)
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
259 message-count))
26726eff41ca 2001-01-21 ShengHuo ZHU <zsh@cs.rochester.edu>
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 34618
diff changeset
260
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
261 (autoload 'open-tls-stream "tls")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
262 (autoload 'starttls-open-stream "starttls")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
263 (autoload 'starttls-negotiate "starttls") ; avoid warning
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
264
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
265 (defcustom pop3-stream-type nil
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
266 "*Transport security type for POP3 connexions.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
267 This may be either nil (plain connexion), `ssl' (use an
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
268 SSL/TSL-secured stream) or `starttls' (use the starttls mechanism
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
269 to turn on TLS security after opening the stream). However, if
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
270 this is nil, `ssl' is assumed for connexions to port
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
271 995 (pop3s)."
92336
5f827896103e Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
272 :version "23.1" ;; No Gnus
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
273 :group 'pop3
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
274 :type '(choice (const :tag "Plain" nil)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
275 (const :tag "SSL/TLS" ssl)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
276 (const starttls)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
277
110201
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
278 (eval-and-compile
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
279 (if (fboundp 'set-process-query-on-exit-flag)
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
280 (defalias 'pop3-set-process-query-on-exit-flag
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
281 'set-process-query-on-exit-flag)
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
282 (defalias 'pop3-set-process-query-on-exit-flag
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
283 'process-kill-without-query)))
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
284
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
285 (defun pop3-open-server (mailhost port)
26108
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
286 "Open TCP connection to MAILHOST on PORT.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
287 Returns the process associated with the connection."
28835
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
288 (let ((coding-system-for-read 'binary)
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
289 (coding-system-for-write 'binary)
28835
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
290 process)
110411
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
291 (with-current-buffer
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
292 (get-buffer-create (concat " trace of POP session to "
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
293 mailhost))
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
294 (erase-buffer)
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
295 (setq pop3-read-point (point-min))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
296 (setq process
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
297 (cond
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
298 ((or (eq pop3-stream-type 'ssl)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
299 (and (not pop3-stream-type) (member port '(995 "pop3s"))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
300 ;; gnutls-cli, openssl don't accept service names
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
301 (if (or (equal port "pop3s")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
302 (null port))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
303 (setq port 995))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
304 (let ((process (open-tls-stream "POP" (current-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
305 mailhost port)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
306 (when process
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
307 ;; There's a load of info printed that needs deleting.
86225
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
308 (let ((again 't))
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
309 ;; repeat until
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
310 ;; - either we received the +OK line
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
311 ;; - or accept-process-output timed out without getting
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
312 ;; anything
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
313 (while (and again
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
314 (setq again (memq (process-status process)
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
315 '(open run))))
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
316 (setq again (pop3-accept-process-output process))
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
317 (goto-char (point-max))
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
318 (forward-line -1)
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
319 (cond ((looking-at "\\+OK")
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
320 (setq again nil)
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
321 (delete-region (point-min) (point)))
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
322 ((not again)
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
323 (pop3-quit process)
86225
166a6141ae98 Merge from gnus--devo--0
Miles Bader <miles@gnu.org>
parents: 86154
diff changeset
324 (error "POP SSL connexion failed")))))
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
325 process)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
326 ((eq pop3-stream-type 'starttls)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
327 ;; gnutls-cli, openssl don't accept service names
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
328 (if (equal port "pop3")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
329 (setq port 110))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
330 (let ((process (starttls-open-stream "POP" (current-buffer)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
331 mailhost (or port 110))))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
332 (pop3-send-command process "STLS")
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
333 (let ((response (pop3-read-response process t)))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
334 (if (and response (string-match "+OK" response))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
335 (starttls-negotiate process)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
336 (pop3-quit process)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
337 (error "POP server doesn't support starttls")))
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
338 process))
110111
5b9f64b04a04 Delete all trailing white space.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
339 (t
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
340 (open-network-stream "POP" (current-buffer) mailhost port))))
28835
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
341 (let ((response (pop3-read-response process t)))
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
342 (setq pop3-timestamp
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
343 (substring response (or (string-match "<" response) 0)
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
344 (+ 1 (or (string-match ">" response) -1)))))
110201
46435634bd67 pop3-set-process-query-on-exit-flag: New function that's an alias to set-process-query-on-exit-flag, or process-kill-without-query for XEmacs and old Emacsen.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110197
diff changeset
345 (pop3-set-process-query-on-exit-flag process nil)
28835
f451114521a7 Import changes from current Gnus.
Dave Love <fx@gnu.org>
parents: 27546
diff changeset
346 process)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
347
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
348 ;; Support functions
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
349
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
350 (defun pop3-send-command (process command)
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
351 (set-buffer (process-buffer process))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
352 (goto-char (point-max))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
353 ;; (if (= (aref command 0) ?P)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
354 ;; (insert "PASS <omitted>\r\n")
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
355 ;; (insert command "\r\n"))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
356 (setq pop3-read-point (point))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
357 (goto-char (point-max))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
358 (process-send-string process (concat command "\r\n")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
359
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
360 (defun pop3-read-response (process &optional return)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
361 "Read the response from the server.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
362 Return the response string if optional second argument is non-nil."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
363 (let ((case-fold-search nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
364 match-end)
110411
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
365 (with-current-buffer (process-buffer process)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
366 (goto-char pop3-read-point)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 52401
diff changeset
367 (while (and (memq (process-status process) '(open run))
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 52401
diff changeset
368 (not (search-forward "\r\n" nil t)))
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57442
diff changeset
369 (pop3-accept-process-output process)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
370 (goto-char pop3-read-point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
371 (setq match-end (point))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
372 (goto-char pop3-read-point)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
373 (if (looking-at "-ERR")
87140
9c91533a901a Fix buggy calls to `error'.
Deepak Goel <deego@gnufans.org>
parents: 86225
diff changeset
374 (error "%s" (buffer-substring (point) (- match-end 2)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
375 (if (not (looking-at "+OK"))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
376 (progn (setq pop3-read-point match-end) nil)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
377 (setq pop3-read-point match-end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
378 (if return
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
379 (buffer-substring (point) match-end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
380 t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
381 )))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
382
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
383 (defun pop3-clean-region (start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
384 (setq end (set-marker (make-marker) end))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
385 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
386 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
387 (while (and (< (point) end) (search-forward "\r\n" end t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
388 (replace-match "\n" t t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
389 (goto-char start)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
390 (while (and (< (point) end) (re-search-forward "^\\." end t))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
391 (replace-match "" t t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
392 (forward-char)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
393 (set-marker end nil))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
394
33369
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
395 ;; Copied from message-make-date.
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
396 (defun pop3-make-date (&optional now)
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
397 "Make a valid date header.
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
398 If NOW, use that time instead."
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
399 (require 'parse-time)
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
400 (let* ((now (or now (current-time)))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
401 (zone (nth 8 (decode-time now)))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
402 (sign "+"))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
403 (when (< zone 0)
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
404 (setq sign "-")
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
405 (setq zone (- zone)))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
406 (concat
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
407 (format-time-string "%d" now)
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
408 ;; The month name of the %b spec is locale-specific. Pfff.
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
409 (format " %s "
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
410 (capitalize (car (rassoc (nth 4 (decode-time now))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
411 parse-time-months))))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
412 (format-time-string "%Y %H:%M:%S " now)
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
413 ;; We do all of this because XEmacs doesn't have the %z spec.
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
414 (format "%s%02d%02d" sign (/ zone 3600) (/ (% zone 3600) 60)))))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
415
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
416 (defun pop3-munge-message-separator (start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
417 "Check to see if a message separator exists. If not, generate one."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
418 (save-excursion
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
419 (save-restriction
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
420 (narrow-to-region start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
421 (goto-char (point-min))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
422 (if (not (or (looking-at "From .?") ; Unix mail
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
423 (looking-at "\001\001\001\001\n") ; MMDF
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
424 (looking-at "BABYL OPTIONS:") ; Babyl
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
425 ))
44541
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
426 (let* ((from (mail-strip-quoted-names (mail-fetch-field "From")))
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
427 (tdate (mail-fetch-field "Date"))
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
428 (date (split-string (or (and tdate
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
429 (not (string= "" tdate))
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
430 tdate)
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
431 (pop3-make-date))
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
432 " "))
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
433 (From_))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
434 ;; sample date formats I have seen
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
435 ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
436 ;; Date: 08 Jul 1996 23:22:24 -0400
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
437 ;; should be
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
438 ;; Tue Jul 9 09:04:21 1996
73269
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
439
aeb79612dc36 Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 72810
diff changeset
440 ;; Fixme: This should use timezone on the date field contents.
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
441 (setq date
44541
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
442 (cond ((not date)
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 52401
diff changeset
443 "Tue Jan 1 00:00:0 1900")
44541
1910e7c74f9f * pop3.el (pop3-munge-message-separator): Work if no date.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents: 44452
diff changeset
444 ((string-match "[A-Z]" (nth 0 date))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
445 (format "%s %s %s %s %s"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
446 (nth 0 date) (nth 2 date) (nth 1 date)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
447 (nth 4 date) (nth 3 date)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
448 (t
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
449 ;; this really needs to be better but I don't feel
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
450 ;; like writing a date to day converter.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
451 (format "Sun %s %s %s %s"
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
452 (nth 1 date) (nth 0 date)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
453 (nth 3 date) (nth 2 date)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
454 ))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
455 (setq From_ (format "\nFrom %s %s\n" from date))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
456 (while (string-match "," From_)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
457 (setq From_ (concat (substring From_ 0 (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
458 (substring From_ (match-end 0)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
459 (goto-char (point-min))
26108
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
460 (insert From_)
33369
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
461 (if (search-forward "\n\n" nil t)
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
462 nil
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
463 (goto-char (point-max))
a92924d06d5b 2000-11-10 Dave Love <fx@gnu.org>
Dave Love <fx@gnu.org>
parents: 31716
diff changeset
464 (insert "\n"))
110195
48695a2e29d9 gnus-start.el: White space clean up; mail-source.el (mail-source-fetch-pop): Use streaming pop3 retrieval; pop3.el (pop3-streaming-movemail): Respect pop3-leave-mail-on-server; pop3.el (pop3-logon): Fix up unbound variable typo; mail-source.el (mail-source-delete-crash-box): Only check the incoming files for deletion once per day to save a lot of file accesses.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110193
diff changeset
465 (let ((size (- (point-max) (point))))
26108
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
466 (forward-line -1)
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
467 (insert (format "Content-Length: %s\n" size)))
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
468 )))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
469
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
470 ;; The Command Set
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
471
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
472 ;; AUTHORIZATION STATE
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
473
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
474 (defun pop3-user (process user)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
475 "Send USER information to POP3 server."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
476 (pop3-send-command process (format "USER %s" user))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
477 (let ((response (pop3-read-response process t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
478 (if (not (and response (string-match "+OK" response)))
63495
91a6c1b5b3c4 (pop3-user): Don't use `format' on `error' arguments.
Juanma Barranquero <lekktu@gmail.com>
parents: 62960
diff changeset
479 (error "USER %s not valid" user))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
480
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
481 (defun pop3-pass (process)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
482 "Send authentication information to the server."
24357
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
483 (pop3-send-command process (format "PASS %s" pop3-password))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
484 (let ((response (pop3-read-response process t)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
485 (if (not (and response (string-match "+OK" response)))
15fc6acbae7a Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 23435
diff changeset
486 (pop3-quit process))))
19633
25317a11d7a1 (pop3-md5): New function.
Richard M. Stallman <rms@gnu.org>
parents: 19595
diff changeset
487
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
488 (defun pop3-apop (process user)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
489 "Send alternate authentication information to the server."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
490 (let ((pass pop3-password))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
491 (if (and pop3-password-required (not pass))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
492 (setq pass
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents: 52401
diff changeset
493 (read-passwd (format "Password for %s: " pop3-maildrop))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
494 (if pass
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
495 (let ((hash (md5 (concat pop3-timestamp pass) nil nil 'binary)))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
496 (pop3-send-command process (format "APOP %s %s" user hash))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
497 (let ((response (pop3-read-response process t)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
498 (if (not (and response (string-match "+OK" response)))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
499 (pop3-quit process)))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
500 ))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
501
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
502 ;; TRANSACTION STATE
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
503
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
504 (defun pop3-stat (process)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
505 "Return the number of messages in the maildrop and the maildrop's size."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
506 (pop3-send-command process "STAT")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
507 (let ((response (pop3-read-response process t)))
62907
88db2adda4b7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
508 (list (string-to-number (nth 1 (split-string response " ")))
88db2adda4b7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
509 (string-to-number (nth 2 (split-string response " "))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
510 ))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
511
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
512 (defun pop3-list (process &optional msg)
107473
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
513 "If MSG is nil, return an alist of (MESSAGE-ID . SIZE) pairs.
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
514 Otherwise, return the size of the message-id MSG"
110111
5b9f64b04a04 Delete all trailing white space.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110102
diff changeset
515 (pop3-send-command process (if msg
107473
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
516 (format "LIST %d" msg)
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
517 "LIST"))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
518 (let ((response (pop3-read-response process t)))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
519 (if msg
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
520 (string-to-number (nth 2 (split-string response " ")))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
521 (let ((start pop3-read-point) end)
110411
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
522 (with-current-buffer (process-buffer process)
107473
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
523 (while (not (re-search-forward "^\\.\r\n" nil t))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
524 (pop3-accept-process-output process)
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
525 (goto-char start))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
526 (setq pop3-read-point (point-marker))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
527 (goto-char (match-beginning 0))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
528 (setq end (point-marker))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
529 (mapcar #'(lambda (s) (let ((split (split-string s " ")))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
530 (cons (string-to-number (nth 0 split))
0fe940324254 Synch with Gnus trunk
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 106815
diff changeset
531 (string-to-number (nth 1 split)))))
110475
ab3a38ccb842 Remove Emacs 21 stuff.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110411
diff changeset
532 (split-string (buffer-substring start end) "\r\n" t)))))))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
533
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
534 (defun pop3-retr (process msg crashbuf)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
535 "Retrieve message-id MSG to buffer CRASHBUF."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
536 (pop3-send-command process (format "RETR %s" msg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
537 (pop3-read-response process)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
538 (let ((start pop3-read-point) end)
110411
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
539 (with-current-buffer (process-buffer process)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
540 (while (not (re-search-forward "^\\.\r\n" nil t))
57561
505c55fe8dc9 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-621
Miles Bader <miles@gnu.org>
parents: 57442
diff changeset
541 (pop3-accept-process-output process)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
542 (goto-char start))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
543 (setq pop3-read-point (point-marker))
57442
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
544 ;; this code does not seem to work for some POP servers...
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
545 ;; and I cannot figure out why not.
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
546 ;; (goto-char (match-beginning 0))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
547 ;; (backward-char 2)
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
548 ;; (if (not (looking-at "\r\n"))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
549 ;; (insert "\r\n"))
2d9a1d1ac73d Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Miles Bader <miles@gnu.org>
parents: 56927
diff changeset
550 ;; (re-search-forward "\\.\r\n")
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551 (goto-char (match-beginning 0))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
552 (setq end (point-marker))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
553 (pop3-clean-region start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
554 (pop3-munge-message-separator start end)
110411
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
555 (with-current-buffer crashbuf
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
556 (erase-buffer))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
557 (copy-to-buffer crashbuf start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
558 (delete-region start end)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
559 )))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
560
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
561 (defun pop3-dele (process msg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
562 "Mark message-id MSG as deleted."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
563 (pop3-send-command process (format "DELE %s" msg))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
564 (pop3-read-response process))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
565
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
566 (defun pop3-noop (process msg)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
567 "No-operation."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
568 (pop3-send-command process "NOOP")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
569 (pop3-read-response process))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
570
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
571 (defun pop3-last (process)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
572 "Return highest accessed message-id number for the session."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
573 (pop3-send-command process "LAST")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
574 (let ((response (pop3-read-response process t)))
62907
88db2adda4b7 Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents: 59996
diff changeset
575 (string-to-number (nth 1 (split-string response " ")))
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
576 ))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
577
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
578 (defun pop3-rset (process)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
579 "Remove all delete marks from current maildrop."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
580 (pop3-send-command process "RSET")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
581 (pop3-read-response process))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
582
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
583 ;; UPDATE
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
584
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
585 (defun pop3-quit (process)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
586 "Close connection to POP3 server.
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
587 Tell server to remove all messages marked as deleted, unlock the maildrop,
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
588 and close the connection."
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
589 (pop3-send-command process "QUIT")
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
590 (pop3-read-response process t)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
591 (if process
110411
07940da9c47a Fix previous merge from Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 110410
diff changeset
592 (with-current-buffer (process-buffer process)
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
593 (goto-char (point-max))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
594 (delete-process process))))
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
595
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
596 ;; Summary of POP3 (Post Office Protocol version 3) commands and responses
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
597
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
598 ;;; AUTHORIZATION STATE
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
599
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
600 ;; Initial TCP connection
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
601 ;; Arguments: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
602 ;; Restrictions: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
603 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
604 ;; +OK [POP3 server ready]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
605
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
606 ;; USER name
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
607 ;; Arguments: a server specific user-id (required)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
608 ;; Restrictions: authorization state [after unsuccessful USER or PASS
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
609 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
610 ;; +OK [valid user-id]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
611 ;; -ERR [invalid user-id]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
612
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
613 ;; PASS string
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
614 ;; Arguments: a server/user-id specific password (required)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
615 ;; Restrictions: authorization state, after successful USER
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
616 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
617 ;; +OK [maildrop locked and ready]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
618 ;; -ERR [invalid password]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
619 ;; -ERR [unable to lock maildrop]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
620
85712
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
621 ;; STLS (RFC 2595)
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
622 ;; Arguments: none
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
623 ;; Restrictions: Only permitted in AUTHORIZATION state.
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
624 ;; Possible responses:
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
625 ;; +OK
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
626 ;; -ERR
a3c27999decb Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents: 78224
diff changeset
627
17493
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
628 ;;; TRANSACTION STATE
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
629
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
630 ;; STAT
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
631 ;; Arguments: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
632 ;; Restrictions: transaction state
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
633 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
634 ;; +OK nn mm [# of messages, size of maildrop]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
635
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
636 ;; LIST [msg]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
637 ;; Arguments: a message-id (optional)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
638 ;; Restrictions: transaction state; msg must not be deleted
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
640 ;; +OK [scan listing follows]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
641 ;; -ERR [no such message]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643 ;; RETR msg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
644 ;; Arguments: a message-id (required)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
645 ;; Restrictions: transaction state; msg must not be deleted
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
646 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
647 ;; +OK [message contents follow]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
648 ;; -ERR [no such message]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
649
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
650 ;; DELE msg
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
651 ;; Arguments: a message-id (required)
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
652 ;; Restrictions: transaction state; msg must not be deleted
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
653 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
654 ;; +OK [message deleted]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
655 ;; -ERR [no such message]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
656
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
657 ;; NOOP
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
658 ;; Arguments: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
659 ;; Restrictions: transaction state
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
660 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
661 ;; +OK
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
662
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
663 ;; LAST
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
664 ;; Arguments: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
665 ;; Restrictions: transaction state
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
666 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
667 ;; +OK nn [highest numbered message accessed]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
668
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
669 ;; RSET
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
670 ;; Arguments: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
671 ;; Restrictions: transaction state
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
672 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
673 ;; +OK [all delete marks removed]
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
674
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
675 ;;; UPDATE STATE
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
676
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
677 ;; QUIT
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
678 ;; Arguments: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
679 ;; Restrictions: none
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
680 ;; Possible responses:
e6935c08cf0b Initial revision
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
681 ;; +OK [TCP connection closed]
26108
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
682
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
683 (provide 'pop3)
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
684
08a36c7a0a52 Merge changes from version `1.3s' which we weren't sent.
Dave Love <fx@gnu.org>
parents: 24599
diff changeset
685 ;;; pop3.el ends here