File: ResentGroup.pod

package info (click to toggle)
libmail-box-perl 2.068-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,576 kB
  • ctags: 1,493
  • sloc: perl: 22,358; makefile: 49
file content (653 lines) | stat: -rw-r--r-- 12,144 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653

=head1 NAME

Mail::Message::Head::ResentGroup - header fields tracking message delivery


=head1 INHERITANCE

 Mail::Message::Head::ResentGroup
   is a Mail::Message::Head::FieldGroup
   is a Mail::Reporter


=head1 SYNOPSIS

 my $rg = Mail::Message::Head::ResentGroup->new(head => $head,
              From => 'me@home.nl', To => 'You@tux.aq');
 $head->addResentGroup($rg);

 my $rg = $head->addResentGroup(From => 'me');

 my @from = $rg->From;

 my @rgs = $head->resentGroups;
 $rg[2]->delete if @rgs > 2;


=head1 DESCRIPTION

A I<resent group> is a set of header fields which describe one intermediate
step in the message transport.  Resent groups B<have NOTHING to do> with
user activety; there is no relation to the C<user's> sense of creating
reply, forward, or bounce messages at all!



=head1 METHODS


=head2 Constructors


$obj-E<gt>B<clone>

=over 4

See L<Mail::Message::Head::FieldGroup/"Constructors">

=back

$obj-E<gt>B<from>([HEAD|MESSAGE, OPTIONS])

=over 4

WARNING: this method has two very different purposes.  For backward
compatibility reasons, without arguments L<resentFrom()|Mail::Message::Head::ResentGroup/"Access to the header"> is called to
return the C<From> field of this resent group.

With any arguments, a list of C<Mail::Message::Head::ResentGroup> objects
is returned, taken from the specified MESSAGE or message HEAD.

=back

$obj-E<gt>B<implementedTypes>

Mail::Message::Head::ResentGroup-E<gt>B<implementedTypes>

=over 4

See L<Mail::Message::Head::FieldGroup/"Constructors">

=back

Mail::Message::Head::ResentGroup-E<gt>B<new>([FIELDS], OPTIONS)

=over 4

Create an object which maintains one set of resent headers.  The
FIELDS are L<Mail::Message::Field|Mail::Message::Field> objects from the same header.

OPTIONS which start with capitals will be used to construct additional
fields.  These option names are prepended with C<Resent->, keeping the
capitization of what is specified.

 Option      --Defined in     --Default
 Bcc                            undef
 Cc                             undef
 Date                           <now>
 Delivered-To                   undef
 From                           <required>
 Message-ID                     <uniquely created>
 Received                       <created>
 Return-Path                    undef
 Sender                         undef
 To                             undef
 head                           <created automatically>
 log           Mail::Reporter   'WARNINGS'
 message_head                   undef
 software      Mail::Message::Head::FieldGroup  undef
 trace         Mail::Reporter   'WARNINGS'
 type          Mail::Message::Head::FieldGroup  undef
 version       Mail::Message::Head::FieldGroup  undef

. Bcc STRING|OBJECT|OBJECTS

. Cc STRING|OBJECT|OBJECTS

. Date STRING

=over 4

When this resent-group is dispatched by the resender of the message. Like
the C<Date> field, it is not the date and time that the message was
actually transported.

=back

. Delivered-To STRING|FIELD

. From STRING|OBJECT|OBJECTS

. Message-ID STRING|FIELD

=over 4

The C<Resent-Message-ID> which identifies this resent group.  The FIELD
must contain a message id.

=back

. Received STRING

=over 4

The C<Received> field is the starting line for a resent group of header
lines. If it is not defined, one is created using L<createReceived()|Mail::Message::Head::ResentGroup/"Internals">.

=back

. Return-Path STRING|FIELD

. Sender STRING|OBJECT

=over 4

Only permitted when more than one from address is specified.  In this case,
it selects one of these addresses as the main originator of the message.

=back

. To STRING|OBJECT|OBJECTS

. head OBJECT

=over 4

The header where the data is stored in.  Be dafault a
L<Mail::Message::Head::Partial|Mail::Message::Head::Partial> is created for you.

=back

. log LEVEL

. message_head HEAD

=over 4

The real header of the message where this resent group is part of.  The
C<head> used in this class is only a container for a subset of fields.

=back

. software STRING

. trace LEVEL

. type STRING

. version STRING

=back

=head2 The header


$obj-E<gt>B<add>((FIELD =E<gt> VALUE) | OBJECT)

=over 4

All fields appear only once, so C<add()> behaves as L<set()|Mail::Message::Head::ResentGroup/"The header">.

=back

$obj-E<gt>B<addFields>([FIELDNAMES])

=over 4

Not applicable to resent-groups: the same name can appear in more than
one group.  Therefore, a FIELDNAME is sufficiently distinctive.

=back

$obj-E<gt>B<attach>(HEAD)

=over 4

See L<Mail::Message::Head::FieldGroup/"The header">

=back

$obj-E<gt>B<delete>

=over 4

See L<Mail::Message::Head::FieldGroup/"The header">

=back

$obj-E<gt>B<fieldNames>

=over 4

See L<Mail::Message::Head::FieldGroup/"The header">

=back

$obj-E<gt>B<fields>

=over 4

See L<Mail::Message::Head::FieldGroup/"The header">

=back

$obj-E<gt>B<head>

=over 4

See L<Mail::Message::Head::FieldGroup/"The header">

=back

$obj-E<gt>B<messageHead>([HEAD])

=over 4

Returns (optionally after setting) the real header where this resent group
belongs to.  This may be undef at creation, and then later filled in
when L<Mail::Message::Head::Complete::addResentGroup()|Mail::Message::Head::Complete/"Access to the header"> is called.

=back

$obj-E<gt>B<orderedFields>

=over 4

Returns the fields in the order as should appear in header according
to rfc2822.  For the C<Resent-> fields of the group, the order is
not that important, but the C<Return-Path>, C<Delivered-To>, and C<Received>
must come first.  Only fields mentioned in the RFC are returned.

=back

$obj-E<gt>B<set>((FIELD =E<gt> VALUE) | OBJECT)

=over 4

Set a FIELD to a (new) VALUE.  The FIELD names which do not start with
'Resent-*' but need it will have that added.  It is also an option to
specify a fully prepared message field OBJECT.  In any case, a field
OBJECT is returned.

I<Example:> 

 my $this = Mail::Message::Head::ResentGroup->new;
 $this->set(To => 'fish@tux.aq');
 $msg->addResentGroup($this);
 $msg->send;

 $msg->bounce(To => 'fish@tux.aq')->send;   # the same

 my $this = Mail::Message::Head::ResentGroup
     ->new(To => 'fish@tux.aq');

=back

=head2 Access to the header


$obj-E<gt>B<bcc>

=over 4

In scalar context, the C<Resent-Bcc> field is returned.  In list context,
the addresses as specified within the bcc field are returned as
Mail::Address objects.  Bcc fields are not transmitted (hidden for
external parties).

=back

$obj-E<gt>B<cc>

=over 4

In scalar context, the C<Resent-Cc> field is returned.  In list context,
the addresses as specified within the cc field are returned as
Mail::Address objects.

=back

$obj-E<gt>B<date>

=over 4

Returns the C<Resent-Date> field, or C<undef> if it was not defined.

=back

$obj-E<gt>B<dateTimestamp>

=over 4

The timestamp as stored within the C<Resent-Date> field converted to
local system time.

=back

$obj-E<gt>B<deliveredTo>

=over 4

The field which describes the C<Delivered-To> of this resent group.

=back

$obj-E<gt>B<destinations>

=over 4

Returns a list of all addresses specified in the C<Resent-To>, C<-Cc>, and
C<-Bcc> fields of this resent group.

=back

$obj-E<gt>B<isResentGroupFieldName>(NAME)

Mail::Message::Head::ResentGroup-E<gt>B<isResentGroupFieldName>(NAME)

=over 4

=back

$obj-E<gt>B<messageId>

=over 4

Returns the message-ID used for this group of resent lines.

=back

$obj-E<gt>B<received>

=over 4

The field which describes the C<Received> data of this resent group.

=back

$obj-E<gt>B<receivedTimestamp>

=over 4

The timestamp as stored within the C<Received> field converted to
local system time.

=back

$obj-E<gt>B<resentFrom>

=over 4

In scalar context, the C<Resent-From> field is returned.  In list
context, the addresses as specified within the from field are
returned as Mail::Address objects.

For reasons of backward compatibility and consistency, the L<from()|Mail::Message::Head::ResentGroup/"METHODS">
method will return the same as this method.

=back

$obj-E<gt>B<returnPath>

=over 4

The field which describes the C<Return-Path> of this resent group.

=back

$obj-E<gt>B<sender>

=over 4

In scalar context, the C<Resent-Sender> field is returned.  In list
context, the addresses as specified within the from field are
returned as Mail::Address objects.

=back

$obj-E<gt>B<software>

=over 4

See L<Mail::Message::Head::FieldGroup/"Access to the header">

=back

$obj-E<gt>B<to>

=over 4

In scalar context, the C<Resent-To> field is returned.  In list context,
the addresses as specified within the to field are returned as
Mail::Address objects.

=back

$obj-E<gt>B<type>

=over 4

See L<Mail::Message::Head::FieldGroup/"Access to the header">

=back

$obj-E<gt>B<version>

=over 4

See L<Mail::Message::Head::FieldGroup/"Access to the header">

=back

=head2 Internals


$obj-E<gt>B<collectFields>([NAME])

=over 4

See L<Mail::Message::Head::FieldGroup/"Internals">

=back

$obj-E<gt>B<createReceived>([DOMAIN])

=over 4

Create a recieved field for this resent group.  This is automatically
called if none was specified during creation of this resent group object.

The content of this field is described in RFC2821 section 4.4.  It could use
some improvement.

=back

$obj-E<gt>B<detected>(TYPE, SOFTWARE, VERSION)

=over 4

See L<Mail::Message::Head::FieldGroup/"Internals">

=back

=head2 Error handling


$obj-E<gt>B<AUTOLOAD>

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<addReport>(OBJECT)

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])

Mail::Message::Head::ResentGroup-E<gt>B<defaultTrace>([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<details>

=over 4

See L<Mail::Message::Head::FieldGroup/"Error handling">

=back

$obj-E<gt>B<errors>

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<log>([LEVEL [,STRINGS]])

Mail::Message::Head::ResentGroup-E<gt>B<log>([LEVEL [,STRINGS]])

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<logPriority>(LEVEL)

Mail::Message::Head::ResentGroup-E<gt>B<logPriority>(LEVEL)

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<logSettings>

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<notImplemented>

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<print>([FILEHANDLE])

=over 4

See L<Mail::Message::Head::FieldGroup/"Error handling">

=back

$obj-E<gt>B<report>([LEVEL])

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<reportAll>([LEVEL])

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<trace>([LEVEL])

=over 4

See L<Mail::Reporter/"Error handling">

=back

$obj-E<gt>B<warnings>

=over 4

See L<Mail::Reporter/"Error handling">

=back

=head2 Cleanup


$obj-E<gt>B<DESTROY>

=over 4

See L<Mail::Reporter/"Cleanup">

=back

$obj-E<gt>B<inGlobalDestruction>

=over 4

See L<Mail::Reporter/"Cleanup">

=back




=head1 DIAGNOSTICS

I<Error:> Message header required for creation of ResentGroup.

It is required to know to which header the resent-group
is created.  Use the C<head> option.  Maybe you should use
L<Mail::Message::Head::Complete::addResentGroup()|Mail::Message::Head::Complete/"Access to the header"> with DATA, which will
organize the correct initiations for you.

I<Error:> Package $package does not implement $method.

Fatal error: the specific package (or one of its superclasses) does not
implement this method where it should. This message means that some other
related classes do implement this method however the class at hand does
not.  Probably you should investigate this and probably inform the author
of the package.






=head1 REFERENCES

See the MailBox website at L<http://perl.overmeer.net/mailbox/> for more details.

=head1 COPYRIGHTS

Distribution version 2.068.
Written by Mark Overmeer (mark@overmeer.net).  See the ChangeLog for
other contributors.

Copyright (c) 2001-2006 by the author(s). All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.