Subject: mail parameters and news spool vs nntp

From: Karsten Ballueder <[email-masked]>
Date: Tue, 23 Mar 1999 17:09:56 +0000 (GMT)

Hello,

thanks for the recent help with newsrc updates, I got it to work fine now.

However, I have some more question that the docs couldn't answer:

- mail_parameters() takes a mailstream argument, however the docs say that
  the "operational parameters" are global. I was hoping that it would be
  possible to set e.g. the name of the newsrc file or the connection port
  number on a per-stream basis?  Another problem with that idea is that
  the only way to get a valid mailstream pointer is to call mail_open() or
  mail_create(), in both cases I obviously cannot set the parameters for the
  stream before.
  Is there any way to set such parameters on a per-stream basis?
  If not, can I just change the global parameter before opening the new
  stream, or will this have side-effects for already open stream (i.e. when
  closing them and writing back the newsrc.)?

- I currently access NNTP servers just fine and saw that there is code for
  accessing a local newsspool as well. How can I do this? The relevant
  code in mail.c doesn't seem to recognise a "/news" parameter, like a
  "/nntp". Or, more generally, how can I specify which driver to use for a
  given stream?

- Last, I saw that there are some mail_thread_xx() functions in mail.c
  which aren't documented. As I was about to implement my own code to
  parse the References headers and thread messages, I hope using these could
  save me some work. Could you explain me how to use them, or maybe supply
  some sample code snippet?

Sorry for all these questions, but I couldn't find the answers in the
docs. I'm happy to add your answers to the docs though, if you like.

Thanks very much in advance!

--
 Karsten Ballüder http://www.phy.hw.ac.uk/~karsten/ mailto:[email-masked]
 Physics Department, Heriot-Watt University, Edinburgh, EH14 4AS, Scotland
                     Tel. +44-(0)-131-4513068  Fax. +44-(0)-131-4513136
           "In a world without fences, who needs Gates?"  

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 23 Mar 1999 15:48:18 -0800 (PST)

On Tue, 23 Mar 1999 17:09:56 +0000 (GMT), Karsten Ballueder wrote:
>   number on a per-stream basis?

To set the connection port per-stream, put it as part of the mailbox name,
e.g.:
 {mynewsserver.com:10569/nntp}alt.bombastic.blurdybloop
For more information, please read section III of naming.txt in the docs/
subdirectory of the IMAP toolkit distribution.

The mail_parameters() call for setting the NNTP port is to set an overriding
default if the port isn't specified in the name.  Otherwise, the port number
for service "nntp" is used, or failing that a wired-in constant.

It is not currently possible to set the newsrc file name on a per-stream
basis.  The MAILSTREAM argument to mail_parameters() is currently ignored.  If
a per-stream facility is implemented, the MAILSTREAM argument will be used,
but until the exact semantics are defined, you shouldn't use anything other
than NIL for this argument.

>   closing them and writing back the newsrc.)?

The current SET_NEWSRC name is used every time the mailbox flags are read or
updated.  This happens at the following times with NNTP and local newsgroups:
	mail_open()
	mail_close()
	mail_check()
	mail_lsub()
	mail_subscribe()
	mail_unsubscribe()

So, if you set it to the correct name before any of these calls, you'll
accomplish what you want.  I don't particularly recommend doing this, but it's
probably the only way to get what you want with the current version.

>   "/nntp". Or, more generally, how can I specify which driver to use for a

Please read drivers.txt and naming.txt, both in the docs/ subdirectory of the
IMAP toolkit distribution.

The appropriate driver is automatically selected for the mailbox.  The way
that you reference the newsgroup named "alt.bombastic.blurdybloop" vs. some
user's mailbox named "alt.bombastic.blurdybloop" is to use the IMAP namespace
syntax; that is, prefix with "#news.", e.g. "#news.alt.bombastic.blurdybloop".

>   some sample code snippet?

The only function which you should call is mail_thread(); the other functions
are internal to c-client.

mail_thread() accepts a stream argument, the name of a threading algorithm,
and then charset/searchpgm/flags ala mail_search() and mail_sort().

At the current time, the only supported threading algorithm is ORDEREDSUBJECT,
which is a type of "poor man's threading".  ORDEREDSUBJECT sorts by subject
with a secondary sort of message date, and then for sets of messages with
identical subjects (which constitute a single "poor man's thread"), sorts the
sets by the date of the first message in the set.

The returned value is a THREADNODE *, which holds the message number and
pointers to THREADNODE * for the next message in the thread and the head of a
parallel thread branch at this point of the tree.