Path: bin/experimental-deliver.rb
Modified: Tue Feb 04 21:09:20 MST 2003

This script delivers a mail message taken from stdin to a mail queue, and then starts the mail filter program if it isn't already running.


deliver.rb is invoked from the command line using:

  % deliver.rb <options>

Options are:

--load-path:Prepend the given directory to ruby's load path.
--log filename:Log to the given filename. If no log is specified, no logging occurs.
--home directory:Specify the home directory. rdeliver will change to this directory before reading and writing any files. The home directory defaults to the value of the HOME or LOGDIR environment variable.


Assuming you have the RubyMail mail classes installed, you typically have to put something like this in your .forward file:

   |"/usr/local/bin/deliver.rb --log /home/you/.rlog"

This will call rdeliver for each new message you get, and log to /home/you/.rlog.

Catastrophic Errors

The deliver.rb script is very careful with errors. If there is any problem, it logs the error to the log file you specify. But if you do not specify a log file, or the error occurs before the log file is opened, a record of the error is placed in a file called CATASTROPHIC_DELIVERY_FAILURE in the home directory. If that fails, the error information is printed to the standard output in the hopes that it will be part of a bounce message. In all cases, the exit code 75 is returned, which tells the MTA to re-try the delivery again.

Required files
getoptlong    rfilter/deliver   
Included modules
Public Instance methods