1Mail::Box::Dir::MessageU(s3e)r Contributed Perl DocumentaMtaiioln::Box::Dir::Message(3)
2
3
4

NAME

6       Mail::Box::Dir::Message - one message in a directory organized folder
7

INHERITANCE

9        Mail::Box::Dir::Message
10          is a Mail::Box::Message
11          is a Mail::Message
12          is a Mail::Reporter
13
14        Mail::Box::Dir::Message is extended by
15          Mail::Box::MH::Message
16          Mail::Box::Maildir::Message
17

SYNOPSIS

19        my $folder = new Mail::Box::MH ...
20        my $message = $folder->message(10);
21

DESCRIPTION

23       A "Mail::Box::Dir::Message" is a base class for one message in a
24       directory organized folder; each message is stored in a separate file.
25       There are no objects of type "Mail::Box::Dir::Message", only extensions
26       are allowed to be created.
27
28       At the moment, three of these extended message types are implemented:
29
30       ·   Mail::Box::MH::Message
31
32           which represents one message in a Mail::Box::MH folder.  MH folders
33           are very, very simple.... and hence not sophisticated nor fast.
34
35       ·   Mail::Box::Maildir::Message
36
37           which represents one message in a Mail::Box::Maildir folder.  Flags
38           are kept in the message's filename.  It is stateless, so you will
39           never loose a message.
40
41       ·   Mail::Box::Netzwert::Message
42
43           which represents one message in a Mail::Box::Netzwert folder.  As
44           advantage, it stores pre-parsed information in the message file.
45           As disadvantage: the code is not GPLed (yet).
46

METHODS

48   Constructors
49       $obj->clone(OPTIONS)
50           See "Constructors" in Mail::Message
51
52       Mail::Box::Dir::Message->new(OPTIONS)
53           Create a messages in a directory organized folder.
54
55            -Option    --Defined in     --Default
56             body        Mail::Message    undef
57             body_type   Mail::Box::Message  <from folder>
58             deleted     Mail::Message    <false>
59             field_type  Mail::Message    undef
60             filename                     undef
61             fix_header                   false
62             folder      Mail::Box::Message  <required>
63             head        Mail::Message    undef
64             head_type   Mail::Message    Mail::Message::Head::Complete
65             labels      Mail::Message    {}
66             log         Mail::Reporter   'WARNINGS'
67             messageId   Mail::Message    undef
68             modified    Mail::Message    <false>
69             size        Mail::Box::Message  undef
70             trace       Mail::Reporter   'WARNINGS'
71             trusted     Mail::Message    <false>
72
73           body => OBJECT
74           body_type => CODE|CLASS
75           deleted => BOOLEAN
76           field_type => CLASS
77           filename => FILENAME
78             The file where the message is stored in.
79
80           fix_header => BOOLEAN
81             See Mail::Box::new(fix_headers).
82
83           folder => FOLDER
84           head => OBJECT
85           head_type => CLASS
86           labels => ARRAY|HASH
87           log => LEVEL
88           messageId => STRING
89           modified => BOOLEAN
90           size => INTEGER
91           trace => LEVEL
92           trusted => BOOLEAN
93
94   Constructing a message
95       $obj->bounce([RG-OBJECT|OPTIONS])
96           See "Constructing a message" in Mail::Message::Construct::Bounce
97
98       Mail::Box::Dir::Message->build([MESSAGE|PART|BODY], CONTENT)
99           See "Constructing a message" in Mail::Message::Construct::Build
100
101       Mail::Box::Dir::Message->buildFromBody(BODY, [HEAD], HEADERS)
102           See "Constructing a message" in Mail::Message::Construct::Build
103
104       $obj->forward(OPTIONS)
105           See "Constructing a message" in Mail::Message::Construct::Forward
106
107       $obj->forwardAttach(OPTIONS)
108           See "Constructing a message" in Mail::Message::Construct::Forward
109
110       $obj->forwardEncapsulate(OPTIONS)
111           See "Constructing a message" in Mail::Message::Construct::Forward
112
113       $obj->forwardInline(OPTIONS)
114           See "Constructing a message" in Mail::Message::Construct::Forward
115
116       $obj->forwardNo(OPTIONS)
117           See "Constructing a message" in Mail::Message::Construct::Forward
118
119       $obj->forwardPostlude
120           See "Constructing a message" in Mail::Message::Construct::Forward
121
122       $obj->forwardPrelude
123           See "Constructing a message" in Mail::Message::Construct::Forward
124
125       $obj->forwardSubject(STRING)
126           See "Constructing a message" in Mail::Message::Construct::Forward
127
128       Mail::Box::Dir::Message->read(FILEHANDLE|SCALAR|REF-SCALAR|ARRAY-OF-LINES,
129       OPTIONS)
130           See "Constructing a message" in Mail::Message::Construct::Read
131
132       $obj->rebuild(OPTIONS)
133           See "Constructing a message" in Mail::Message::Construct::Rebuild
134
135       $obj->reply(OPTIONS)
136           See "Constructing a message" in Mail::Message::Construct::Reply
137
138       $obj->replyPrelude([STRING|FIELD|ADDRESS|ARRAY-OF-THINGS])
139           See "Constructing a message" in Mail::Message::Construct::Reply
140
141       $obj->replySubject(STRING)
142           Mail::Box::Dir::Message->replySubject(STRING)
143
144           See "Constructing a message" in Mail::Message::Construct::Reply
145
146   The message
147       $obj->container
148           See "The message" in Mail::Message
149
150       $obj->copyTo(FOLDER, OPTIONS)
151           See "The message" in Mail::Box::Message
152
153       $obj->filename([FILENAME])
154           Returns the name of the file in which this message is actually
155           stored.  This will return "undef" when the message is not stored in
156           a file.
157
158       $obj->folder([FOLDER])
159           See "The message" in Mail::Box::Message
160
161       $obj->isDummy
162           See "The message" in Mail::Message
163
164       $obj->isPart
165           See "The message" in Mail::Message
166
167       $obj->messageId
168           See "The message" in Mail::Message
169
170       $obj->moveTo(FOLDER, OPTIONS)
171           See "The message" in Mail::Box::Message
172
173       $obj->print([FILEHANDLE])
174           See "The message" in Mail::Message
175
176       $obj->send([MAILER], OPTIONS)
177           See "The message" in Mail::Message
178
179       $obj->seqnr([INTEGER])
180           See "The message" in Mail::Box::Message
181
182       $obj->size
183           See "The message" in Mail::Message
184
185       $obj->toplevel
186           See "The message" in Mail::Message
187
188       $obj->write([FILEHANDLE])
189           See "The message" in Mail::Message
190
191   The header
192       $obj->bcc
193           See "The header" in Mail::Message
194
195       $obj->cc
196           See "The header" in Mail::Message
197
198       $obj->date
199           See "The header" in Mail::Message
200
201       $obj->destinations
202           See "The header" in Mail::Message
203
204       $obj->from
205           See "The header" in Mail::Message
206
207       $obj->get(FIELDNAME)
208           See "The header" in Mail::Message
209
210       $obj->guessTimestamp
211           See "The header" in Mail::Message
212
213       $obj->head([HEAD])
214           See "The header" in Mail::Message
215
216       $obj->nrLines
217           See "The header" in Mail::Message
218
219       $obj->sender
220           See "The header" in Mail::Message
221
222       $obj->study(FIELDNAME)
223           See "The header" in Mail::Message
224
225       $obj->subject
226           See "The header" in Mail::Message
227
228       $obj->timestamp
229           See "The header" in Mail::Message
230
231       $obj->to
232           See "The header" in Mail::Message
233
234   The body
235       $obj->body([BODY])
236           See "The body" in Mail::Message
237
238       $obj->contentType
239           See "The body" in Mail::Message
240
241       $obj->decoded(OPTIONS)
242           See "The body" in Mail::Message
243
244       $obj->encode(OPTIONS)
245           See "The body" in Mail::Message
246
247       $obj->isMultipart
248           See "The body" in Mail::Message
249
250       $obj->isNested
251           See "The body" in Mail::Message
252
253       $obj->parts(['ALL'|'ACTIVE'|'DELETED'|'RECURSE'|FILTER])
254           See "The body" in Mail::Message
255
256   Flags
257       $obj->delete
258           See "Flags" in Mail::Message
259
260       $obj->deleted([BOOLEAN])
261           See "Flags" in Mail::Message
262
263       $obj->isDeleted
264           See "Flags" in Mail::Message
265
266       $obj->isModified
267           See "Flags" in Mail::Message
268
269       $obj->label(LABEL|PAIRS)
270           See "Flags" in Mail::Message
271
272       $obj->labels
273           See "Flags" in Mail::Message
274
275       $obj->labelsToStatus
276           See "Flags" in Mail::Message
277
278       $obj->modified([BOOLEAN])
279           See "Flags" in Mail::Message
280
281       $obj->statusToLabels
282           See "Flags" in Mail::Message
283
284   The whole message as text
285       $obj->file
286           See "The whole message as text" in Mail::Message::Construct::Text
287
288       $obj->lines
289           See "The whole message as text" in Mail::Message::Construct::Text
290
291       $obj->printStructure([FILEHANDLE|undef],[INDENT])
292           See "The whole message as text" in Mail::Message::Construct::Text
293
294       $obj->string
295           See "The whole message as text" in Mail::Message::Construct::Text
296
297   Internals
298       $obj->clonedFrom
299           See "Internals" in Mail::Message
300
301       Mail::Box::Dir::Message->coerce(MESSAGE, OPTIONS)
302           See "Internals" in Mail::Message
303
304       $obj->create(FILENAME)
305           Create the message in the specified file.  If the message already
306           has a filename and is not modified, then a move is tried.
307           Otherwise the message is printed to the file.  If the FILENAME
308           already exists for this message, nothing is done.  In any case, the
309           new FILENAME is set as well.
310
311       $obj->diskDelete
312           See "Internals" in Mail::Box::Message
313
314       $obj->isDelayed
315           See "Internals" in Mail::Message
316
317       $obj->loadBody
318           This method is called by the autoloader when the body of the
319           message is needed.
320
321       $obj->loadHead
322           This method is called by the autoloader when the header of the
323           message is needed.
324
325       $obj->parser
326           Create and return a parser for this message (-file).
327
328       $obj->readBody(PARSER, HEAD [, BODYTYPE])
329           See "Internals" in Mail::Box::Message
330
331       $obj->readFromParser(PARSER, [BODYTYPE])
332           See "Internals" in Mail::Message
333
334       $obj->readHead(PARSER [,CLASS])
335           See "Internals" in Mail::Message
336
337       $obj->recursiveRebuildPart(PART, OPTIONS)
338           See "Internals" in Mail::Message::Construct::Rebuild
339
340       $obj->storeBody(BODY)
341           See "Internals" in Mail::Message
342
343       $obj->takeMessageId([STRING])
344           See "Internals" in Mail::Message
345
346   Error handling
347       $obj->AUTOLOAD
348           See "METHODS" in Mail::Message::Construct
349
350       $obj->addReport(OBJECT)
351           See "Error handling" in Mail::Reporter
352
353       $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
354           Mail::Box::Dir::Message->defaultTrace([LEVEL]|[LOGLEVEL,
355           TRACELEVEL]|[LEVEL, CALLBACK])
356
357           See "Error handling" in Mail::Reporter
358
359       $obj->errors
360           See "Error handling" in Mail::Reporter
361
362       $obj->log([LEVEL [,STRINGS]])
363           Mail::Box::Dir::Message->log([LEVEL [,STRINGS]])
364
365           See "Error handling" in Mail::Reporter
366
367       $obj->logPriority(LEVEL)
368           Mail::Box::Dir::Message->logPriority(LEVEL)
369
370           See "Error handling" in Mail::Reporter
371
372       $obj->logSettings
373           See "Error handling" in Mail::Reporter
374
375       $obj->notImplemented
376           See "Error handling" in Mail::Reporter
377
378       $obj->report([LEVEL])
379           See "Error handling" in Mail::Reporter
380
381       $obj->reportAll([LEVEL])
382           See "Error handling" in Mail::Reporter
383
384       $obj->shortSize([VALUE])
385           Mail::Box::Dir::Message->shortSize([VALUE])
386
387           See "Error handling" in Mail::Message
388
389       $obj->shortString
390           See "Error handling" in Mail::Message
391
392       $obj->trace([LEVEL])
393           See "Error handling" in Mail::Reporter
394
395       $obj->warnings
396           See "Error handling" in Mail::Reporter
397
398   Cleanup
399       $obj->DESTROY
400           See "Cleanup" in Mail::Message
401
402       $obj->destruct
403           See "Cleanup" in Mail::Box::Message
404
405       $obj->inGlobalDestruction
406           See "Cleanup" in Mail::Reporter
407

DIAGNOSTICS

409       Error: Cannot coerce a $class object into a $class object
410       Error: Cannot create parser for $filename.
411           For some reason (the previous message have told you already) it was
412           not possible to create a message parser for the specified filename.
413
414       Error: Cannot include forward source as $include.
415           Unknown alternative for the forward(include).  Valid choices are
416           "NO", "INLINE", "ATTACH", and "ENCAPSULATE".
417
418       Error: Cannot include reply source as $include.
419           Unknown alternative for the "include" option of reply().  Valid
420           choices are "NO", "INLINE", and "ATTACH".
421
422       Error: Cannot write message to $filename: $!
423           When a modified or new message is written to disk, it is first
424           written to a temporary file in the folder directory.  For some
425           reason, it is impossible to create this file.
426
427       Error: Failed to move $new to $filename: $!
428           When a modified or new message is written to disk, it is first
429           written to a temporary file in the folder directory.  Then, the new
430           file is moved to replace the existing file.  Apparently, the latter
431           fails.
432
433       Error: Method bounce requires To, Cc, or Bcc
434           The message bounce() method forwards a received message off to
435           someone else without modification; you must specified it's new
436           destination.  If you have the urge not to specify any destination,
437           you probably are looking for reply(). When you wish to modify the
438           content, use forward().
439
440       Error: Method forwardAttach requires a preamble
441       Error: Method forwardEncapsulate requires a preamble
442       Error: No address to create forwarded to.
443           If a forward message is created, a destination address must be
444           specified.
445
446       Error: No default mailer found to send message.
447           The message send() mechanism had not enough information to
448           automatically find a mail transfer agent to sent this message.
449           Specify a mailer explicitly using the "via" options.
450
451       Error: No rebuild rule $name defined.
452       Error: Only build() Mail::Message's; they are not in a folder yet
453           You may wish to construct a message to be stored in a some kind of
454           folder, but you need to do that in two steps.  First, create a
455           normal Mail::Message, and then add it to the folder.  During this
456           Mail::Box::addMessage() process, the message will get coerce()-d
457           into the right message type, adding storage information and the
458           like.
459
460       Error: Package $package does not implement $method.
461           Fatal error: the specific package (or one of its superclasses) does
462           not implement this method where it should. This message means that
463           some other related classes do implement this method however the
464           class at hand does not.  Probably you should investigate this and
465           probably inform the author of the package.
466
467       Error: Unable to read delayed body.
468           For some reason, the header of the message could be read, but the
469           body cannot.  Probably the file has disappeared or the permissions
470           were changed during the progress of the program.
471
472       Error: Unable to read delayed head.
473           Mail::Box tries to be lazy with respect to parsing messages.  When
474           a directory organized folder is opened, only the filenames of
475           messages are collected.  At first use, the messages are read from
476           their file.  Apperently, a message is used for the first time here,
477           but has disappeared or is unreadible for some other reason.
478
479       Error: coercion starts with some object
480

SEE ALSO

482       This module is part of Mail-Box distribution version 2.097, built on
483       January 26, 2011. Website: http://perl.overmeer.net/mailbox/
484

LICENSE

486       Copyrights 2001-2011 by Mark Overmeer. For other contributors see
487       ChangeLog.
488
489       This program is free software; you can redistribute it and/or modify it
490       under the same terms as Perl itself.  See
491       http://www.perl.com/perl/misc/Artistic.html
492
493
494
495perl v5.12.3                      2011-01-26        Mail::Box::Dir::Message(3)
Impressum