🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #882

Re: unread mail

#882
From: Malcolm Muir
Date: Fri, 05 Jul 1996 00:00
35 lines
1972 bytes
John de Rivaz (John@longevb.demon.co.uk) wrote:
> The DOS package with Demon has a feature that lists each of your 
> mailboxes and show how many unread messages are present. Does anyone now 
> how this works? I tried to write a little application in Visual Basic to 
> do the same, and variations in mail headers always seem to fool it.
> 
> I opened each *.txt file of email and read it line by line as follows:
> 
>       Input #1, a$
>       If Left$(a$, 11) = "Message-Id:" Then validated = 0
>       If Left$(a$, 13) = "Content-Type:" And validated = 0 Then
>          validated = 1: c = c + 1
>       end if
>       If Left$(a$, 9) = "Status: R" And validated Then
>         c = c - 1: validated=0
>       End If
> 
> c is the count of unread messages. It is incremented each time a message 
> is validated and decremented again if it has been read as flagged by the 
> NewsWin Status insertion.
>  
> Maybe I am doing something stupid, but I can be attempting the 
> impossible as the DOS package already does it.

You are counting messages the wrong way. Each new message in a
mailbox starts with the line 'From ' (note there is no ':')

Count the number of 'From ' lines and the number of 'Status: R'
lines. Subtract one from the other.

-- 
Malcolm S. Muir                                Demon Internet Ltd.
Sunderland                                     322 Regents Park Road
England                                        London N3 2QQ
Technical Details
Message-ID: <31dd2477.0@muir-et2.staff.demon.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <303048688wnr@longevb.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,74043d7991f5707b
X-Google-Attributes: gid10bb05,public
From: malcolm@muir-et2.staff.demon.net (Malcolm Muir)
Subject: Re: unread mail
Date: 1996/07/05
Message-ID: <31dd2477.0@muir-et2.staff.demon.net>
X-Deja-AN: 163847604
x-nntp-posting-host: muir-et2.staff.demon.net
references: <303048688wnr@longevb.demon.co.uk>
organization: Demon Internet Ltd.
reply-to: malcolm@demon.net
newsgroups: demon.ip.developers