1Mail::Box::Dir::MessageU(s3e)r Contributed Perl DocumentaMtaiioln::Box::Dir::Message(3)
2
3
4
6 Mail::Box::Dir::Message - one message in a directory organized folder
7
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
19 my $folder = new Mail::Box::MH ...
20 my $message = $folder->message(10);
21
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
47 Extends "DESCRIPTION" in Mail::Box::Message.
48
50 Extends "METHODS" in Mail::Box::Message.
51
52 Constructors
53 Extends "Constructors" in Mail::Box::Message.
54
55 $obj->clone(%options)
56 Inherited, see "Constructors" in Mail::Message
57
58 Mail::Box::Dir::Message->new(%options)
59 Create a messages in a directory organized folder.
60
61 -Option --Defined in --Default
62 body Mail::Message undef
63 body_type Mail::Box::Message <from folder>
64 deleted Mail::Message <false>
65 field_type Mail::Message undef
66 filename undef
67 fix_header false
68 folder Mail::Box::Message <required>
69 head Mail::Message undef
70 head_type Mail::Message Mail::Message::Head::Complete
71 labels Mail::Message {}
72 log Mail::Reporter 'WARNINGS'
73 messageId Mail::Message undef
74 modified Mail::Message <false>
75 size Mail::Box::Message undef
76 trace Mail::Reporter 'WARNINGS'
77 trusted Mail::Message <false>
78
79 body => OBJECT
80 body_type => CODE|CLASS
81 deleted => BOOLEAN
82 field_type => CLASS
83 filename => FILENAME
84 The file where the message is stored in.
85
86 fix_header => BOOLEAN
87 See Mail::Box::new(fix_headers).
88
89 folder => FOLDER
90 head => OBJECT
91 head_type => CLASS
92 labels => ARRAY|HASH
93 log => LEVEL
94 messageId => STRING
95 modified => BOOLEAN
96 size => INTEGER
97 trace => LEVEL
98 trusted => BOOLEAN
99
100 Constructing a message
101 Extends "Constructing a message" in Mail::Box::Message.
102
103 $obj->bounce( [<$rg_object|%options>] )
104 Inherited, see "Constructing a message" in
105 Mail::Message::Construct::Bounce
106
107 Mail::Box::Dir::Message->build( [$message|$part|$body], $content )
108 Inherited, see "Constructing a message" in
109 Mail::Message::Construct::Build
110
111 Mail::Box::Dir::Message->buildFromBody($body, [$head], $headers)
112 Inherited, see "Constructing a message" in
113 Mail::Message::Construct::Build
114
115 $obj->forward(%options)
116 Inherited, see "Constructing a message" in
117 Mail::Message::Construct::Forward
118
119 $obj->forwardAttach(%options)
120 Inherited, see "Constructing a message" in
121 Mail::Message::Construct::Forward
122
123 $obj->forwardEncapsulate(%options)
124 Inherited, see "Constructing a message" in
125 Mail::Message::Construct::Forward
126
127 $obj->forwardInline(%options)
128 Inherited, see "Constructing a message" in
129 Mail::Message::Construct::Forward
130
131 $obj->forwardNo(%options)
132 Inherited, see "Constructing a message" in
133 Mail::Message::Construct::Forward
134
135 $obj->forwardPostlude()
136 Inherited, see "Constructing a message" in
137 Mail::Message::Construct::Forward
138
139 $obj->forwardPrelude()
140 Inherited, see "Constructing a message" in
141 Mail::Message::Construct::Forward
142
143 $obj->forwardSubject(STRING)
144 Inherited, see "Constructing a message" in
145 Mail::Message::Construct::Forward
146
147 Mail::Box::Dir::Message->read($fh|STRING|SCALAR|ARRAY, %options)
148 Inherited, see "Constructing a message" in
149 Mail::Message::Construct::Read
150
151 $obj->rebuild(%options)
152 Inherited, see "Constructing a message" in
153 Mail::Message::Construct::Rebuild
154
155 $obj->reply(%options)
156 Inherited, see "Constructing a message" in
157 Mail::Message::Construct::Reply
158
159 $obj->replyPrelude( [STRING|$field|$address|ARRAY-$of-$things] )
160 Inherited, see "Constructing a message" in
161 Mail::Message::Construct::Reply
162
163 $obj->replySubject(STRING)
164 Mail::Box::Dir::Message->replySubject(STRING)
165 Inherited, see "Constructing a message" in
166 Mail::Message::Construct::Reply
167
168 The message
169 Extends "The message" in Mail::Box::Message.
170
171 $obj->container()
172 Inherited, see "The message" in Mail::Message
173
174 $obj->copyTo($folder, %options)
175 Inherited, see "The message" in Mail::Box::Message
176
177 $obj->filename( [$filename] )
178 Returns the name of the file in which this message is actually
179 stored. This will return "undef" when the message is not stored in
180 a file.
181
182 $obj->folder( [$folder] )
183 Inherited, see "The message" in Mail::Box::Message
184
185 $obj->isDummy()
186 Inherited, see "The message" in Mail::Message
187
188 $obj->isPart()
189 Inherited, see "The message" in Mail::Message
190
191 $obj->messageId()
192 Inherited, see "The message" in Mail::Message
193
194 $obj->moveTo($folder, %options)
195 Inherited, see "The message" in Mail::Box::Message
196
197 $obj->partNumber()
198 Inherited, see "The message" in Mail::Message
199
200 $obj->print( [$fh] )
201 Inherited, see "The message" in Mail::Message
202
203 $obj->send( [$mailer], %options )
204 Inherited, see "The message" in Mail::Message
205
206 $obj->seqnr( [$integer] )
207 Inherited, see "The message" in Mail::Box::Message
208
209 $obj->size()
210 Inherited, see "The message" in Mail::Message
211
212 $obj->toplevel()
213 Inherited, see "The message" in Mail::Message
214
215 $obj->write( [$fh] )
216 Inherited, see "The message" in Mail::Message
217
218 The header
219 Extends "The header" in Mail::Box::Message.
220
221 $obj->bcc()
222 Inherited, see "The header" in Mail::Message
223
224 $obj->cc()
225 Inherited, see "The header" in Mail::Message
226
227 $obj->date()
228 Inherited, see "The header" in Mail::Message
229
230 $obj->destinations()
231 Inherited, see "The header" in Mail::Message
232
233 $obj->from()
234 Inherited, see "The header" in Mail::Message
235
236 $obj->get($fieldname)
237 Inherited, see "The header" in Mail::Message
238
239 $obj->guessTimestamp()
240 Inherited, see "The header" in Mail::Message
241
242 $obj->head( [$head] )
243 Inherited, see "The header" in Mail::Message
244
245 $obj->nrLines()
246 Inherited, see "The header" in Mail::Message
247
248 $obj->sender()
249 Inherited, see "The header" in Mail::Message
250
251 $obj->study($fieldname)
252 Inherited, see "The header" in Mail::Message
253
254 $obj->subject()
255 Inherited, see "The header" in Mail::Message
256
257 $obj->timestamp()
258 Inherited, see "The header" in Mail::Message
259
260 $obj->to()
261 Inherited, see "The header" in Mail::Message
262
263 The body
264 Extends "The body" in Mail::Box::Message.
265
266 $obj->body( [$body] )
267 Inherited, see "The body" in Mail::Message
268
269 $obj->contentType()
270 Inherited, see "The body" in Mail::Message
271
272 $obj->decoded(%options)
273 Inherited, see "The body" in Mail::Message
274
275 $obj->encode(%options)
276 Inherited, see "The body" in Mail::Message
277
278 $obj->isMultipart()
279 Inherited, see "The body" in Mail::Message
280
281 $obj->isNested()
282 Inherited, see "The body" in Mail::Message
283
284 $obj->parts( [<'ALL'|'ACTIVE'|'DELETED'|'RECURSE'|$filter>] )
285 Inherited, see "The body" in Mail::Message
286
287 Flags
288 Extends "Flags" in Mail::Box::Message.
289
290 $obj->delete()
291 Inherited, see "Flags" in Mail::Message
292
293 $obj->deleted( [BOOLEAN] )
294 Inherited, see "Flags" in Mail::Message
295
296 $obj->isDeleted()
297 Inherited, see "Flags" in Mail::Message
298
299 $obj->isModified()
300 Inherited, see "Flags" in Mail::Message
301
302 $obj->label($label|PAIRS)
303 Inherited, see "Flags" in Mail::Message
304
305 $obj->labels()
306 Inherited, see "Flags" in Mail::Message
307
308 $obj->labelsToStatus()
309 Inherited, see "Flags" in Mail::Message
310
311 $obj->modified( [BOOLEAN] )
312 Inherited, see "Flags" in Mail::Message
313
314 $obj->statusToLabels()
315 Inherited, see "Flags" in Mail::Message
316
317 The whole message as text
318 Extends "The whole message as text" in Mail::Box::Message.
319
320 $obj->file()
321 Inherited, see "The whole message as text" in
322 Mail::Message::Construct::Text
323
324 $obj->lines()
325 Inherited, see "The whole message as text" in
326 Mail::Message::Construct::Text
327
328 $obj->printStructure( [$fh|undef],[$indent] )
329 Inherited, see "The whole message as text" in
330 Mail::Message::Construct::Text
331
332 $obj->string()
333 Inherited, see "The whole message as text" in
334 Mail::Message::Construct::Text
335
336 Internals
337 Extends "Internals" in Mail::Box::Message.
338
339 $obj->clonedFrom()
340 Inherited, see "Internals" in Mail::Message
341
342 Mail::Box::Dir::Message->coerce($message, %options)
343 Inherited, see "Internals" in Mail::Message
344
345 $obj->create($filename)
346 Create the message in the specified file. If the message already
347 has a filename and is not modified, then a move is tried.
348 Otherwise the message is printed to the file. If the $filename
349 already exists for this message, nothing is done. In any case, the
350 new $filename is set as well.
351
352 $obj->diskDelete()
353 Inherited, see "Internals" in Mail::Box::Message
354
355 $obj->isDelayed()
356 Inherited, see "Internals" in Mail::Message
357
358 $obj->loadBody()
359 This method is called by the autoloader when the body of the
360 message is needed.
361
362 $obj->loadHead()
363 This method is called by the autoloader when the header of the
364 message is needed.
365
366 $obj->parser()
367 Create and return a parser for this message (-file).
368
369 $obj->readBody( $parser, $head, [$bodytype] )
370 Inherited, see "Internals" in Mail::Box::Message
371
372 $obj->readFromParser( $parser, [$bodytype] )
373 Inherited, see "Internals" in Mail::Message
374
375 $obj->readHead( $parser, [$class] )
376 Inherited, see "Internals" in Mail::Message
377
378 $obj->recursiveRebuildPart($part, %options)
379 Inherited, see "Internals" in Mail::Message::Construct::Rebuild
380
381 $obj->storeBody($body)
382 Inherited, see "Internals" in Mail::Message
383
384 $obj->takeMessageId( [STRING] )
385 Inherited, see "Internals" in Mail::Message
386
387 Error handling
388 Extends "Error handling" in Mail::Box::Message.
389
390 $obj->AUTOLOAD()
391 Inherited, see "METHODS" in Mail::Message::Construct
392
393 $obj->addReport($object)
394 Inherited, see "Error handling" in Mail::Reporter
395
396 $obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,
397 $callback] )
398 Mail::Box::Dir::Message->defaultTrace( [$level]|[$loglevel,
399 $tracelevel]|[$level, $callback] )
400 Inherited, see "Error handling" in Mail::Reporter
401
402 $obj->errors()
403 Inherited, see "Error handling" in Mail::Reporter
404
405 $obj->log( [$level, [$strings]] )
406 Mail::Box::Dir::Message->log( [$level, [$strings]] )
407 Inherited, see "Error handling" in Mail::Reporter
408
409 $obj->logPriority($level)
410 Mail::Box::Dir::Message->logPriority($level)
411 Inherited, see "Error handling" in Mail::Reporter
412
413 $obj->logSettings()
414 Inherited, see "Error handling" in Mail::Reporter
415
416 $obj->notImplemented()
417 Inherited, see "Error handling" in Mail::Reporter
418
419 $obj->report( [$level] )
420 Inherited, see "Error handling" in Mail::Reporter
421
422 $obj->reportAll( [$level] )
423 Inherited, see "Error handling" in Mail::Reporter
424
425 $obj->shortSize( [$value] )
426 Mail::Box::Dir::Message->shortSize( [$value] )
427 Inherited, see "Error handling" in Mail::Message
428
429 $obj->shortString()
430 Inherited, see "Error handling" in Mail::Message
431
432 $obj->trace( [$level] )
433 Inherited, see "Error handling" in Mail::Reporter
434
435 $obj->warnings()
436 Inherited, see "Error handling" in Mail::Reporter
437
438 Cleanup
439 Extends "Cleanup" in Mail::Box::Message.
440
441 $obj->DESTROY()
442 Inherited, see "Cleanup" in Mail::Reporter
443
444 $obj->destruct()
445 Inherited, see "Cleanup" in Mail::Box::Message
446
448 Extends "DETAILS" in Mail::Box::Message.
449
451 Error: Cannot coerce a $class object into a $class object
452 Error: Cannot create parser for $filename.
453 For some reason (the previous message have told you already) it was
454 not possible to create a message parser for the specified filename.
455
456 Error: Cannot include forward source as $include.
457 Unknown alternative for the forward(include). Valid choices are
458 "NO", "INLINE", "ATTACH", and "ENCAPSULATE".
459
460 Error: Cannot include reply source as $include.
461 Unknown alternative for the "include" option of reply(). Valid
462 choices are "NO", "INLINE", and "ATTACH".
463
464 Error: Cannot write message to $filename: $!
465 When a modified or new message is written to disk, it is first
466 written to a temporary file in the folder directory. For some
467 reason, it is impossible to create this file.
468
469 Error: Failed to move $new to $filename: $!
470 When a modified or new message is written to disk, it is first
471 written to a temporary file in the folder directory. Then, the new
472 file is moved to replace the existing file. Apparently, the latter
473 fails.
474
475 Error: Method bounce requires To, Cc, or Bcc
476 The message bounce() method forwards a received message off to
477 someone else without modification; you must specified it's new
478 destination. If you have the urge not to specify any destination,
479 you probably are looking for reply(). When you wish to modify the
480 content, use forward().
481
482 Error: Method forwardAttach requires a preamble
483 Error: Method forwardEncapsulate requires a preamble
484 Error: No address to create forwarded to.
485 If a forward message is created, a destination address must be
486 specified.
487
488 Error: No default mailer found to send message.
489 The message send() mechanism had not enough information to
490 automatically find a mail transfer agent to sent this message.
491 Specify a mailer explicitly using the "via" options.
492
493 Error: No rebuild rule $name defined.
494 Error: Only build() Mail::Message's; they are not in a folder yet
495 You may wish to construct a message to be stored in a some kind of
496 folder, but you need to do that in two steps. First, create a
497 normal Mail::Message, and then add it to the folder. During this
498 Mail::Box::addMessage() process, the message will get coerce()-d
499 into the right message type, adding storage information and the
500 like.
501
502 Error: Package $package does not implement $method.
503 Fatal error: the specific package (or one of its superclasses) does
504 not implement this method where it should. This message means that
505 some other related classes do implement this method however the
506 class at hand does not. Probably you should investigate this and
507 probably inform the author of the package.
508
509 Error: Unable to read delayed body.
510 For some reason, the header of the message could be read, but the
511 body cannot. Probably the file has disappeared or the permissions
512 were changed during the progress of the program.
513
514 Error: Unable to read delayed head.
515 Mail::Box tries to be lazy with respect to parsing messages. When
516 a directory organized folder is opened, only the filenames of
517 messages are collected. At first use, the messages are read from
518 their file. Apperently, a message is used for the first time here,
519 but has disappeared or is unreadible for some other reason.
520
521 Error: coercion starts with some object
522
524 This module is part of Mail-Box distribution version 3.010, built on
525 July 18, 2023. Website: http://perl.overmeer.net/CPAN/
526
528 Copyrights 2001-2023 by [Mark Overmeer]. For other contributors see
529 ChangeLog.
530
531 This program is free software; you can redistribute it and/or modify it
532 under the same terms as Perl itself. See http://dev.perl.org/licenses/
533
534
535
536perl v5.38.0 2023-07-24 Mail::Box::Dir::Message(3)