fml sends back a mail message
Mail::Delivery::Queue class inserts a message to send back into the
mail queue. Later FML::Process::QueueManager handles the real delivery
process.
How to write
use like this:
$curproc->reply_message( "you are not a ML member." );
If no recipient specified, the recipient is the sender of the message
(From: address).
To send a file, like this:
$curproc->reply_message( {
type => "text/plain; charset=iso-2022-jp",
path => "/etc/fml/main.cf",
filename => "main.cf",
disposition => "main.cf example",
});
$curproc->reply_message( {
type => "image/gif",
path => "/some/where/logo001.gif",
filename => "logo.gif",
disposition => "attachment",
});
mail queue and delivery system
FML::Process::QueueManager pick up one queue from the queue directory.
Mail::Message parses it.
Mail::Delivery process the real delivery via FML::Mailer.
Mail::Delivery::Queue
|
| ---> queue directory
V
FML::Process::QueueManager
|
| <--- queue directory
V
FML::Mailer
|
V
Mail::Delivery
mail queue directory
The queue directory consists of the following plural directories:
new/
active/
deferred/
info/sender/
info/recipients/
info/ stores envelope information
In creating a new queue file,
make a temporary file in new/ once.
When the delivery preparation is ended,
move the queue from new/ to active/.
Hence files under active/ is delivery ready.
lock the queue
When we need to handle the specific queue file,
use lock()/unlock() method for each $queue_id object.
lock algorithm is based on flock(2) for the file.