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