port number on server. The program should accept IMAP commands on
stdin and return responses to stdout.")
+(defvar nntp-authinfo-rejected nil
+"A custom error condition used to report 'Authentication Rejected' errors.
+Condition handlers that match just this condition ensure that the nntp
+backend doesn't catch this error.")
+(put 'nntp-authinfo-rejected 'error-conditions '(error nntp-authinfo-rejected))
+(put 'nntp-authinfo-rejected 'error-message "Authorization Rejected")
+
\f
;;; Internal functions.
(defsubst nntp-wait-for (process wait-for buffer &optional decode discard)
"Wait for WAIT-FOR to arrive from PROCESS."
+
(save-excursion
(set-buffer (process-buffer process))
(goto-char (point-min))
+
(while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5)))
- (looking-at "480"))
+ (looking-at "48[02]"))
(memq (process-status process) '(open run)))
- (when (looking-at "480")
- (nntp-handle-authinfo process))
- (when (looking-at "^.*\n")
- (delete-region (point) (progn (forward-line 1) (point))))
+ (cond ((looking-at "480")
+ (nntp-handle-authinfo process))
+ ((looking-at "482")
+ (nnheader-report 'nntp (get 'nntp-authinfo-rejected 'error-message))
+ (signal 'nntp-authinfo-rejected nil))
+ ((looking-at "^.*\n")
+ (delete-region (point) (progn (forward-line 1) (point)))))
(nntp-accept-process-output process)
(goto-char (point-min)))
(prog1
(wait-for
(nntp-wait-for process wait-for buffer decode))
(t t)))
+ (nntp-authinfo-rejected
+ (signal 'nntp-authinfo-rejected (cdr err)))
(error
(nnheader-report 'nntp "Couldn't open connection to %s: %s"
address err))
@item nntp-open-via-telnet-and-telnet
@findex nntp-open-via-telnet-and-telnet
-Does essentially also the same, but uses @samp{telnet} instead of
+Does essentially the same, but uses @samp{telnet} instead of
@samp{rlogin} to connect to the intermediate host.
@code{nntp-open-via-telnet-and-telnet}-specific variables:
@cindex Agent Parameters
@table @code
-@item agent-cat-name
-The name of the category.
-
@item agent-groups
The list of groups that are in this category.
A predicate which (generally) gives a rough outline of which articles
are eligible for downloading; and
-@item agent-score-file
+@item agent-score
a score rule which (generally) gives you a finer granularity when
deciding what articles to download. (Note that this @dfn{download
score} is not necessarily related to normal scores.)
@item agent-high-score
an integer that overrides the value of @code{gnus-agent-high-score}.
-@item agent-length-when-short
+@item agent-short-article
an integer that overrides the value of
@code{gnus-agent-short-article}.
-@item agent-length-when-long
+@item agent-long-article
an integer that overrides the value of @code{gnus-agent-long-article}.
@item agent-enable-undownloaded-faces
@item J s
@kindex J s (Agent Summary)
-@findex gnus-agent-fetch-series
+@findex gnus-agent-summary-fetch-series
Download all processable articles in this group.
-(@code{gnus-agent-fetch-series}).
+(@code{gnus-agent-summary-fetch-series}).
@item J u
@kindex J u (Agent Summary)
are stored locally. An optional argument will mark articles in the
agent as unread.
-@node Agent and IMAP
-@subsection Agent and IMAP
-
-The Agent works with any Gnus back end, including nnimap. However,
-since there are some conceptual differences between @acronym{NNTP} and
-@acronym{IMAP}, this section (should) provide you with some information to
-make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client.
+@node Agent and flags
+@subsection Agent and flags
-The first thing to keep in mind is that all flags (read, ticked, etc)
-are kept on the @acronym{IMAP} server, rather than in @file{.newsrc} as is the
-case for nntp. Thus Gnus need to remember flag changes when
-disconnected, and synchronize these flags when you plug back in.
+The Agent works with any Gnus back end including those, such as
+nnimap, that store flags (read, ticked, etc) on the server. Sadly,
+the Agent does not actually know which backends keep their flags in
+the backend server rather than in @file{.newsrc}. This means that the
+Agent, while unplugged or disconnected, will always record all changes
+to the flags in its own files.
-Gnus keeps track of flag changes when reading nnimap groups under the
-Agent. When you plug back in, Gnus will check if you have any changed
-any flags and ask if you wish to synchronize these with the server.
-The behavior is customizable by @code{gnus-agent-synchronize-flags}.
+When you plug back in, Gnus will then check to see if you have any
+changed any flags and ask if you wish to synchronize these with the
+server. This behavior is customizable by @code{gnus-agent-synchronize-flags}.
@vindex gnus-agent-synchronize-flags
If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will
@code{gnus-agent-synchronize-flags} command that is bound to @kbd{J Y}
in the group buffer.
+Technical note: the synchronization algorithm does not work by ``pushing''
+all local flags to the server, but rather by incrementally updated the
+server view of flags by changing only those flags that were changed by
+the user. Thus, if you set one flag on an article, quit the group then
+re-select the group and remove the flag; the flag will be set and
+removed from the server when you ``synchronize''. The queued flag
+operations can be found in the per-server @code{flags} file in the Agent
+directory. It's emptied when you synchronize flags.
+
+@node Agent and IMAP
+@subsection Agent and IMAP
+
+The Agent works with any Gnus back end, including nnimap. However,
+since there are some conceptual differences between @acronym{NNTP} and
+@acronym{IMAP}, this section (should) provide you with some information to
+make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client.
+
Some things are currently not implemented in the Agent that you'd might
expect from a disconnected @acronym{IMAP} client, including:
@end itemize
-Technical note: the synchronization algorithm does not work by ``pushing''
-all local flags to the server, but rather incrementally update the
-server view of flags by changing only those flags that were changed by
-the user. Thus, if you set one flag on an article, quit the group and
-re-select the group and remove the flag; the flag will be set and
-removed from the server when you ``synchronize''. The queued flag
-operations can be found in the per-server @code{flags} file in the Agent
-directory. It's emptied when you synchronize flags.
-
-
@node Outgoing Messages
@subsection Outgoing Messages
thing to do as the newly downloaded article has obviously not been
read. The default is @code{t}.
+@item gnus-agent-synchronize-flags
+@vindex gnus-agent-synchronize-flags
+If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will
+never automatically synchronize flags. If it is @code{ask}, which is
+the default, the Agent will check if you made any changes and if so
+ask if you wish to synchronize these when you re-connect. If it has
+any other value, all flags will be synchronized automatically.
+
@item gnus-agent-consider-all-articles
@vindex gnus-agent-consider-all-articles
If @code{gnus-agent-consider-all-articles} is non-@code{nil}, the