Article View: demon.ip.developers
Article #883Re: unread mail
From: Paul Carpenter
Date: Fri, 05 Jul 1996 00:00
Date: Fri, 05 Jul 1996 00:00
32 lines
2094 bytes
2094 bytes
malcolm@demon.net "Malcolm Muir" writes:
-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:
....
-> 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.
From experience this process gets screwed up, by paragraphs like this one,
because the start of the paragraph is '<newline><newline>From' which is the
SAME as the way the DOS package reads the start of a message.
The addendum I would make is that the next line contains a valid header code
to be a bit safer on counting the 'From' by counting 'From' plus next line has
started with 'RFC822 keyword:' then do the subtraction as before.
--
Paul Carpenter | paul@pcserv.demon.co.uk
Consulting for General, Scientific, Industrial Computing & more..
email: listuser@pcserv.demon.co.uk - how to _use_ UK Consultants listings
email: consult@pcserv.demon.co.uk - to _join_ the UK Consultants listings
Technical Details
Message-ID:
<836578430snz@pcserv.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<303048688wnr@longevb.demon.co.uk> <31dd2477.0@muir-et2.staff.demon.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bb05,74043d7991f5707b X-Google-Attributes: gid10bb05,public From: Paul Carpenter <paul@pcserv.demon.co.uk> Subject: Re: unread mail Date: 1996/07/05 Message-ID: <836578430snz@pcserv.demon.co.uk> X-Deja-AN: 163856556 x-nntp-posting-host: pcserv.demon.co.uk references: <303048688wnr@longevb.demon.co.uk> <31dd2477.0@muir-et2.staff.demon.net> x-mail2news-path: pcserv.demon.co.uk organization: PC Services reply-to: paul@pcserv.demon.co.uk newsgroups: demon.ip.developers