From: watanabe@izanami.material.tohoku.ac.jp (Masatoshi Watanabe)
Newsgroups: fj.news.b
Subject: INN funsen-ki #6 (Re: Questions about INN)
Date: 15 Dec 1992 04:04:50 GMT
Organization: Tohoku Univ., Sendai Japan
Distribution: fj
NNTP-Posting-Host: izanami.material.tohoku.ac.jp
In-reply-to: masuda@lachesis.rokugo.co.jp's message of 15 Dec 1992 10:37:52 +0900

$@ElKLBg$NEOJU$G$9!#(J($@$3$N$H$3$m(J INN $@J3@o5-$,5Y:\$7$F$$$k$J(J)

>>>>> On 15 Dec 1992 10:37:52 +0900, masuda@lachesis.rokugo.co.jp (Yoshihiro Masuda) said:

masuda> nntp $@%Y!<%9$N%K%e!<%9%j!<%@$G%m!<%+%k$K@\B3$9$k$H!"(J
masuda> innd $@$,!"D>@\JV;v$r$9$k$i$7$/!"(Jin.nnrpd $@$r8F$S=P$7(J
masuda> $@$F$/$l$^$;$s!#(J

masuda> $@$H$j$"$($:!"(Jgnus $@$r;H$&>l9g!"(JNNTP host $@$r!"(J`hostname`
masuda> $@$+$i!"(Jlocalhost $@$KJQ$($F!"5^>l$r$7$N$$$G$"$j$^$9$,!"(J
masuda> $@$3$l$@$H!"(JNNTP-posting-host: localhost.rokugo.co.jp
masuda> $@$J$I$H$J$C$F$7$^$$!"2?$+$_$C$H$b$J$/$F7y$G$9(J(^^;)

$@$3$l$O(J hosts.nntp $@$K!"$=$N%5!<%P!<<+?H$bEPO?$7$F$$$k$?$a$@$H;W$$$^$9!#(J
$@$3$N%U%!%$%k$K$O!"<+J,<+?H$N%"%I%l%9$OITMW$G$9$N$G!"$=$l$r<h$j=|$1$PLd(J
$@BjL5$$$H;W$$$^$9!#(J

$@$^$?!"(JGNUS $@$G(J localhost $@$K(J access $@$9$k>l9g$O!"(Jnntp $@7PM3$h$j$b!"(Jspool 
$@$rD>@\FI$`$h$&$K$7$?J}$,7Z2w$G$9!#$=$N$?$a$K$O!"(J.emacs $@$G(J

    (setq gnus-nntp-service nil)

$@$H!"$7$^$9!#$3$N$^$^$G$O(J GNUS $@$H(J inews $@$KFs=E$K(J signature $@$r$D$1$i$l$F(J
$@$7$^$&$+$b$7$l$^$;$s$,!"(J

    (setq nnspool-inews-switches '("-hS"))

$@$H$7$F$d$l$P!"(Jinews $@$,(J signature $@$rIU$1$J$/$J$j$^$9!#(J
$@$J$*!"(Jinews $@$N(J path $@$bE,59@_Dj$7$F$d$kI,MW$,$"$k$+$b$7$l$^$;$s!#(J

$@$H$3$m$G!"(Jhosts.nntp $@$KEPO?$5$l$F$$$k%^%7%s$+$i!"(JGNUS $@Ey$G(J nntp $@$G5-;v(J
$@$rFI$_$K$-$?;~$K$O!"(Jinnd $@$,D>@\Ez$($F$7$^$$!"(JMODE READER $@$H8@$&%3%^%s(J
$@%I$rAw$i$J$1$l$P(J nnrpd $@$K0\9T$7$F$/$l$^$;$s!#(J

$@$=$l$+$i!"(JGNUS $@$O9TKv$G(J LF $@$7$+Aw$i$J$$$,!"(Jinnd $@$O(J CR + LF $@$rMW5a$9$k!"(J
$@$H8@$&LdBj$b$"$j$^$9!#(J

$@$3$l$O!"(Jfj $@$N$_$rE>Aw$7$F$b$i$C$F$$$k%^%7%s$N%f!<%6!<$,!"?F%5!<%P!<$K(J
$@$D$J$$$G(J comp $@$rFI$b$&$H$7$?!"$J$I$H8@$&>l9g$K@8$8F@$kLdBj$G$9!#(J

$@$=$3$G!"(Jelisp $@$ONI$/$o$+$i$J$$$N$G$$$$$+$2$s$G$9$,!"(Jnntp.el $@$r0J2<$N$h(J
$@$&$K=q$-49$($F$_$^$7$?!#(J

$@$^$:!"(JMODE READER $@$rAw$kItJ,$G$9!#(Jnntp-open-server $@$K?t9T=q$-2C$($?$@(J
$@$1$G$9(J (diff $@$K$9$j$c$h$+$C$?$J(J)$@!#(J

(defun nntp-open-server (host &optional service)
  "Open news server on HOST.
If HOST is nil, use value of environment variable `NNTPSERVER'.
If optional argument SERVICE is non-nil, open by the service name."
  (let ((host (or host (getenv "NNTPSERVER")))
	(status nil))
    (setq nntp-status-message-string "")
    (cond ((and host (nntp-open-server-internal host service))
	   (setq status (nntp-wait-for-response "^[23].*\r$"))
	   ;; Do check unexpected close of connection.
	   ;; Suggested by feldmark@hanako.stars.flab.fujitsu.junet.
	   (if status
	       ;; MODE READER was added by watanabe@tohoku.ac.jp.
	       (and (set-process-sentinel nntp-server-process
				     'nntp-default-sentinel)
		(nntp-send-command "^[25].*\r$" "MODE" "READER"))
	     ;; We have to close connection here, since function
	     ;;  `nntp-server-opened' may return incorrect status.
	     (nntp-close-server-internal)
	     ))
	  ((null host)
	   (setq nntp-status-message-string "NNTP server is not specified."))
	  )
    status
    ))

$@$=$l$+$i!"(JCR-LF $@$rAw$k$H$3$m$G$9!#$b$H$b$H%3%a%s%H$K(J "Command line must
be terminated by a CR-LF." $@$H=q$$$F$"$k$N$K!"(J\n $@$7$+Aw$C$F$J$+$C$?$N$,(J
$@IT;W5D$G$9!#(J

(defun nntp-send-strings-to-server (&rest strings)
  "Send list of STRINGS to news server as command and its arguments."
  (let ((cmd (car strings))
	(strings (cdr strings)))
    ;; Command and each argument must be separeted by one or more spaces.
    (while strings
      (setq cmd (concat cmd " " (car strings)))
      (setq strings (cdr strings)))
    ;; Command line must be terminated by a CR-LF.
    ;; \r was added by watanabe@tohoku.ac.jp.
    (process-send-string nntp-server-process (concat cmd "\r\n"))
    ))

$@$=$l$+$i!"(JGNUS $@$G$O5-;v$N%X%C%@!<$N(J Date: $@$K(J JST ($@$H8@$&$+(J local time)
$@$N;~9o$r!"8e$m$K(J JST $@$bL5$7$GIU$1$F$/$k$N$G$9$,!"(Jinn $@$O$=$l$rAGDL$j$5(J
$@$;$F$7$^$$$^$9(J (Cnews $@$b$=$&$J$N$+$J!)(J)$@!"(Jgnus $@$N$=$N=hM}$r$7$F$$$kItJ,(J
$@$O%3%a%s%H%"%&%H$7$F$7$^$C$?J}$,NI$$$G$7$g$&!#(J
--
	Masatoshi Watanabe   <watanabe@izanami.material.tohoku.ac.jp>
	Dept.of Metallurgy, Faculty of Engineering, Tohoku Univ.