Dec 262017
 
ILink discussions concerning QMAIL mail packet file formats.
File QWKFMT.ZIP from The Programmer’s Corner in
Category BBS Files
ILink discussions concerning QMAIL mail packet file formats.
File Name File Size Zip Size Zip Type
QWKFMT.TXT 16147 4413 deflated

Download File QWKFMT.ZIP Here

Contents of the QWKFMT.TXT file


==============================================================================
Date: 12-19-90 (22:37) Number: 14733 The Science Lab
To: CHRISTOPHER CAMACHO Refer#: NONE
From: RONALD RAIKES Read: YES
Subj: QWK/REP FORMATS Conf: (19) C-Lang
------------------------------------------------------------------------
CC> Can anyone tell me about the QWK/REP formats? Are they non-copyrighted
CC>unlike the UTI formats? Are they documented SOMEWHERE?! I've been
CC>trying to find something out about QWK/REP for months now with not even
CC>ONE answer!

Christopher,

Here's some info I captured from one of the Ilink conferences several months
back. It's not 100% complete, but it was sufficient to allow me to write my
own mail reader.

The following is taken from DELUXE.DOC:



Appendix G: File formats for MESSAGES.DAT and INDEX files.

Many people have asked from time to time what file formats
are used by Qmail DeLuxe. The file formats used by Qmail
DeLuxe are based on the PCBoard 12.0 message base formats
from Clark Development Corporation. The following
information is provided for the "technically inclined."

All of the messages in a mail packet are contained in a file
named MESSAGES.DAT. The file's logical record length is 128
bytes. The first record of MESSAGES.DAT always contains
Sparkware's copyright notice produced by The Qmail Door.
Messages start in record #2 and use this format:

Starting Position,Length Description
------------------------ ----------------------------
1,1 Message status flag
2,7 Message number
9,8 Date (MM-DD-YY)
17,5 Time (HH:MM)
22,25 To
47,25 From
72,25 Subject
97,12 Password
109,8 Message reference number
117,6 Number of blocks
123,1 Message status
124,1 Conference number

The text of message continues in the next record. You can
find out how many blocks make up one message by looking at
the value of "Number of blocks". Message text is delimited
by a pi symbol (ASCII 227) between lines.

The xxx.NDX files contain record numbers that point into the
MESSAGES.DAT file for actual messages. Each conference that
contains messages has its own "xxx.NDX" file. The "xxx" is
the conference number for the index file.

Each .NDX file uses a five byte logical record length and is
formatted to:

Starting Position,Length Description
------------------------ ------------------------
1,4 Record number to
point to corresponding
message. This number is
in the Microsoft MKS$
BASIC format.
5,1 Conference number.



Here's a routine that will convert the 4 bytes of Microsoft MKS$ Basic format
to a long integer:

unsigned long mbf_to_int(m1,m2,m3,exp)
unsigned int m1,m2,m3,exp;
{
return(((m1 + ((unsigned long)m2 << 8) + ((unsigned long)m3 << 16)) |
0x800000L) >> (24 - (exp - 0x80)));
}

Good luck,
Ron
---
OBMR
QNet 2.04: ILink: The Holistic BBS Lakewood CA 213-531-3890 HST
==============================================================================
Date: 12-19-90 (13:02) Number: 14719 The Science Lab
To: CHRISTOPHER CAMACHO Refer#: NONE
From: ELLIOTT JACKSON Read: YES
Subj: QWK/REP FORMATS Conf: (19) C-Lang
------------------------------------------------------------------------
Wed Dec 19

CC Can anyone tell me about the QWK/REP formats? Are they non-copyrighted

Hello Chris,

The formats aren't (to my knowldedge) copyrighted. If you can
find the documentation for PCBoard 12.0+, the formats are
documented there. Additionally, I believe Mark Herring
documents the formats in the docs to his old QMAIL reader.

Basically, each message consists of a 128 byte header that
contains, among other things, the number of 128 byte blocks that
follow the header that contain the text of the message. After
the text of the message, you will find the next header for the
next message.

Here is the structure of the headers, from a very old set of
messages I saved between Jim Russell and Alan Cassel:

struct QMSG
{
char sts;
char msgnum[7]; /* notice the 7 char ASCII message num here! */
char msgdate[8];
char msgtime[5];
char to[25];
char from[25];
char subj[25];
char pword[12];
char refnum[8];
char numblks[6];
char actsw; /* 225 = active, 226 = inactive */
char conference; /* depends on door */
char reserved[4];
} qmsg;


give that a shot,
ej
---
EZ 1.33 #179 Are you sure? (Y/Y) :
ILink: MINX BBS Wichita, KS 316-721-3773 5 HST Nodes
==============================================================================
Date: 12-20-90 (18:14) Number: 14741 The Science Lab
To: CHRISTOPHER CAMACHO Refer#: NONE
From: JOSEPH CARNAGE Read: YES
Subj: QWK/REP FORMATS Conf: (19) C-Lang
------------------------------------------------------------------------
CC> Can anyone tell me about the QWK/REP formats? Are they
non-copyrighted unlike the UTI formats?


From the Carnage archives (not my code):

The .NDX aren't commented so I have no idea what are in them.

typedef struct QWKHeader {
unsigned char sts;
char messagenumber[7];
char messagedate[8];
char messagetime[5];
char to[25];
char from[25];
char subject[25];
char password[12];
char referencenumber[8];
char numberblocks[6];
unsigned char action;
unsigned char conference;
char reserved[2];
unsigned char echoflag;
char reserv2;
} QWKHeader;

union ut
{
float fl;
unsigned int b[4];
unsigned int u[2];
unsigned long ul;
};

#pragma pack(1)
struct {
union ut u;
unsigned int conference;
} ndxRec;
#pragma pack()

float msToFloat(float f) {
union ut u;
unsigned int sign;
unsigned int exp;

u.fl = f;
sign = (u.b[2] & 0x80) ? 0x8000 : 0x0000;
exp = ((u.u[1] & 0xff00) - 0x0200) >> 1;
u.u[1] = (u.u[1] & 0x007f) | sign | exp;

return(u.fl);
}
The first member of struct ndxRec is a 4-byte (SINGLE) MS BASIC
floating point number. It can be converted with msToFloat().

PS, if you figure out the ndx file, please tell me.
0123456789ABCDEF
0000 20 39 38 34 30 20 20 20-30 32 2D 31 36 2D 39 30 9840 02-16-90
0010 30 35 3A 35 33 54 49 4D-20 52 4F 53 53 49 54 45 05:53TIM ROSSITE
0020 52 20 20 20 20 20 20 20-20 20 20 20 20 20 44 4F R DO
0030 55 47 20 4D 41 43 4C 45-41 4E 20 20 20 20 20 20 UG MACLEAN
0040 20 20 20 20 20 20 20 41-42 55 53 49 56 45 20 55 ABUSIVE U
0050 53 45 52 20 20 20 20 20-20 20 20 20 20 20 20 20 SER
0060 20 20 20 20 20 20 20 20-20 20 20 20 39 37 32 35 9725
0070 20 20 20 20 20 35 20 20-20 20 E1 01 20 20 20 20 5
0123456789ABCDEF
The above is a sample header block within the QWK file.

Offset Length Purpose
--------------------------------------------------------------------
00 01 Private/Read/Not read
space means the mail has been read
- means not read
+ means R/O
01 07 Message number (character)
08 08 Date (mm-dd-yy)
10 05 Time (hh:mm)
15 25 To (character)
2E 25 From (character)
47 25 Subject (character)
60 12 Password (?)
6C 08 Refer to number (character)
73 06 Number of 128 byte blocks in message (including
the header block, i.e. the shortest message
has 2 blocks in it.)
7A 01 Killed message? 225 is active, 226 is killed
7B 01 Conference number (0-255) - This may have been
changed because Eric is using two bytes for
it, check with him first.
7C 04 Reserved (?)

----------------(*)
---
SM 1.00 ----- Cockroaches rule the Earth. Pass it on.
RNet 1.05J:ILink: SPPE St Petersburg,FL 813-527-5666 & 525-2326
==============================================================================
Date: 12-21-90 (23:11) Number: 14747 The Science Lab
To: CHRISTOPHER CAMACHO Refer#: NONE
From: TEAGUE SHERIDAN Read: YES
Subj: QWK/REP FORMATS Conf: (19) C-Lang
------------------------------------------------------------------------
CC> Can anyone tell me about the QWK/REP formats? Are they non-copyrighted
CC>unlike the UTI formats? Are they documented SOMEWHERE?! I've been
CC>trying to find something out about QWK/REP for months now with not even
CC>ONE answer!

I've found the following info on my own, but they might not be correct.


XXXXXXXX.RD
XXXXXXXX if the conference number
In it, there are 's for every message read, all in a row. Sample for a
file that is 16 bytes long, hence 16 messages:
{END}


CONTROL.DAT
Line Function
1 BBS Name
2 BBS Address
3 Phone Number of BBS
4 Sysop
5 BBS ID, Interlink name (??? On this one)
6 Date Called, Time Called
7 Full User Name, in CAPS
8 ????
9 ????
10 ????
11 ????
12 Conference number
13 Conference name
. ..etc for all confs
.
.
14 Filename of welcome message
15 News filename
16 Filename of goodbye message
17 ????
18 ????
19 Full Name of user (CAPS)
20 First name, mixed caps
21 Calling from
22 Business/data phone
23 Home/voice phone
24 Security level
25 Expiration date
26 Date last called (Date of packet download)
27 Time of packet download
28 Times called
29 Current Conf
30 Total K bytes downloaded
31 Total files downloaded
32 Total K bytes uploaded
33 Total files uploaded
34 Total minutes per day
35 Minutes left
36 Minutes used
37 Download K byte allowance per day
38 K bytes left
39 K bytes used
40 ????
41 ????
42 BBS Name
43 ????


BLT-{CONF}.XXX
{CONF} is the conference number
XXX if the bulletin number
Straight ASCII - just print it on the screen


MESSAGES.DAT
130 chars of junk at start of file

(ASCII #227) is a carriage return
Length Item
7 Message Number
8 Date (MM/DD/YY)
5 Time (HH:MM)
25 To
25 From
The rest ?????


Hope this helps...
---
EZ 1.33 Error in address 0000:01B8 of module EZREADER
ILink Compu-Data Turnersville, NJ
==============================================================================
Date: 12-21-90 (17:19) Number: 14760 The Science Lab
To: MICHAEL STEWART Refer#: NONE
From: JOSEPH CARNAGE Read: YES
Subj: QWK/REP FORMATS Conf: (19) C-Lang
------------------------------------------------------------------------
MS>I haven't been able to find out too much about QWK/REP formats . .
. I am currently during further investigation and will keep you
informed.


From the Carnage Archives (not my code):

typedef struct QWKHeader {
unsigned char sts;
char messagenumber[7];
char messagedate[8];
char messagetime[5];
char to[25];
char from[25];
char subject[25];
char password[12];
char referencenumber[8];
char numberblocks[6];
unsigned char action;
unsigned char conference;
char reserved[2];
unsigned char echoflag;
char reserv2;
} QWKHeader;

union ut {
float fl;
unsigned int b[4];
unsigned int u[2];
unsigned long ul;
};

#pragma pack(1)
struct {
union ut u;
unsigned int conference;
} ndxRec;
#pragma pack()

float msToFloat (float f) {
union ut u;
unsigned int sign;
unsigned int exp;

u.fl = f;
sign = (u.b[2] & 0x80) ? 0x8000 : 0x0000;
exp = ((u.u[1] & 0xff00) - 0x0200) >> 1;
u.u[1] = (u.u[1] & 0x007f) | sign | exp;

return(u.fl);
}

The first member of struct ndxRec is a 4-byte (SINGLE) MS BASIC
floating point number. It can be converted with msToFloat().

PS, if you figure out the ndx file, please tell me.

0123456789ABCDEF
0000 20 39 38 34 30 20 20 20-30 32 2D 31 36 2D 39 30 9840 02-16-90
0010 30 35 3A 35 33 54 49 4D-20 52 4F 53 53 49 54 45 05:53TIM ROSSITE
0020 52 20 20 20 20 20 20 20-20 20 20 20 20 20 44 4F R DO
0030 55 47 20 4D 41 43 4C 45-41 4E 20 20 20 20 20 20 UG MACLEAN
0040 20 20 20 20 20 20 20 41-42 55 53 49 56 45 20 55 ABUSIVE U
0050 53 45 52 20 20 20 20 20-20 20 20 20 20 20 20 20 SER
0060 20 20 20 20 20 20 20 20-20 20 20 20 39 37 32 35 9725
0070 20 20 20 20 20 35 20 20-20 20 E1 01 20 20 20 20 5
0123456789ABCDEF
The above is a sample header block within the QWK file.

Offset Length Purpose
--------------------------------------------------------------------
00 01 Private/Read/Not read
space means the mail has been read
- means not read
+ means R/O
01 07 Message number (character)
08 08 Date (mm-dd-yy)
10 05 Time (hh:mm)
15 25 To (character)
2E 25 From (character)
47 25 Subject (character)
60 12 Password (?)
6C 08 Refer to number (character)
73 06 Number of 128 byte blocks in message (including
the header block, i.e. the shortest message
has 2 blocks in it.)
7A 01 Killed message? 225 is active, 226 is killed
7B 01 Conference number (0-255) - This may have been
changed because Eric is using two bytes for
it, check with him first.
7C 04 Reserved (?)

----------------(*)
---
SM 1.00 ----- Today is tomorrow's yesterday.
RNet 1.05J:ILink: SPPE St Petersburg,FL 813-527-5666 & 525-2326


 December 26, 2017  Add comments

Leave a Reply