File 'net/smtp/spooler.cls' (part of 'Pool_Net')

Description (short)
SMTP based spooler.
Written by
Andreas Kupries
Description
SMTP based spooler of outbound mail (found in files in halfbaked SMTP format).
Keywords
SMTP, spooler

Class 'smtpSpooler'

Description
Implements a file and directory based spooler for mails. See start for more. Uses smtpConnection to do the real work.
Options
host
helo
from
n
command
Methods
public
AllDone (conn)
Done (file conn)
SpoolMessage ()
start (flist)
Membervariables
public
active
msgFiles

Options

-host
The name of the host the smtp demon is running on.
default value: localhost
-helo
The initial string to send to the smtp demon
default value: bluepeak.westend.com
-from
The address of the sender.
-n
The number of simultaneously open connections to the smtp demon.
default value: 1
-command
The script to evaluate after the last mail was sent down the line.

Methods

AllDone (conn)

Called by conn after the channel to the smtp demon was closed. Simply destroys the connection
Argument: conn The smtpConnection in shutdown, to destroy.

Done (file conn)

Executed after SMTP transfer of file is finished. Removes the file in case of success. Always initiates the transfer of the next file.
Argument: file Name of the file transfered to the outside world.
Argument: conn Name of the used smtp descriptor array.

SpoolMessage ()

Initiates a SMTP session for the first message in the queue.

start (flist)

All specified files are forwarded to the given site, using the SMTP protocol. Files successfully transfered are deleted afterward. A partial transfer is enough to do so.
Notes: This procedure assumes that the files are in HB-SMTP format (half baked SMTP), as generated by the smail MTA. In such files the message is prepended with MAIL FROM, RCPT TO, DATA commands, and the standard EOM-indicator (. on a single line line) is appended.
Argument: flist List of files to transfer.


Membervariables

active
Boolean flag locking the object against multiple starts.
initial value: 0
msgFiles
Contains the list of files containing the mails to sent to the smtp demon. Can be seens as a task queue as well, as it will be shortened during the operation.

Generated by AutoDoc 2.4 at 09/14/2000, invoked by Andreas Kupries