Gnus development mailing list
 help / color / mirror / Atom feed
* writable NNTP server -- getting mail/news
@ 1996-11-01 14:10 Kai Grossjohann
  1996-11-01 15:50 ` Steinar Bang
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Grossjohann @ 1996-11-01 14:10 UTC (permalink / raw)


Hi there,

I'm writing a backend for a `writable NNTP server', ie an NNTP server
which also groks a few additional commands for moving message from one
group to another, for deleting messages and the like.

I've hacked together a Gnus backend for this which kinda works.  But
what it can't do now is getting new mail.  (Actually, it uses the nnml
function for this, but that's a kludge.)

I've read nnmail-get-new-mail and I see that I seem to have to write a
couple of functions that save 1 article in a given group and the like,
but I'm not sure if I've overlooked something.

The server knows about the command XACCEPT which puts an article into
the current group.  (Similar to POST but doesn't complain about
duplicate message id's.)

What functions do I need to implement for the backend to be able to
get new mail?

kai
-- 
Life is hard and then you die.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: writable NNTP server -- getting mail/news
  1996-11-01 14:10 writable NNTP server -- getting mail/news Kai Grossjohann
@ 1996-11-01 15:50 ` Steinar Bang
  0 siblings, 0 replies; 5+ messages in thread
From: Steinar Bang @ 1996-11-01 15:50 UTC (permalink / raw)


>>>>> Kai Grossjohann <grossjohann@charly.informatik.uni-dortmund.de>:

> I'm writing a backend for a `writable NNTP server', ie an NNTP
> server which also groks a few additional commands for moving message
> from one group to another, for deleting messages and the like.

Hmm... sounds like a good starter for an IMAP backend...?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: writable NNTP server -- getting mail/news
  1996-11-01 14:09 Kai Grossjohann
  1996-11-02 13:21 ` Kai Grossjohann
@ 1996-11-05 21:50 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-11-05 21:50 UTC (permalink / raw)


Kai Grossjohann <grossjohann@ls6.informatik.uni-dortmund.de> writes:

> I've read nnmail-get-new-mail and I see that I seem to have to write a
> couple of functions that save 1 article in a given group and the like,
> but I'm not sure if I've overlooked something.

Yup.  I've now added a new section to the manual to cover this --
"Mail-like backends".

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: writable NNTP server -- getting mail/news
  1996-11-01 14:09 Kai Grossjohann
@ 1996-11-02 13:21 ` Kai Grossjohann
  1996-11-05 21:50 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Grossjohann @ 1996-11-02 13:21 UTC (permalink / raw)
  Cc: ding

>>>>> 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 <CR-LF>.<CR-LF>
| 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* writable NNTP server -- getting mail/news
@ 1996-11-01 14:09 Kai Grossjohann
  1996-11-02 13:21 ` Kai Grossjohann
  1996-11-05 21:50 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 5+ messages in thread
From: Kai Grossjohann @ 1996-11-01 14:09 UTC (permalink / raw)


Hi there,

I'm writing a backend for a `writable NNTP server', ie an NNTP server
which also groks a few additional commands for moving message from one
group to another, for deleting messages and the like.

I've hacked together a Gnus backend for this which kinda works.  But
what it can't do now is getting new mail.  (Actually, it uses the nnml
function for this, but that's a kludge.)

I've read nnmail-get-new-mail and I see that I seem to have to write a
couple of functions that save 1 article in a given group and the like,
but I'm not sure if I've overlooked something.

The server knows about the command XACCEPT which puts an article into
the current group.  (Similar to POST but doesn't complain about
duplicate message id's.)

What functions do I need to implement for the backend to be able to
get new mail?

kai
-- 
Life is hard and then you die.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-11-05 21:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-01 14:10 writable NNTP server -- getting mail/news Kai Grossjohann
1996-11-01 15:50 ` Steinar Bang
  -- strict thread matches above, loose matches on Subject: below --
1996-11-01 14:09 Kai Grossjohann
1996-11-02 13:21 ` Kai Grossjohann
1996-11-05 21:50 ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).