From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8579 Path: main.gmane.org!not-for-mail From: Kai Grossjohann Newsgroups: gmane.emacs.gnus.general Subject: Re: writable NNTP server -- getting mail/news Date: 02 Nov 1996 14:21:30 +0100 Sender: grossjoh@charly.informatik.uni-dortmund.de Message-ID: References: Reply-To: Kai Grossjohann NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148720 12968 80.91.224.250 (20 Oct 2002 21:18:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:18:40 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: Original-Received: (qmail 21086 invoked from smtpd); 2 Nov 1996 13:44:13 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 2 Nov 1996 13:44:11 -0000 Original-Received: from fbi-mail.informatik.uni-dortmund.de (fbi-mail.informatik.uni-dortmund.de [129.217.4.42]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sat, 2 Nov 1996 14:21:34 +0100 Original-Received: from bonny.informatik.uni-dortmund.de (bonny.informatik.uni-dortmund.de [129.217.20.165]) by fbi-mail.informatik.uni-dortmund.de (8.8.2/) with SMTP id OAA14283; Sat, 2 Nov 1996 14:21:32 +0100 (MET) Original-Received: by bonny.informatik.uni-dortmund.de id OAA00791; Sat, 2 Nov 1996 14:21:31 +0100 Original-To: Kai Grossjohann In-Reply-To: Kai Grossjohann's message of 01 Nov 1996 15:09:02 +0100 Original-Lines: 85 X-Mailer: Red Gnus v0.52/Emacs 19.31 Xref: main.gmane.org gmane.emacs.gnus.general:8579 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8579 >>>>> Kai Grossjohann writes: Kai> Hi there, I'm writing a backend for a `writable NNTP server', Kai> ie an NNTP server which also groks a few additional commands Kai> for moving message from one group to another, for deleting Kai> messages and the like. I've been hacking a bit. I've got a problem with implementing the backend function *-request-accept-article. It seems that the status string isn't set correctly: the nntp-status-string variable is "" rather than containing the right message. Here's how the server behaves: ,----- | [bonny:~]91> telnet bonny 4242 | Trying 129.217.20.165... | Connected to bonny. | Escape character is '^]'. | 200 NNML server 1.08 ready - posting allowed | GROUP mail.misc | 211 1125 13921 15045 mail.misc group selected | XACCEPT | 340 send article to be posted. End with . | From: kai | Subject: test | Message-id: foo@bar.frob.org | | test test | . | 287 aricle accepted as 15046 in group mail.misc | quit | 205 closing connection - goodbye! | Connection closed by foreign host. `----- My problem was retrieving the "287" message. Here's what I tried: ,----- | (deffoo nnmk-request-accept-article (group &optional server last) | "Take current buffer and insert it into GROUP." | (nntp-possibly-change-group group server) | (let ((resart)) | (when (nntp-send-command "^[23].*\r?\n" "XACCEPT") | (nntp-send-buffer | "^\\(287 ar.*icle accepted as \\([0-9]*\\) .*\\)\r?\n\\|[23].*\n") | (setq resart | (substring nnmk-status-string ; (nnheader-get-report 'nnmk) | (match-beginning 1) (match-end 1)))) | resart)) `----- But neither nntp-status-string nor nnmk-status-string nor (nnheader-get-report 'nntp) nor (nnheader-get-report 'nnmk) returned anything useful. The best I got was "". What did I do wrong? The following hack works, but it's /ugly/ :-( ,----- | (deffoo nnmk-request-accept-article (group &optional server last) | "Take current buffer and insert it into GROUP." | (nntp-possibly-change-group group server) | (let ((resart)) | (when (nntp-send-command "^340 .*\r?\n" "XACCEPT") | (save-excursion (set-buffer nntp-server-buffer) | (erase-buffer)) | (nntp-send-buffer | "^287 \\(.*\\)") | (save-excursion | (set-buffer nntp-server-buffer) | (beginning-of-buffer) | (if (re-search-forward | "^287 .*art?icle accepted as \\([0-9]*\\) .*") | (setq resart | (buffer-substring (match-beginning 1) | (match-end 1))))) | resart))) `----- There's got to be a better way, no? Prolly only shows that I don't grok nntp-send-buffer. tia, kai -- Life is hard and then you die.