one of the documented procedures in this installation of the ACS
bulkmail_queue_message   message
What it does:
Handle the queuing of a message
Defined in: /web/philip/tcl/bulkmail-utils.tcl

Source code:

    ns_share bulkmail_message_queue_mutex
    ns_share bulkmail_message_queue
    ns_share bulkmail_threads_sema

    ns_mutex lock $bulkmail_message_queue_mutex

    # Following the example in the docs, let's wrap all activities in
    # a catch so an error won't leave things locked
    if { [catch {
	lappend bulkmail_message_queue $message

	# Check to see if we've reached our threshold
	if { [llength $bulkmail_message_queue] >= [bulkmail_queue_threshold] } {
	    # If we have, we want to process the queue

    } errmsg] } {
	ns_log Notice "Caught error: $errmsg" 
    ns_mutex unlock $bulkmail_message_queue_mutex

    bulkmail_record_queued_message [bulkmail_message_bulkmail_id $message]