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 direc‐
24       tory 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           which represents one message in a Mail::Box::MH folder.  MH folders
32           are very, very simple.... and hence not sophisticated nor fast.
33
34       * Mail::Box::Maildir::Message
35           which represents one message in a Mail::Box::Maildir folder.  Flags
36           are kept in the message's filename.  It is stateless, so you will
37           never loose a message.
38
39       * Mail::Box::Netzwert::Message
40           which represents one message in a Mail::Box::Netzwert folder.  As
41           advantage, it stores pre-parsed information in the message file.
42           As disadvantage: the code is not GPLed (yet).
43

METHODS

45       Constructors
46
47       $obj->clone(OPTIONS)
48
49           See "Constructors" in Mail::Message
50
51       Mail::Box::Dir::Message->new(OPTIONS)
52
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
75           . body_type CODE⎪CLASS
76
77           . deleted BOOLEAN
78
79           . field_type CLASS
80
81           . filename FILENAME
82
83               The file where the message is stored in.
84
85           . fix_header BOOLEAN
86
87               See Mail::Box::new(fix_headers).
88
89           . folder FOLDER
90
91           . head OBJECT
92
93           . head_type CLASS
94
95           . labels ARRAY⎪HASH
96
97           . log LEVEL
98
99           . messageId STRING
100
101           . modified BOOLEAN
102
103           . size INTEGER
104
105           . trace LEVEL
106
107           . trusted BOOLEAN
108
109       Constructing a message
110
111       $obj->bounce([RG-OBJECT⎪OPTIONS])
112
113           See "Constructing a message" in Mail::Message::Construct::Bounce
114
115       Mail::Box::Dir::Message->build([MESSAGE⎪PART⎪BODY], CONTENT)
116
117           See "Constructing a message" in Mail::Message::Construct::Build
118
119       Mail::Box::Dir::Message->buildFromBody(BODY, [HEAD], HEADERS)
120
121           See "Constructing a message" in Mail::Message::Construct::Build
122
123       $obj->forward(OPTIONS)
124
125           See "Constructing a message" in Mail::Message::Construct::Forward
126
127       $obj->forwardAttach(OPTIONS)
128
129           See "Constructing a message" in Mail::Message::Construct::Forward
130
131       $obj->forwardEncapsulate(OPTIONS)
132
133           See "Constructing a message" in Mail::Message::Construct::Forward
134
135       $obj->forwardInline(OPTIONS)
136
137           See "Constructing a message" in Mail::Message::Construct::Forward
138
139       $obj->forwardNo(OPTIONS)
140
141           See "Constructing a message" in Mail::Message::Construct::Forward
142
143       $obj->forwardPostlude
144
145           See "Constructing a message" in Mail::Message::Construct::Forward
146
147       $obj->forwardPrelude
148
149           See "Constructing a message" in Mail::Message::Construct::Forward
150
151       $obj->forwardSubject(STRING)
152
153           See "Constructing a message" in Mail::Message::Construct::Forward
154
155       Mail::Box::Dir::Message->read(FILEHAN‐
156       DLE⎪SCALAR⎪REF-SCALAR⎪ARRAY-OF-LINES, OPTIONS)
157
158           See "Constructing a message" in Mail::Message::Construct::Read
159
160       $obj->rebuild(OPTIONS)
161
162           See "Constructing a message" in Mail::Message::Construct::Rebuild
163
164       $obj->reply(OPTIONS)
165
166           See "Constructing a message" in Mail::Message::Construct::Reply
167
168       $obj->replyPrelude([STRING⎪FIELD⎪ADDRESS⎪ARRAY-OF-THINGS])
169
170           See "Constructing a message" in Mail::Message::Construct::Reply
171
172       $obj->replySubject(STRING)
173
174       Mail::Box::Dir::Message->replySubject(STRING)
175
176           See "Constructing a message" in Mail::Message::Construct::Reply
177
178       The message
179
180       $obj->container
181
182           See "The message" in Mail::Message
183
184       $obj->copyTo(FOLDER, OPTIONS)
185
186           See "The message" in Mail::Box::Message
187
188       $obj->filename([FILENAME])
189
190           Returns the name of the file in which this message is actually
191           stored.  This will return "undef" when the message is not stored in
192           a file.
193
194       $obj->folder([FOLDER])
195
196           See "The message" in Mail::Box::Message
197
198       $obj->isDummy
199
200           See "The message" in Mail::Message
201
202       $obj->isPart
203
204           See "The message" in Mail::Message
205
206       $obj->messageId
207
208           See "The message" in Mail::Message
209
210       $obj->moveTo(FOLDER, OPTIONS)
211
212           See "The message" in Mail::Box::Message
213
214       $obj->print([FILEHANDLE])
215
216           See "The message" in Mail::Message
217
218       $obj->send([MAILER], OPTIONS)
219
220           See "The message" in Mail::Message
221
222       $obj->seqnr([INTEGER])
223
224           See "The message" in Mail::Box::Message
225
226       $obj->size
227
228           See "The message" in Mail::Message
229
230       $obj->toplevel
231
232           See "The message" in Mail::Message
233
234       $obj->write([FILEHANDLE])
235
236           See "The message" in Mail::Message
237
238       The header
239
240       $obj->bcc
241
242           See "The header" in Mail::Message
243
244       $obj->cc
245
246           See "The header" in Mail::Message
247
248       $obj->date
249
250           See "The header" in Mail::Message
251
252       $obj->destinations
253
254           See "The header" in Mail::Message
255
256       $obj->from
257
258           See "The header" in Mail::Message
259
260       $obj->get(FIELDNAME)
261
262           See "The header" in Mail::Message
263
264       $obj->guessTimestamp
265
266           See "The header" in Mail::Message
267
268       $obj->head([HEAD])
269
270           See "The header" in Mail::Message
271
272       $obj->nrLines
273
274           See "The header" in Mail::Message
275
276       $obj->sender
277
278           See "The header" in Mail::Message
279
280       $obj->study(FIELDNAME)
281
282           See "The header" in Mail::Message
283
284       $obj->subject
285
286           See "The header" in Mail::Message
287
288       $obj->timestamp
289
290           See "The header" in Mail::Message
291
292       $obj->to
293
294           See "The header" in Mail::Message
295
296       The body
297
298       $obj->body([BODY])
299
300           See "The body" in Mail::Message
301
302       $obj->decoded(OPTIONS)
303
304           See "The body" in Mail::Message
305
306       $obj->encode(OPTIONS)
307
308           See "The body" in Mail::Message
309
310       $obj->isMultipart
311
312           See "The body" in Mail::Message
313
314       $obj->isNested
315
316           See "The body" in Mail::Message
317
318       $obj->parts(['ALL'⎪'ACTIVE'⎪'DELETED'⎪'RECURSE'⎪FILTER])
319
320           See "The body" in Mail::Message
321
322       Flags
323
324       $obj->delete
325
326           See "Flags" in Mail::Message
327
328       $obj->deleted([BOOLEAN])
329
330           See "Flags" in Mail::Message
331
332       $obj->isDeleted
333
334           See "Flags" in Mail::Message
335
336       $obj->isModified
337
338           See "Flags" in Mail::Message
339
340       $obj->label(LABEL⎪PAIRS)
341
342           See "Flags" in Mail::Message
343
344       $obj->labels
345
346           See "Flags" in Mail::Message
347
348       $obj->labelsToStatus
349
350           See "Flags" in Mail::Message
351
352       $obj->modified([BOOLEAN])
353
354           See "Flags" in Mail::Message
355
356       $obj->statusToLabels
357
358           See "Flags" in Mail::Message
359
360       The whole message as text
361
362       $obj->file
363
364           See "The whole message as text" in Mail::Message::Construct::Text
365
366       $obj->lines
367
368           See "The whole message as text" in Mail::Message::Construct::Text
369
370       $obj->printStructure([FILEHANDLE⎪undef],[INDENT])
371
372           See "The whole message as text" in Mail::Message::Construct::Text
373
374       $obj->string
375
376           See "The whole message as text" in Mail::Message::Construct::Text
377
378       Internals
379
380       $obj->clonedFrom
381
382           See "Internals" in Mail::Message
383
384       Mail::Box::Dir::Message->coerce(MESSAGE, OPTIONS)
385
386           See "Internals" in Mail::Message
387
388       $obj->create(FILENAME)
389
390           Create the message in the specified file.  If the message already
391           has a filename and is not modified, then a move is tried.  Other‐
392           wise the message is printed to the file.  If the FILENAME already
393           exists for this message, nothing is done.  In any case, the new
394           FILENAME is set as well.
395
396       $obj->diskDelete
397
398           See "Internals" in Mail::Box::Message
399
400       $obj->isDelayed
401
402           See "Internals" in Mail::Message
403
404       $obj->loadBody
405
406           This method is called by the autoloader when the body of the mes‐
407           sage is needed.
408
409       $obj->loadHead
410
411           This method is called by the autoloader when the header of the mes‐
412           sage is needed.
413
414       $obj->parser
415
416           Create and return a parser for this message (-file).
417
418       $obj->readBody(PARSER, HEAD [, BODYTYPE])
419
420           See "Internals" in Mail::Box::Message
421
422       $obj->readFromParser(PARSER, [BODYTYPE])
423
424           See "Internals" in Mail::Message
425
426       $obj->readHead(PARSER [,CLASS])
427
428           See "Internals" in Mail::Message
429
430       $obj->recursiveRebuildPart(PART, OPTIONS)
431
432           See "Internals" in Mail::Message::Construct::Rebuild
433
434       $obj->storeBody(BODY)
435
436           See "Internals" in Mail::Message
437
438       $obj->takeMessageId([STRING])
439
440           See "Internals" in Mail::Message
441
442       Error handling
443
444       $obj->AUTOLOAD
445
446           See "METHODS" in Mail::Message::Construct
447
448       $obj->addReport(OBJECT)
449
450           See "Error handling" in Mail::Reporter
451
452       $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
453
454       Mail::Box::Dir::Message->defaultTrace([LEVEL]⎪[LOGLEVEL,
455       TRACELEVEL]⎪[LEVEL, CALLBACK])
456
457           See "Error handling" in Mail::Reporter
458
459       $obj->errors
460
461           See "Error handling" in Mail::Reporter
462
463       $obj->log([LEVEL [,STRINGS]])
464
465       Mail::Box::Dir::Message->log([LEVEL [,STRINGS]])
466
467           See "Error handling" in Mail::Reporter
468
469       $obj->logPriority(LEVEL)
470
471       Mail::Box::Dir::Message->logPriority(LEVEL)
472
473           See "Error handling" in Mail::Reporter
474
475       $obj->logSettings
476
477           See "Error handling" in Mail::Reporter
478
479       $obj->notImplemented
480
481           See "Error handling" in Mail::Reporter
482
483       $obj->report([LEVEL])
484
485           See "Error handling" in Mail::Reporter
486
487       $obj->reportAll([LEVEL])
488
489           See "Error handling" in Mail::Reporter
490
491       $obj->shortSize([VALUE])
492
493       Mail::Box::Dir::Message->shortSize([VALUE])
494
495           See "Error handling" in Mail::Message
496
497       $obj->shortString
498
499           See "Error handling" in Mail::Message
500
501       $obj->trace([LEVEL])
502
503           See "Error handling" in Mail::Reporter
504
505       $obj->warnings
506
507           See "Error handling" in Mail::Reporter
508
509       Cleanup
510
511       $obj->DESTROY
512
513           See "Cleanup" in Mail::Message
514
515       $obj->destruct
516
517           See "Cleanup" in Mail::Box::Message
518
519       $obj->inGlobalDestruction
520
521           See "Cleanup" in Mail::Reporter
522

DETAILS

DIAGNOSTICS

525       Error: Cannot create parser for $filename.
526
527       For some reason (the previous message have told you already) it was not
528       possible to create a message parser for the specified filename.
529
530       Error: Cannot include forward source as $include.
531
532       Unknown alternative for the forward(include).  Valid choices are "NO",
533       "INLINE", "ATTACH", and "ENCAPSULATE".
534
535       Error: Cannot include reply source as $include.
536
537       Unknown alternative for the "include" option of reply().  Valid choices
538       are "NO", "INLINE", and "ATTACH".
539
540       Error: Cannot write message to $filename: $!
541
542       When a modified or new message is written to disk, it is first written
543       to a temporary file in the folder directory.  For some reason, it is
544       impossible to create this file.
545
546       Error: Failed to move $new to $filename: $!
547
548       When a modified or new message is written to disk, it is first written
549       to a temporary file in the folder directory.  Then, the new file is
550       moved to replace the existing file.  Apparently, the latter fails.
551
552       Error: Method bounce requires To, Cc, or Bcc
553
554       The message bounce() method forwards a received message off to someone
555       else without modification; you must specified it's new destination.  If
556       you have the urge not to specify any destination, you probably are
557       looking for reply(). When you wish to modify the content, use for‐
558       ward().
559
560       Error: Method forwardAttach requires a preamble
561
562       Error: Method forwardEncapsulate requires a preamble
563
564       Error: No address to create forwarded to.
565
566       If a forward message is created, a destination address must be speci‐
567       fied.
568
569       Error: No default mailer found to send message.
570
571       The message send() mechanism had not enough information to automati‐
572       cally find a mail transfer agent to sent this message.  Specify a
573       mailer explicitly using the "via" options.
574
575       Error: No rebuild rule $name defined.
576
577       Error: Only build() Mail::Message's; they are not in a folder yet
578
579       You may wish to construct a message to be stored in a some kind of
580       folder, but you need to do that in two steps.  First, create a normal
581       Mail::Message, and then add it to the folder.  During this
582       Mail::Box::addMessage() process, the message will get coerce()-d into
583       the right message type, adding storage information and the like.
584
585       Error: Package $package does not implement $method.
586
587       Fatal error: the specific package (or one of its superclasses) does not
588       implement this method where it should. This message means that some
589       other related classes do implement this method however the class at
590       hand does not.  Probably you should investigate this and probably
591       inform the author of the package.
592
593       Error: Unable to read delayed body.
594
595       For some reason, the header of the message could be read, but the body
596       cannot.  Probably the file has disappeared or the permissions were
597       changed during the progress of the program.
598
599       Error: Unable to read delayed head.
600
601       Mail::Box tries to be lazy with respect to parsing messages.  When a
602       directory organized folder is opened, only the filenames of messages
603       are collected.  At first use, the messages are read from their file.
604       Apperently, a message is used for the first time here, but has disap‐
605       peared or is unreadible for some other reason.
606

SEE ALSO

608       This module is part of Mail-Box distribution version 2.070, built on
609       March 25, 2007. Website: http://perl.overmeer.net/mailbox/
610

LICENSE

612       Copyrights 2001-2007 by Mark Overmeer.For other contributors see
613       ChangeLog.
614
615       This program is free software; you can redistribute it and/or modify it
616       under the same terms as Perl itself.  See
617       http://www.perl.com/perl/misc/Artistic.html
618
619
620
621perl v5.8.8                       2007-03-25        Mail::Box::Dir::Message(3)
Impressum