+2003-09-20 Jesper Harder <harder@ifa.au.dk>
+
+ * rfc2047.el (rfc2047-encode): Limit line length to 76 characters.
+
2003-09-20 Simon Josefsson <jas@extundo.com>
- * imap.el (imap-starttls-open): Erase buffer and disable process
- filter before invoking STARTTLS negotiation, to support new
- starttls.el that uses GNUTLS.
+ * tls.el (tls-process-connection-type): Doc fix.
+
+ * imap.el (imap-starttls-open): Rewrite, should support both old
+ starttls.el and new starttls.el that uses GNUTLS.
2003-09-18 Katsumi Yamaoka <yamaoka@jpl.org>
(let* ((port (or port imap-default-port))
(process (as-binary-process
(starttls-open-stream name buffer server port)))
- done)
+ done tls-info)
(message "imap: Connecting with STARTTLS...")
(when process
(while (and (memq (process-status process) '(open run))
(set-buffer buffer) ;; XXX "blue moon" nntp.el bug
- (goto-char (point-min))
+ (goto-char (point-max))
+ (forward-line -1)
(not (imap-parse-greeting)))
(accept-process-output process 1)
(sit-for 1))
+ (imap-send-command "STARTTLS")
+ (while (and (memq (process-status process) '(open run))
+ (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
+ (goto-char (point-max))
+ (forward-line -1)
+ (not (re-search-forward "[0-9]+ OK.*\r?\n" nil t)))
+ (accept-process-output process 1)
+ (sit-for 1))
(and imap-log
(with-current-buffer (get-buffer-create imap-log-buffer)
(buffer-disable-undo)
(goto-char (point-max))
(insert-buffer-substring buffer)))
- (let ((imap-process process))
- (unwind-protect
- (progn
- (set-process-filter imap-process 'imap-arrival-filter)
- (erase-buffer)
- (when (and (eq imap-stream 'starttls)
- (imap-ok-p (imap-send-command-wait "STARTTLS")))
- (set-process-filter imap-process nil)
- (starttls-negotiate imap-process)))
- (set-process-filter imap-process nil)))
- (when (memq (process-status process) '(open run))
+ (when (and (setq tls-info (starttls-negotiate process))
+ (memq (process-status process) '(open run)))
(setq done process)))
- (if done
- (progn
- (message "imap: Connecting with STARTTLS...done")
- done)
- (message "imap: Connecting with STARTTLS...failed")
- nil)))
+ (if (stringp tls-info)
+ (message "imap: STARTTLS info: %s" tls-info))
+ (message "imap: Connecting with STARTTLS...%s" (if done "done" "failed"))
+ done))
;; Server functions; authenticator stuff:
((big5 gb2312 euc-kr) 2)
(utf-8 4)
(t 8)))
+ (pre (- b (save-restriction
+ (widen)
+ (rfc2047-point-at-bol))))
;; encoded-words must not be longer than 75 characters,
;; including charset, encoding etc. This leaves us with
;; 75 - (length start) - 2 - 2 characters. The last 2 is for
;; each character expands to 8 bytes which is expanded by a
;; factor of 4/3 by base64 encoding.
(length (floor (- 75 (length start) 4) (* factor (/ 4.0 3.0))))
+ ;; Limit line length to 76 characters.
+ (length1 (max 1 (floor (- 76 (length start) 4 pre)
+ (* factor (/ 4.0 3.0)))))
(first t))
(if mime-charset
(save-restriction
;; break into lines before encoding
(goto-char (point-min))
(while (not (eobp))
- (goto-char (min (point-max) (+ length (point))))
+ (if first
+ (progn
+ (goto-char (min (point-max) (+ length1 (point))))
+ (setq first nil))
+ (goto-char (min (point-max) (+ length (point)))))
(unless (eobp)
- (insert ?\n))))
+ (insert ?\n)))
+ (setq first t))
(if (and (mm-multibyte-p)
(mm-coding-system-p cs))
(mm-encode-coding-region (point-min) (point-max) cs))
:group 'tls)
(defcustom tls-process-connection-type nil
- "*Value for `process-connection-type' to use when starting process."
+ "*Value for `process-connection-type' to use when starting TLS process."
:type 'boolean
:group 'tls)
+2003-09-20 Jesper Harder <harder@ifa.au.dk>
+
+ * gnus.texi (Fancy Mail Splitting): Make split-on-body work for
+ respooling. Suggested by Harald Maier <maierh@myself.com>.
+ (Fancy Mail Splitting): Reformat.
+
2003-09-15 Jesper Harder <harder@ifa.au.dk>
* gnus.texi (Posting Styles): Fix typo. @itemize attribute names.
@end lisp
\e$B$3$NJQ?t$O\e(B @dfn{\e$BJ,3d\e(B} \e$B$NMM<0$K$J$C$F$$$^$9!#J,3d$O\e(B (\e$B$"$k$$$O\e(B) \e$B$=$l$>$l$N\e(B
-\e$BJ,3d$,B>$NJ,3d$r4^$`:F5"E*9=B$$G$9!#$3$l$O;HMQ2DG=$J8^$D$NJ,3d9=J8$G$9\e(B:
+\e$BJ,3d$,B>$NJ,3d$r4^$`:F5"E*9=B$$G$9!#$3$l$O;HMQ2DG=$JJ,3d9=J8$G$9\e(B:
-@enumerate
+@table @code
-@item
-@samp{group}: \e$B$b$7J,3d$,J8;zNs$G$"$k$H!"$=$l$O%0%k!<%WL>$H$7$F$_$J$5$l$^\e(B
-\e$B$9!#IaDL$N@55,I=8=$N9gCW$,$J$5$l$^$9!#Nc$O2<$NJ}$r8+$F2<$5$$!#\e(B
+@item group
+\e$B$b$7J,3d$,J8;zNs$G$"$k$H!"$=$l$O%0%k!<%WL>$H$7$F$_$J$5$l$^$9!#IaDL$N@55,\e(B
+\e$BI=8=$N9gCW$,$J$5$l$^$9!#Nc$O2<$NJ}$r8+$F2<$5$$!#\e(B
-@item
-@code{(@var{field} @var{value} @code{[-} @var{restrict} @code{[@dots{}]}@code{]} @var{split})}:
+@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split})
\e$B$b$7J,3d$,%j%9%H$G!":G=i$NMWAG$,J8;zNs$G$"$j!"%X%C%@!<\e(B @var{field} (\e$B@55,\e(B
\e$BI=8=\e(B) \e$B$,\e(B @var{value} (\e$B$3$l$b@55,I=8=\e(B) \e$B$r4^$s$G$$$k>l9g!"%a%C%;!<%8\e(B
\e$B$r\e(B @var{split} \e$B$G;XDj$5$l$?$H$3$m$KC_@Q$7$^$9!#\e(B@var{restrict} (\e$B$^$?B>$N\e(B
\e$B$+$NJ8;zNs$K9gCW$7$?$i!"\e(B@var{split} \e$B$OL5;k$5$l$^$9!#\e(B@var{restrict} \e$B$NJD\e(B
\e$BJq$N$I$l$b$,9gCW$7$J$1$l$P\e(B @var{split} \e$B$,<B9T$5$l$^$9!#\e(B
-@item
-@code{(| @var{split}@dots{})}: \e$BJ,3d$,%j%9%H$G!":G=i$NMWAG\e(B
-\e$B$,\e(B @code{|} (\e$B?bD>K@\e(B) \e$B$G$"$k$H!"$=$l$>$l$N\e(B @var{split} \e$B$r$=$N$&$A$N0l$D$,\e(B
-\e$B9gCW$9$k$^$G<B9T$7$^$9!#\e(B@var{split} \e$B$O%a!<%k%a%C%;!<%8$,0l$D0J>e$N%0%k!<\e(B
-\e$B%W$KC_@Q$5$l$?$H$-$K\e(B ``\e$B9gCW$7$?\e(B'' \e$B$H$7$^$9!#\e(B
+@item (| @var{split} @dots{})
+\e$BJ,3d$,%j%9%H$G!":G=i$NMWAG$,\e(B @code{|} (\e$B?bD>K@\e(B) \e$B$G$"$k$H!"$=$l$>$l\e(B
+\e$B$N\e(B @var{split} \e$B$r$=$N$&$A$N0l$D$,9gCW$9$k$^$G<B9T$7$^$9!#\e(B@var{split} \e$B$O\e(B
+\e$B%a!<%k%a%C%;!<%8$,0l$D0J>e$N%0%k!<%W$KC_@Q$5$l$?$H$-$K\e(B ``\e$B9gCW$7$?\e(B'' \e$B$H$7\e(B
+\e$B$^$9!#\e(B
-@item
-@code{(& @var{split}@dots{})}: \e$BJ,3d$,%j%9%H$G!":G=i$NMWAG$,\e(B @code{&} \e$B$G\e(B
-\e$B$"$k$H!"%j%9%H$NA4$F$N\e(B @var{split} (\e$BJ#?t\e(B) \e$B$r<B9T$7$^$9!#\e(B
+@item (& @var{split} @dots{})
+\e$BJ,3d$,%j%9%H$G!":G=i$NMWAG$,\e(B @code{&} \e$B$G$"$k$H!"%j%9%H$NA4$F\e(B
+\e$B$N\e(B @var{split} (\e$BJ#?t\e(B) \e$B$r<B9T$7$^$9!#\e(B
-@item
-@code{junk}: \e$B$b$7J,3d$,%7%s%\%k\e(B @code{junk} \e$B$G$"$k$H!"$=$N%a%C%;!<%8$rJ]\e(B
-\e$BB8$7$^$;$s\e(B (\e$B$9$J$o$A!">C5n$7$F$7$^$$$^$9\e(B)\e$B!#Hs>o$KCm0U$7$F;H$C$F2<$5$$!#\e(B
+@item junk
+\e$B$b$7J,3d$,%7%s%\%k\e(B @code{junk} \e$B$G$"$k$H!"$=$N%a%C%;!<%8$rJ]B8$7$^$;\e(B
+\e$B$s\e(B (\e$B$9$J$o$A!">C5n$7$F$7$^$$$^$9\e(B)\e$B!#Hs>o$KCm0U$7$F;H$C$F2<$5$$!#\e(B
-@item
-@code{(: @var{function} @var{arg1} @var{arg2} @dots{})}: \e$B$b$7J,3d$,%j%9\e(B
-\e$B%H$G!":G=i$NMWAG$,\e(B @code{:} \e$B$G$"$k$H!"FsHVL\$NMWAG$,\e(B @var{args} \e$B$r0z?t$H\e(B
-\e$B$7$F4X?t$H$7$F8F$P$l$^$9!#4X?t$O\e(B @var{split} \e$B$rJV$9$Y$-$G$9!#\e(B
+@item (: @var{function} @var{arg1} @var{arg2} @dots{})
+\e$B$b$7J,3d$,%j%9%H$G!":G=i$NMWAG$,\e(B @code{:} \e$B$G$"$k$H!"FsHVL\$NMWAG\e(B
+\e$B$,\e(B @var{args} \e$B$r0z?t$H$7$F4X?t$H$7$F8F$P$l$^$9!#4X?t$O\e(B @var{split} \e$B$rJV\e(B
+\e$B$9$Y$-$G$9!#\e(B
@cindex body split
\e$BNc$($P0J2<$N4X?t$O!"5-;v$N%\%G%#$K4p$E$$$?J,3d$K;H$($k$G$7$g$&\e(B:
@lisp
(defun split-on-body ()
(save-excursion
- (set-buffer " *nnmail incoming*")
+ (set-buffer
+ (or (get-buffer " *nnmail incoming*")
+ (get-buffer " *nnml move*")))
(goto-char (point-min))
(when (re-search-forward "Some.*string" nil t)
"string.group")))
@end lisp
-@code{:} \e$B$,;H$o$l$k$H$-!"%P%C%U%!\e(B @samp{" *nnmail incoming*"} \e$B$O%a%C%;!<\e(B
-\e$B%8$NItJ,$K69$a$i$l$^$9!#\e(B
+@var{function} \e$B$,Av$i$5$l$k$H$-!"%P%C%U%!$O%a%C%;!<%8$NItJ,$K69$a$i$l$^\e(B
+\e$B$9!#\e(B
-@item
-@code{(! @var{func} @var{split})}: \e$BJ,3d$,%j%9%H$G!":G=i$NMWAG\e(B
-\e$B$,\e(B @code{!} \e$B$G$"$k$H\e(B @var{split} \e$B$,<B9T$5$l!"\e(B
+@item (! @var{func} @var{split})
+\e$BJ,3d$,%j%9%H$G!":G=i$NMWAG$,\e(B @code{!} \e$B$G$"$k$H\e(B @var{split} \e$B$,<B9T$5$l!"\e(B
@var{func} \e$B$O\e(B @var{split} \e$B$N7k2L$r0z?t$H$7$F8F$P$l$^$9!#\e(B@var{func} \e$B$OJ,\e(B
\e$B3d$rJV$9$Y$-$G$9!#\e(B
-@item
-@code{nil}: \e$B$b$7J,3d$,\e(B @code{nil} \e$B$G$"$l$P!"$=$l$OL5;k$5$l$^$9!#\e(B
+@item nil
+\e$B$b$7J,3d$,\e(B @code{nil} \e$B$G$"$l$P!"$=$l$OL5;k$5$l$^$9!#\e(B
-@end enumerate
+@end table
\e$B$3$l$i$NJ,3d$G!"\e(B@var{fileld} \e$B$O40A4$J%U%#!<%k%IL>$K9gCW$7$J$1$l$P$J$j$^\e(B
\e$B$;$s!#\e(B@var{value} \e$B$O4pAC%b!<%I\e(B (fundamental mode) \e$B9=J8%F!<%V%k\e(B (syntax
@vindex nnmail-split-abbrev-alist
@var{field} \e$B$H\e(B @var{value} \e$B$O\e(B Lisp \e$B%7%s%\%k\e(B (symbol) \e$B$G$"$k;v$b$G$-!"$=\e(B
\e$B$N>l9g$=$l$i$O\e(B @code{nnmail-split-abbrev-alist} \e$B$G;XDj$5$l$F$$$k$h$&$KE8\e(B
-\e$B3+$5$l$^$9!#$3$l$O%;%k$N\e(B @code{car} \e$B$,%-!<$r4^$s$G$$$F!"\e(B@code{cdr} \e$B$,4X\e(B
-\e$BO"IU$1$i$l$?CM$r;}$C$F$$$k%3%s%9%;%k\e(B (cons cell) \e$B$NO"A[%j%9%H$G$9!#0J2<\e(B
-\e$B$N9`L\$,!"$"$i$+$8$a\e(B @code{nnmail-split-abbrev-alist} \e$B$KDj5A$5$l$F$$$^$9\e(B:
+\e$B3+$5$l$^$9!#$3$l$O%;%k$N\e(B @sc{car} \e$B$,%-!<$r4^$s$G$$$F!"\e(B@sc{cdr} \e$B$,4XO"IU\e(B
+\e$B$1$i$l$?CM$r;}$C$F$$$k%3%s%9%;%k\e(B (cons cell) \e$B$NO"A[%j%9%H$G$9!#0J2<$N9`\e(B
+\e$BL\$,!"$"$i$+$8$a\e(B @code{nnmail-split-abbrev-alist} \e$B$KDj5A$5$l$F$$$^$9\e(B:
@table @code
@item from
"misc.misc")
@end lisp
-This variable has the format of a @dfn{split}. A split is a (possibly)
-recursive structure where each split may contain other splits. Here are
-the five possible split syntaxes:
+This variable has the format of a @dfn{split}. A split is a
+(possibly) recursive structure where each split may contain other
+splits. Here are the possible split syntaxes:
-@enumerate
-
-@item
-@samp{group}: If the split is a string, that will be taken as a group
-name. Normal regexp match expansion will be done. See below for
-examples.
-
-@item
-@code{(@var{field} @var{value} @code{[-} @var{restrict}
-@code{[@dots{}]}@code{]} @var{split})}: If the split is a list, the
-first element of which is a string, then store the message as
-specified by @var{split}, if header @var{field} (a regexp) contains
-@var{value} (also a regexp). If @var{restrict} (yet another regexp)
-matches some string after @var{field} and before the end of the
-matched @var{value}, the @var{split} is ignored. If none of the
-@var{restrict} clauses match, @var{split} is processed.
-
-@item
-@code{(| @var{split}@dots{})}: If the split is a list, and the first
-element is @code{|} (vertical bar), then process each @var{split} until
-one of them matches. A @var{split} is said to match if it will cause
-the mail message to be stored in one or more groups.
-
-@item
-@code{(& @var{split}@dots{})}: If the split is a list, and the first
-element is @code{&}, then process all @var{split}s in the list.
+@table @code
-@item
-@code{junk}: If the split is the symbol @code{junk}, then don't save
-(i.e., delete) this message. Use with extreme caution.
-
-@item
-@code{(: @var{function} @var{arg1} @var{arg2} @dots{})}: If the split is
-a list, and the first element is @code{:}, then the second element will
-be called as a function with @var{args} given as arguments. The
-function should return a @var{split}.
+@item group
+If the split is a string, that will be taken as a group name. Normal
+regexp match expansion will be done. See below for examples.
+
+@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split})
+If the split is a list, the first element of which is a string, then
+store the message as specified by @var{split}, if header @var{field}
+(a regexp) contains @var{value} (also a regexp). If @var{restrict}
+(yet another regexp) matches some string after @var{field} and before
+the end of the matched @var{value}, the @var{split} is ignored. If
+none of the @var{restrict} clauses match, @var{split} is processed.
+
+@item (| @var{split} @dots{})
+If the split is a list, and the first element is @code{|} (vertical
+bar), then process each @var{split} until one of them matches. A
+@var{split} is said to match if it will cause the mail message to be
+stored in one or more groups.
+
+@item (& @var{split} @dots{})
+If the split is a list, and the first element is @code{&}, then
+process all @var{split}s in the list.
+
+@item junk
+If the split is the symbol @code{junk}, then don't save (i.e., delete)
+this message. Use with extreme caution.
+
+@item (: @var{function} @var{arg1} @var{arg2} @dots{})
+If the split is a list, and the first element is @samp{:}, then the
+second element will be called as a function with @var{args} given as
+arguments. The function should return a @var{split}.
@cindex body split
For instance, the following function could be used to split based on the
@lisp
(defun split-on-body ()
(save-excursion
- (set-buffer " *nnmail incoming*")
+ (set-buffer
+ (or (get-buffer " *nnmail incoming*")
+ (get-buffer " *nnml move*")))
(goto-char (point-min))
(when (re-search-forward "Some.*string" nil t)
"string.group")))
@end lisp
-The @samp{" *nnmail incoming*"} is narrowed to the message in question
-when the @code{:} function is run.
+The buffer is narrowed to the message in question when @var{function}
+is run.
-@item
-@code{(! @var{func} @var{split})}: If the split is a list, and the
-first element is @code{!}, then @var{split} will be processed, and
-@var{func} will be called as a function with the result of @var{split}
-as argument. @var{func} should return a split.
+@item (! @var{func} @var{split})
+If the split is a list, and the first element is @code{!}, then
+@var{split} will be processed, and @var{func} will be called as a
+function with the result of @var{split} as argument. @var{func}
+should return a split.
-@item
-@code{nil}: If the split is @code{nil}, it is ignored.
+@item nil
+If the split is @code{nil}, it is ignored.
-@end enumerate
+@end table
In these splits, @var{field} must match a complete field name.
@var{value} must match a complete word according to the fundamental mode
@var{field} and @var{value} can also be Lisp symbols, in that case
they are expanded as specified by the variable
@code{nnmail-split-abbrev-alist}. This is an alist of cons cells,
-where the @code{car} of a cell contains the key, and the @code{cdr}
+where the @sc{car} of a cell contains the key, and the @sc{cdr}
contains the associated value. Predefined entries in
@code{nnmail-split-abbrev-alist} include: