Mail V Developer Information

The source of Mail V is available here.

To take advantage of it you will need the Newton Toolkit for the NewtonScript part, and MPW for the C++ part. Since these tools were built in the age of the 680x0 processor, you will also need an emulator such as BasiliskII to run them on a current intel Macintosh.

Download Source

If you’ve worked on SimpleMail before, you’ll find the format of Mail V InOut entries has changed somewhat from the SimpleMail format. In particular, MIME information is held differently. Media decoders are now built in to the appropriate stationery. The SimpleMail SDK documentation is therefore out of date.

Exported Functions

Audio Stationery

The Audio Stationery package exports its decoding function as a unit. You will need to declare the unit as follows:

DeclareUnit('audio, 1, 0, { Decode: 0 } );

Then you can refer to the decode function:

DecodeAudioFn := UnitReference('audio, 'Decode);
sound := call DecodeAudioFn with (data, store);

data A binary object of class 'basic, 'aifc, 'aiff, 'wav or 'gsm. These symbols correspond to MIME audio types; 'basic is muLaw encoding.
store The store on which to create a VBO for the Newton sound samples. Pass nil to store the sound in the heap.

The function returns a Newton sound frame (Newton Programmer’s Guide: 2.1 OS Addendum, Sound Reference, 7-28), or nil if the format is not supported.

Image Stationery

The Image Stationery package similarly exports its decoding function as a unit. You will need to declare the unit as follows:

DeclareUnit('image, 1, 0, { Decode: 0 } );

Then you can refer to the decode function:

DecodeImageFn := UnitReference('image, 'Decode);
pix := call DecodeImageFn with (data, store);

data A binary object of class 'gif, 'jpeg, 'pict, 'png or 'tiff. These symbols correspond to MIME image types.
store The store on which to create a VBO for the Newton bitmap data. Pass nil to store the image in the heap.

The function returns a Newton bitmap frame as would be returned by MakeBitmap(); its data slot is a binary object of class 'pixels which is a PixelMap.

Mail V Hooks

Junk Mail Filter

Junk mail is not handled by Mail V. However, there is a hook allowing experimentation with various filtering mechanisms. Mail V can be patched as follows:

GetRoot().|mail:simple|.ItemIsJunk := func(item) ... ;

item is an iobox item. Its envelope information has been completed, so the recipients, subject and body structure can be examined, but at this stage no message body has been retrieved. If ItemIsJunk returns non-nil, the item is ignored.