1Mail::Box::File::MessagUes(e3r)Contributed Perl DocumentMaatiilo:n:Box::File::Message(3)
2
3
4
6 Mail::Box::File::Message - one message in a Mbox folder
7
9 Mail::Box::File::Message
10 is a Mail::Box::Message
11 is a Mail::Message
12 is a Mail::Reporter
13
14 Mail::Box::File::Message is extended by
15 Mail::Box::Dbx::Message
16 Mail::Box::Mbox::Message
17
19 my $folder = new Mail::Box::File folder => $ENV{MAIL}, ...;
20 my $message = $folder->message(0);
21
23 Maintain one message in an file based folder, any Mail::Box::File
24 extension.
25
27 Constructors
28
29 $obj->clone(OPTIONS)
30
31 See "Constructors" in Mail::Message
32
33 Mail::Box::File::Message->new(OPTIONS)
34
35 Messages in file-based folders use the following options for cre‐
36 ation:
37
38 Option --Defined in --Default
39 body Mail::Message undef
40 body_type Mail::Box::Message <from folder>
41 deleted Mail::Message <false>
42 field_type Mail::Message undef
43 folder Mail::Box::Message <required>
44 from_line undef
45 head Mail::Message undef
46 head_type Mail::Message Mail::Message::Head::Complete
47 labels Mail::Message {}
48 log Mail::Reporter 'WARNINGS'
49 messageId Mail::Message undef
50 modified Mail::Message <false>
51 size Mail::Box::Message undef
52 trace Mail::Reporter 'WARNINGS'
53 trusted Mail::Message <false>
54
55 . body OBJECT
56
57 . body_type CODE⎪CLASS
58
59 . deleted BOOLEAN
60
61 . field_type CLASS
62
63 . folder FOLDER
64
65 . from_line STRING
66
67 The line which begins each message in the file. Some people
68 detest this line, but this is just how things were invented...
69
70 . head OBJECT
71
72 . head_type CLASS
73
74 . labels ARRAY⎪HASH
75
76 . log LEVEL
77
78 . messageId STRING
79
80 . modified BOOLEAN
81
82 . size INTEGER
83
84 . trace LEVEL
85
86 . trusted BOOLEAN
87
88 Constructing a message
89
90 $obj->bounce([RG-OBJECT⎪OPTIONS])
91
92 See "Constructing a message" in Mail::Message::Construct::Bounce
93
94 Mail::Box::File::Message->build([MESSAGE⎪PART⎪BODY], CONTENT)
95
96 See "Constructing a message" in Mail::Message::Construct::Build
97
98 Mail::Box::File::Message->buildFromBody(BODY, [HEAD], HEADERS)
99
100 See "Constructing a message" in Mail::Message::Construct::Build
101
102 $obj->forward(OPTIONS)
103
104 See "Constructing a message" in Mail::Message::Construct::Forward
105
106 $obj->forwardAttach(OPTIONS)
107
108 See "Constructing a message" in Mail::Message::Construct::Forward
109
110 $obj->forwardEncapsulate(OPTIONS)
111
112 See "Constructing a message" in Mail::Message::Construct::Forward
113
114 $obj->forwardInline(OPTIONS)
115
116 See "Constructing a message" in Mail::Message::Construct::Forward
117
118 $obj->forwardNo(OPTIONS)
119
120 See "Constructing a message" in Mail::Message::Construct::Forward
121
122 $obj->forwardPostlude
123
124 See "Constructing a message" in Mail::Message::Construct::Forward
125
126 $obj->forwardPrelude
127
128 See "Constructing a message" in Mail::Message::Construct::Forward
129
130 $obj->forwardSubject(STRING)
131
132 See "Constructing a message" in Mail::Message::Construct::Forward
133
134 Mail::Box::File::Message->read(FILEHAN‐
135 DLE⎪SCALAR⎪REF-SCALAR⎪ARRAY-OF-LINES, OPTIONS)
136
137 See "Constructing a message" in Mail::Message::Construct::Read
138
139 $obj->rebuild(OPTIONS)
140
141 See "Constructing a message" in Mail::Message::Construct::Rebuild
142
143 $obj->reply(OPTIONS)
144
145 See "Constructing a message" in Mail::Message::Construct::Reply
146
147 $obj->replyPrelude([STRING⎪FIELD⎪ADDRESS⎪ARRAY-OF-THINGS])
148
149 See "Constructing a message" in Mail::Message::Construct::Reply
150
151 $obj->replySubject(STRING)
152
153 Mail::Box::File::Message->replySubject(STRING)
154
155 See "Constructing a message" in Mail::Message::Construct::Reply
156
157 The message
158
159 $obj->container
160
161 See "The message" in Mail::Message
162
163 $obj->copyTo(FOLDER, OPTIONS)
164
165 See "The message" in Mail::Box::Message
166
167 $obj->escapedBody
168
169 Mbox folders contain multiple messages in one file, using a separa‐
170 tor line to keep them apart. Typically, these lines start with
171 "From ". Lines within the message could interfere with this sepa‐
172 rator, and should therefore be translated.
173
174 This method will return the escaped text of the body as reference.
175
176 $obj->folder([FOLDER])
177
178 See "The message" in Mail::Box::Message
179
180 $obj->fromLine([LINE])
181
182 Many people detest file-style folders because they store messages
183 all in one file, where a line starting with "From " leads the
184 header. If we receive a message from a file-based folder, we store
185 that line. If we write to such a file, but there is no such line
186 stored, then we try to generate one.
187
188 If LINE is provided, then the starting line is set to this value.
189
190 $obj->isDummy
191
192 See "The message" in Mail::Message
193
194 $obj->isPart
195
196 See "The message" in Mail::Message
197
198 $obj->messageId
199
200 See "The message" in Mail::Message
201
202 $obj->moveTo(FOLDER, OPTIONS)
203
204 See "The message" in Mail::Box::Message
205
206 $obj->print([FILEHANDLE])
207
208 See "The message" in Mail::Message
209
210 $obj->send([MAILER], OPTIONS)
211
212 See "The message" in Mail::Message
213
214 $obj->seqnr([INTEGER])
215
216 See "The message" in Mail::Box::Message
217
218 $obj->size
219
220 See "The message" in Mail::Message
221
222 $obj->toplevel
223
224 See "The message" in Mail::Message
225
226 $obj->write([FILEHANDLE])
227
228 Write one message to a file handle. It is the message including
229 the leading 'From ' line and trailing blank. The From-line may
230 interfere with lines in the body: those lines are escaped with an
231 extra '>'.
232
233 Example:
234
235 $msg->write(\*FILE); # print the message with encaps to FILE
236 $msg->write; # message with encaps to selected filehandle
237 $msg->print(\*FILE); # the message without encaps.
238
239 The header
240
241 $obj->bcc
242
243 See "The header" in Mail::Message
244
245 $obj->cc
246
247 See "The header" in Mail::Message
248
249 $obj->date
250
251 See "The header" in Mail::Message
252
253 $obj->destinations
254
255 See "The header" in Mail::Message
256
257 $obj->from
258
259 See "The header" in Mail::Message
260
261 $obj->get(FIELDNAME)
262
263 See "The header" in Mail::Message
264
265 $obj->guessTimestamp
266
267 See "The header" in Mail::Message
268
269 $obj->head([HEAD])
270
271 See "The header" in Mail::Message
272
273 $obj->nrLines
274
275 See "The header" in Mail::Message
276
277 $obj->sender
278
279 See "The header" in Mail::Message
280
281 $obj->study(FIELDNAME)
282
283 See "The header" in Mail::Message
284
285 $obj->subject
286
287 See "The header" in Mail::Message
288
289 $obj->timestamp
290
291 See "The header" in Mail::Message
292
293 $obj->to
294
295 See "The header" in Mail::Message
296
297 The body
298
299 $obj->body([BODY])
300
301 See "The body" in Mail::Message
302
303 $obj->decoded(OPTIONS)
304
305 See "The body" in Mail::Message
306
307 $obj->encode(OPTIONS)
308
309 See "The body" in Mail::Message
310
311 $obj->isMultipart
312
313 See "The body" in Mail::Message
314
315 $obj->isNested
316
317 See "The body" in Mail::Message
318
319 $obj->parts(['ALL'⎪'ACTIVE'⎪'DELETED'⎪'RECURSE'⎪FILTER])
320
321 See "The body" in Mail::Message
322
323 Flags
324
325 $obj->delete
326
327 See "Flags" in Mail::Message
328
329 $obj->deleted([BOOLEAN])
330
331 See "Flags" in Mail::Message
332
333 $obj->isDeleted
334
335 See "Flags" in Mail::Message
336
337 $obj->isModified
338
339 See "Flags" in Mail::Message
340
341 $obj->label(LABEL⎪PAIRS)
342
343 See "Flags" in Mail::Message
344
345 $obj->labels
346
347 See "Flags" in Mail::Message
348
349 $obj->labelsToStatus
350
351 See "Flags" in Mail::Message
352
353 $obj->modified([BOOLEAN])
354
355 See "Flags" in Mail::Message
356
357 $obj->statusToLabels
358
359 See "Flags" in Mail::Message
360
361 The whole message as text
362
363 $obj->file
364
365 See "The whole message as text" in Mail::Message::Construct::Text
366
367 $obj->lines
368
369 See "The whole message as text" in Mail::Message::Construct::Text
370
371 $obj->printStructure([FILEHANDLE⎪undef],[INDENT])
372
373 See "The whole message as text" in Mail::Message::Construct::Text
374
375 $obj->string
376
377 See "The whole message as text" in Mail::Message::Construct::Text
378
379 Internals
380
381 $obj->clonedFrom
382
383 See "Internals" in Mail::Message
384
385 Mail::Box::File::Message->coerce(MESSAGE, OPTIONS)
386
387 See "Internals" in Mail::Message
388
389 $obj->diskDelete
390
391 See "Internals" in Mail::Box::Message
392
393 $obj->fileLocation
394
395 Returns the location of the whole message including the from-line.
396 In LIST context, both begin and end are returned. In SCALAR con‐
397 text, only the begin is passed back.
398
399 $obj->isDelayed
400
401 See "Internals" in Mail::Message
402
403 $obj->loadBody
404
405 $obj->moveLocation(DISTANCE)
406
407 The message is relocated in the file, being moved over DISTANCE
408 bytes. Setting a new location will update the according informa‐
409 tion in the header and body.
410
411 $obj->readBody(PARSER, HEAD [, BODYTYPE])
412
413 See "Internals" in Mail::Box::Message
414
415 $obj->readFromParser(PARSER)
416
417 Read one message from a Mail::Box::File based folder, including the
418 leading message separator.
419
420 $obj->readHead(PARSER [,CLASS])
421
422 See "Internals" in Mail::Message
423
424 $obj->recursiveRebuildPart(PART, OPTIONS)
425
426 See "Internals" in Mail::Message::Construct::Rebuild
427
428 $obj->storeBody(BODY)
429
430 See "Internals" in Mail::Message
431
432 $obj->takeMessageId([STRING])
433
434 See "Internals" in Mail::Message
435
436 Error handling
437
438 $obj->AUTOLOAD
439
440 See "METHODS" in Mail::Message::Construct
441
442 $obj->addReport(OBJECT)
443
444 See "Error handling" in Mail::Reporter
445
446 $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
447
448 Mail::Box::File::Message->defaultTrace([LEVEL]⎪[LOGLEVEL,
449 TRACELEVEL]⎪[LEVEL, CALLBACK])
450
451 See "Error handling" in Mail::Reporter
452
453 $obj->errors
454
455 See "Error handling" in Mail::Reporter
456
457 $obj->log([LEVEL [,STRINGS]])
458
459 Mail::Box::File::Message->log([LEVEL [,STRINGS]])
460
461 See "Error handling" in Mail::Reporter
462
463 $obj->logPriority(LEVEL)
464
465 Mail::Box::File::Message->logPriority(LEVEL)
466
467 See "Error handling" in Mail::Reporter
468
469 $obj->logSettings
470
471 See "Error handling" in Mail::Reporter
472
473 $obj->notImplemented
474
475 See "Error handling" in Mail::Reporter
476
477 $obj->report([LEVEL])
478
479 See "Error handling" in Mail::Reporter
480
481 $obj->reportAll([LEVEL])
482
483 See "Error handling" in Mail::Reporter
484
485 $obj->shortSize([VALUE])
486
487 Mail::Box::File::Message->shortSize([VALUE])
488
489 See "Error handling" in Mail::Message
490
491 $obj->shortString
492
493 See "Error handling" in Mail::Message
494
495 $obj->trace([LEVEL])
496
497 See "Error handling" in Mail::Reporter
498
499 $obj->warnings
500
501 See "Error handling" in Mail::Reporter
502
503 Cleanup
504
505 $obj->DESTROY
506
507 See "Cleanup" in Mail::Message
508
509 $obj->destruct
510
511 See "Cleanup" in Mail::Box::Message
512
513 $obj->inGlobalDestruction
514
515 See "Cleanup" in Mail::Reporter
516
519 Error: Cannot include forward source as $include.
520
521 Unknown alternative for the forward(include). Valid choices are "NO",
522 "INLINE", "ATTACH", and "ENCAPSULATE".
523
524 Error: Cannot include reply source as $include.
525
526 Unknown alternative for the "include" option of reply(). Valid choices
527 are "NO", "INLINE", and "ATTACH".
528
529 Error: Method bounce requires To, Cc, or Bcc
530
531 The message bounce() method forwards a received message off to someone
532 else without modification; you must specified it's new destination. If
533 you have the urge not to specify any destination, you probably are
534 looking for reply(). When you wish to modify the content, use for‐
535 ward().
536
537 Error: Method forwardAttach requires a preamble
538
539 Error: Method forwardEncapsulate requires a preamble
540
541 Error: No address to create forwarded to.
542
543 If a forward message is created, a destination address must be speci‐
544 fied.
545
546 Error: No default mailer found to send message.
547
548 The message send() mechanism had not enough information to automati‐
549 cally find a mail transfer agent to sent this message. Specify a
550 mailer explicitly using the "via" options.
551
552 Error: No rebuild rule $name defined.
553
554 Error: Only build() Mail::Message's; they are not in a folder yet
555
556 You may wish to construct a message to be stored in a some kind of
557 folder, but you need to do that in two steps. First, create a normal
558 Mail::Message, and then add it to the folder. During this
559 Mail::Box::addMessage() process, the message will get coerce()-d into
560 the right message type, adding storage information and the like.
561
562 Error: Package $package does not implement $method.
563
564 Fatal error: the specific package (or one of its superclasses) does not
565 implement this method where it should. This message means that some
566 other related classes do implement this method however the class at
567 hand does not. Probably you should investigate this and probably
568 inform the author of the package.
569
570 Error: Unable to read delayed body.
571
573 This module is part of Mail-Box distribution version 2.070, built on
574 March 25, 2007. Website: http://perl.overmeer.net/mailbox/
575
577 Copyrights 2001-2007 by Mark Overmeer.For other contributors see
578 ChangeLog.
579
580 This program is free software; you can redistribute it and/or modify it
581 under the same terms as Perl itself. See
582 http://www.perl.com/perl/misc/Artistic.html
583
584
585
586perl v5.8.8 2007-03-25 Mail::Box::File::Message(3)