1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
<!--
$FML$
$jaFML: queue.sgml,v 1.3 2003/04/15 14:51:37 fukachan Exp $
-->
<sect1 id="message.reply">
<TITLE>
fml sends back a mail message
</TITLE>
<para>
Mail::Delivery::Queue class inserts a message to send back into the
mail queue. Later FML::Process::QueueManager handles the real delivery
process.
</para>
<sect2>
<title>
How to write
</title>
<para>
use like this:
<screen>
$curproc->reply_message( "you are not a ML member." );
</screen>
If no recipient specified, the recipient is the sender of the message
(From: address).
</para>
<para>
To send a file, like this:
<screen>
$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",
});
</screen>
</para>
</sect2>
</sect1>
<sect1 id="message.queue">
<TITLE>
mail queue and delivery system
</TITLE>
<para>
FML::Process::QueueManager pick up one queue from the queue directory.
Mail::Message parses it.
Mail::Delivery process the real delivery via FML::Mailer.
<screen>
Mail::Delivery::Queue
|
| ---> queue directory
V
FML::Process::QueueManager
|
| <--- queue directory
V
FML::Mailer
|
V
Mail::Delivery
</screen>
</para>
</sect1>
<sect1>
<TITLE>
mail queue directory
</TITLE>
<para>
The queue directory consists of the following plural directories:
<screen>
new/
active/
deferred/
info/sender/
info/recipients/
</screen>
info/ stores envelope information
</para>
<para>
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.
</para>
<sect2>
<title>
lock the queue
</title>
<para>
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.
</para>
</sect2>
</sect1>
|