1Mail::Message::Field(3)User Contributed Perl DocumentatioMnail::Message::Field(3)
2
3
4

NAME

6       Mail::Message::Field - one line of a message header
7

INHERITANCE

9        Mail::Message::Field
10          is a Mail::Reporter
11
12        Mail::Message::Field is extended by
13          Mail::Message::Field::Fast
14          Mail::Message::Field::Flex
15          Mail::Message::Field::Full
16

SYNOPSIS

18        my $field = Mail::Message::Field->new(From => 'fish@tux.aq');
19        print $field->name;
20        print $field->body;
21        print $field->comment;
22        print $field->content;  # body & comment
23        $field->print(\*OUT);
24        print $field->string;
25        print "$field\n";
26        print $field->attribute('charset') || 'us-ascii';
27

DESCRIPTION

29       This implementation follows the guidelines of rfc2822 as close as
30       possible, and may there produce a different output than implementations
31       based on the obsolete rfc822.  However, the old output will still be
32       accepted.
33
34       These objects each store one header line, and facilitates access
35       routines to the information hidden in it.  Also, you may want to have a
36       look at the added methods of a message:
37
38        my @from    = $message->from;
39        my $sender  = $message->sender;
40        my $subject = $message->subject;
41        my $msgid   = $message->messageId;
42
43        my @to      = $message->to;
44        my @cc      = $message->cc;
45        my @bcc     = $message->bcc;
46        my @dest    = $message->destinations;
47
48        my $other   = $message->get('Reply-To');
49
50       Extends "DESCRIPTION" in Mail::Reporter.
51

OVERLOADED

53       overload: ""
54           (stringification) produces the unfolded body of the field, which
55           may be what you expect.  This is what makes what the field object
56           seems to be a simple string. The string is produced by
57           unfoldedBody().
58
59           example:
60
61            print $msg->get('subject');  # via overloading
62            print $msg->get('subject')->unfoldedBody; # same
63
64            my $subject = $msg->get('subject') || 'your mail';
65            print "Re: $subject\n";
66
67       overload: 0+
68           (numification) When the field is numeric, the value will be
69           returned.  The result is produced by toInt().  If the value is not
70           correct, a 0 is produced, to simplify calculations.
71
72       overload: <=>
73           (numeric comparison) Compare the integer field contents with
74           something else.
75
76           example:
77
78            if($msg->get('Content-Length') > 10000) ...
79            if($msg->size > 10000) ... ; # same, but better
80
81       overload: bool
82           Always true, to make it possible to say if($field).
83
84       overload: cmp
85           (string comparison) Compare the unfolded body of a field with
86           another field or a string, using the buildin "cmp".
87

METHODS

89       Extends "METHODS" in Mail::Reporter.
90
91   Constructors
92       Extends "Constructors" in Mail::Reporter.
93
94       $obj->clone()
95           Create a copy of this field object.
96
97       Mail::Message::Field->new($data)
98           See Mail::Message::Field::Fast::new(),
99           Mail::Message::Field::Flex::new(), and
100           Mail::Message::Field::Full::new().  By default, a "Fast" field is
101           produced.
102
103            -Option--Defined in     --Default
104             log     Mail::Reporter   'WARNINGS'
105             trace   Mail::Reporter   'WARNINGS'
106
107           log => LEVEL
108           trace => LEVEL
109
110   The field
111       $obj->isStructured()
112       Mail::Message::Field->isStructured()
113           Some fields are described in the RFCs as being structured: having a
114           well described syntax.  These fields have common ideas about
115           comments and the like, what they do not share with unstructured
116           fields, like the "Subject" field.
117
118           example:
119
120            my $field = Mail::Message::Field->new(From => 'me');
121            if($field->isStructured)
122
123            Mail::Message::Field->isStructured('From');
124
125       $obj->length()
126           Returns the total length of the field in characters, which includes
127           the field's name, body and folding characters.
128
129       $obj->nrLines()
130           Returns the number of lines needed to display this header-line.
131
132       $obj->print( [$fh] )
133           Print the whole header-line to the specified file-handle. One line
134           may result in more than one printed line, because of the folding of
135           long lines.  The $fh defaults to the selected handle.
136
137       $obj->size()
138           Returns the number of bytes needed to display this header-line,
139           Same as length().
140
141       $obj->string( [$wrap] )
142           Returns the field as string.  By default, this returns the same as
143           folded(). However, the optional $wrap will cause to re-fold to take
144           place (without changing the folding stored inside the field).
145
146       $obj->toDisclose()
147           Returns whether this field can be disclosed to other people, for
148           instance when sending the message to another party.  Returns a
149           "true" or "false" condition.  See also
150           Mail::Message::Head::Complete::printUndisclosed().
151
152   Access to the name
153       $obj->Name()
154           Returns the name of this field in original casing.  See name() as
155           well.
156
157       $obj->name()
158           Returns the name of this field, with all characters lower-cased for
159           ease of comparison.  See Name() as well.
160
161       $obj->wellformedName( [STRING] )
162           (Instance method class method) As instance method, the current
163           field's name is correctly formatted and returned.  When a STRING is
164           used, that one is formatted.
165
166           example:
167
168            print Mail::Message::Field->Name('content-type')
169              # -->  Content-Type
170
171            my $field = $head->get('date');
172            print $field->Name;
173              # -->  Date
174
175   Access to the body
176       $obj->body()
177           This method may be what you want, but usually, the foldedBody() and
178           unfoldedBody() are what you are looking for.  This method is
179           cultural heritage, and should be avoided.
180
181           Returns the body of the field.  When this field is structured, it
182           will be stripped from everything what is behind the first semi-
183           color (";").  In any case, the string is unfolded.  Whether the
184           field is structured is defined by isStructured().
185
186       $obj->folded()
187           Returns the folded version of the whole header.  When the header is
188           shorter than the wrap length, a list of one line is returned.
189           Otherwise more lines will be returned, all but the first starting
190           with at least one blank.  See also foldedBody() to get the same
191           information without the field's name.
192
193           In scalar context, the lines are delived into one string, which is
194           a little faster because that's the way they are stored
195           internally...
196
197           example:
198
199            my @lines = $field->folded;
200            print $field->folded;
201            print scalar $field->folded; # faster
202
203       $obj->foldedBody( [$body] )
204           Returns the body as a set of lines. In scalar context, this will be
205           one line containing newlines.  Be warned about the newlines when
206           you do pattern matching on the result of this method.
207
208           The optional $body argument changes the field's body.  The folding
209           of the argument must be correct.
210
211       $obj->stripCFWS( [STRING] )
212       Mail::Message::Field->stripCFWS( [STRING] )
213           Remove the comments and folding white spaces from the STRING.
214           Without string and only as instance method, the unfoldedBody() is
215           being stripped and returned.
216
217           WARNING: This operation is only allowed for structured header
218           fields (which are defined by the various RFCs as being so.  You
219           don't want parts within braces which are in the Subject header line
220           to be removed, to give an example.
221
222       $obj->unfoldedBody( [$body, [$wrap]] )
223           Returns the body as one single line, where all folding information
224           (if available) is removed.  This line will also NOT end on a new-
225           line.
226
227           The optional $body argument changes the field's body.  The right
228           folding is performed before assignment.  The $wrap may be specified
229           to enforce a folding size.
230
231           example:
232
233            my $body = $field->unfoldedBody;
234            print "$field";   # via overloading
235
236   Access to the content
237       $obj->addresses()
238           Returns a list of Mail::Address objects, which represent the e-mail
239           addresses found in this header line.
240
241           example:
242
243            my @addr = $message->head->get('to')->addresses;
244            my @addr = $message->to;
245
246       $obj->attribute( $name, [$value] )
247           Get the value of an attribute, optionally after setting it to a new
248           value.  Attributes are part of some header lines, and hide
249           themselves in the comment field.  If the attribute does not exist,
250           then "undef" is returned.  The attribute is still encoded.
251
252           example:
253
254            my $field = Mail::Message::Field->new(
255             'Content-Type: text/plain; charset="us-ascii"');
256
257            print $field->attribute('charset');
258              # --> us-ascii
259
260            print $field->attribute('bitmap') || 'no'
261              # --> no
262
263            $field->atrribute(filename => '/tmp/xyz');
264            $field->print;
265              # --> Content-Type: text/plain; charset="us-ascii";
266              #       filename="/tmp/xyz"
267              # Automatically folded, and no doubles created.
268
269       $obj->attributes()
270           Returns a list of key-value pairs, where the values are not yet
271           decoded.  Keys may appear more than once.
272
273           example:
274
275            my @pairs = $head->get('Content-Disposition')->attributes;
276
277       $obj->comment( [STRING] )
278           Returns the unfolded comment (part after a semi-colon) in a
279           structureed header-line. optionally after setting it to a new
280           STRING first.  When "undef" is specified as STRING, the comment is
281           removed.  Whether the field is structured is defined by
282           isStructured().
283
284           The comment part of a header field often contains "attributes".
285           Often it is preferred to use attribute() on them.
286
287       $obj->study()
288           Study the header field in detail: turn on the full parsing and
289           detailed understanding of the content of the fields.
290           Mail::Message::Field::Fast and Mail::Message::Field::Fast objects
291           will be transformed into any Mail::Message::Field::Full object.
292
293           example:
294
295            my $subject = $msg->head->get('subject')->study;
296            my $subject = $msg->head->study('subject');  # same
297            my $subject = $msg->study('subject');        # same
298
299       $obj->toDate( [$time] )
300       Mail::Message::Field->toDate( [$time] )
301           Convert a timestamp into an rfc2822 compliant date format.  This
302           differs from the default output of "localtime" in scalar context.
303           Without argument, the "localtime" is used to get the current time.
304           $time can be specified as one numeric (like the result of time())
305           and as list (like produced by c<localtime()> in list context).
306
307           Be sure to have your timezone set right, especially when this
308           script runs automatically.
309
310           example:
311
312            my $now = time;
313            Mail::Message::Field->toDate($now);
314            Mail::Message::Field->toDate(time);
315
316            Mail::Message::Field->toDate(localtime);
317            Mail::Message::Field->toDate;      # same
318            # returns something like:
319            #     Wed, 28 Aug 2002 10:40:25 +0200
320
321       $obj->toInt()
322           Returns the value which is related to this field as integer.  A
323           check is performed whether this is right.
324
325   Other methods
326       $obj->dateToTimestamp(STRING)
327       Mail::Message::Field->dateToTimestamp(STRING)
328           Convert a STRING which represents and RFC compliant time string
329           into a timestamp like is produced by the "time" function.
330
331   Internals
332       $obj->consume( $line | <$name,<$body|$objects>> )
333           Accepts a whole field $line, or a pair with the field's $name and
334           $body. In the latter case, the $body data may be specified as array
335           of $objects which are stringified.  Returned is a nicely formatted
336           pair of two strings: the field's name and a folded body.
337
338           This method is called by new(), and usually not by an application
339           program. The details about converting the $objects to a field
340           content are explained in "Specifying field data".
341
342       $obj->defaultWrapLength( [$length] )
343           Any field from any header for any message will have this default
344           wrapping.  This is maintained in one global variable.  Without a
345           specified $length, the current value is returned.  The default is
346           78.
347
348       $obj->fold( $name, $body, [$maxchars] )
349       Mail::Message::Field->fold( $name, $body, [$maxchars] )
350           Make the header field with $name fold into multiple lines.
351           Wrapping is performed by inserting newlines before a blanks in the
352           $body, such that no line exceeds the $maxchars and each line is as
353           long as possible.
354
355           The RFC requests for folding on nice spots, but this request is
356           mainly ignored because it would make folding too slow.
357
358       $obj->setWrapLength( [$length] )
359           Force the wrapping of this field to the specified $length
360           characters. The wrapping is performed with fold() and the results
361           stored within the field object.
362
363           example: refolding the field
364
365            $field->setWrapLength(99);
366
367       $obj->stringifyData(STRING|ARRAY|$objects)
368           This method implements the translation of user supplied objects
369           into ascii fields.  The process is explained in "Specifying field
370           data".
371
372       $obj->unfold(STRING)
373           The reverse action of fold(): all lines which form the body of a
374           field are joined into one by removing all line terminators (even
375           the last).  Possible leading blanks on the first line are removed
376           as well.
377
378   Error handling
379       Extends "Error handling" in Mail::Reporter.
380
381       $obj->AUTOLOAD()
382           Inherited, see "Error handling" in Mail::Reporter
383
384       $obj->addReport($object)
385           Inherited, see "Error handling" in Mail::Reporter
386
387       $obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,
388       $callback] )
389       Mail::Message::Field->defaultTrace( [$level]|[$loglevel,
390       $tracelevel]|[$level, $callback] )
391           Inherited, see "Error handling" in Mail::Reporter
392
393       $obj->errors()
394           Inherited, see "Error handling" in Mail::Reporter
395
396       $obj->log( [$level, [$strings]] )
397       Mail::Message::Field->log( [$level, [$strings]] )
398           Inherited, see "Error handling" in Mail::Reporter
399
400       $obj->logPriority($level)
401       Mail::Message::Field->logPriority($level)
402           Inherited, see "Error handling" in Mail::Reporter
403
404       $obj->logSettings()
405           Inherited, see "Error handling" in Mail::Reporter
406
407       $obj->notImplemented()
408           Inherited, see "Error handling" in Mail::Reporter
409
410       $obj->report( [$level] )
411           Inherited, see "Error handling" in Mail::Reporter
412
413       $obj->reportAll( [$level] )
414           Inherited, see "Error handling" in Mail::Reporter
415
416       $obj->trace( [$level] )
417           Inherited, see "Error handling" in Mail::Reporter
418
419       $obj->warnings()
420           Inherited, see "Error handling" in Mail::Reporter
421
422   Cleanup
423       Extends "Cleanup" in Mail::Reporter.
424
425       $obj->DESTROY()
426           Inherited, see "Cleanup" in Mail::Reporter
427

DETAILS

429   Field syntax
430       Fields are stored in the header of a message, which are represented by
431       Mail::Message::Head objects. A field is a combination of a name, body,
432       and attributes.  Especially the term "body" is cause for confusion:
433       sometimes the attributes are considered to be part of the body.
434
435       The name of the field is followed by a colon ("":"", not preceded by
436       blanks, but followed by one blank).  Each attribute is preceded by a
437       separate semi-colon ("";"").  Names of fields are case-insensitive and
438       cannot contain blanks.
439
440       . Example: of fields
441
442       Correct fields:
443
444        Field: hi!
445        Content-Type: text/html; charset=latin1
446
447       Incorrect fields, but accepted:
448
449        Field : wrong, blank before colon
450        Field:                 # wrong, empty
451        Field:not nice, blank preferred after colon
452        One Two: wrong, blank in name
453
454       Folding fields
455
456       Fields which are long can be folded to span more than one line.  The
457       real limit for lines in messages is only at 998 characters, however
458       such long lines are not easy to read without support of an application.
459       Therefore rfc2822 (which defines the message syntax) specifies
460       explicitly that field lines can be re-formatted into multiple sorter
461       lines without change of meaning, by adding new-line characters to any
462       field before any blank or tab.
463
464       Usually, the lines are reformatted to create lines which are 78
465       characters maximum. Some applications try harder to fold on nice spots,
466       like before attributes.  Especially the "Received" field is often
467       manually folded into some nice layout.  In most cases however, it is
468       preferred to produce lines which are as long as possible but max 78.
469
470       BE WARNED that all fields can be subjected to folding, and that you
471       usually want the unfolded value.
472
473       . Example: of field folding
474
475        Subject: this is a short line, and not folded
476
477        Subject: this subject field is much longer, and therefore
478         folded into multiple
479         lines, although one more than needed.
480
481       Structured fields
482
483       The rfc2822 describes a large number of header fields explicitly.
484       These fields have a defined meaning.  For some of the fields, like the
485       "Subject" field, the meaning is straight forward the contents itself.
486       These fields are the Unstructured Fields.
487
488       Other fields have a well defined internal syntax because their content
489       is needed by e-mail applications. For instance, the "To" field contains
490       addresses which must be understood by all applications in the same way.
491       These are the Structured Fields, see isStructured().
492
493       Comments in fields
494
495       Stuctured fields can contain comments, which are pieces of text
496       enclosed in parenthesis.  These comments can be placed close to
497       anywhere in the line and must be ignored be the application.  Not all
498       applications are capable of handling comments correctly in all
499       circumstances.
500
501       . Example: of field comments
502
503        To: mailbox (Mail::Box mailinglist) <mailbox@overmeer.net>
504        Date: Thu, 13 Sep 2001 09:40:48 +0200 (CEST)
505        Subject: goodbye (was: hi!)
506
507       On the first line, the text "Mail::Box mailinglist" is used as comment.
508       Be warned that rfc2822 explicitly states that comments in e-mail
509       address specifications should not be considered to contain any usable
510       information.
511
512       On the second line, the timezone is specified as comment. The "Date"
513       field format has no way to indicate the timezone of the sender, but
514       only contains the timezone difference to UTC, however one could decide
515       to add this as comment.  Application must ignore this data because the
516       "Date" field is structured.
517
518       The last field is unstructured.  The text between parentheses is an
519       integral part of the subject line.
520
521   Getting a field
522       As many programs as there are handling e-mail, as many variations on
523       accessing the header information are requested.  Be careful which way
524       you access the data: read the variations described here and decide
525       which solution suites your needs best.
526
527       Using get() field
528
529       The get() interface is copied from other Perl modules which can handle
530       e-mail messages.  Many applications which simply replace Mail::Internet
531       objects by Mail::Message objects will work without modification.
532
533       There is more than one get method.  The exact results depend on which
534       get you use.  When Mail::Message::get() is called, you will get the
535       unfolded, stripped from comments, stripped from attributes contents of
536       the field as string.  Character-set encodings will still be in the
537       string.  If the same fieldname appears more than once in the header,
538       only the last value is returned.
539
540       When Mail::Message::Head::get() is called in scalar context, the last
541       field with the specified name is returned as field object.  This object
542       strinigfies into the unfolded contents of the field, including
543       attributes and comments.  In list context, all appearances of the field
544       in the header are returned as objects.
545
546       BE WARNED that some lines seem unique, but are not according to the
547       official rfc.  For instance, "To" fields can appear more than once.  If
548       your program calls get('to') in scalar context, some information is
549       lost.
550
551       . Example: of using get()
552
553        print $msg->get('subject') || 'no subject';
554        print $msg->head->get('subject') || 'no subject';
555
556        my @to = $msg->head->get('to');
557
558       Using study() field
559
560       As the name "study" already implies, this way of accessing the fields
561       is much more thorough but also slower.  The "study" of a field is like
562       a "get", but provides easy access to the content of the field and
563       handles character-set decoding correctly.
564
565       The Mail::Message::study() method will only return the last field with
566       that name as object.  Mail::Message::Head::study() and
567       Mail::Message::Field::study() return all fields when used in list
568       context.
569
570       . Example: of using study()
571
572        print $msg->study('subject') || 'no subject';
573        my @rec  = $msg->head->study('Received');
574
575        my $from = $msg->head->get('From')->study;
576        my $from = $msg->head->study('From');  # same
577        my @addr = $from->addresses;
578
579       Using resent groups
580
581       Some fields belong together in a group of fields.  For instance, a set
582       of lines is used to define one step in the mail transport process.
583       Each step adds a "Received" line, and optionally some "Resent-*" lines
584       and "Return-Path".  These groups of lines shall stay together and in
585       order when the message header is processed.
586
587       The "Mail::Message::Head::ResentGroup" object simplifies the access to
588       these related fields.  These resent groups can be deleted as a whole,
589       or correctly constructed.
590
591       . Example: of using resent groups
592
593        my $rgs = $msg->head->resentGroups;
594        $rgs[0]->delete if @rgs;
595
596        $msg->head->removeResentGroups;
597
598   The field's data
599       There are many ways to get the fields info as object, and there are
600       also many ways to process this data within the field.
601
602       Access to the field
603
604string()
605
606           Returns the text of the body exactly as will be printed to file
607           when print() is called, so name, main body, and attributes.
608
609foldedBody()
610
611           Returns the text of the body, like string(), but without the name
612           of the field.
613
614unfoldedBody()
615
616           Returns the text of the body, like foldedBody(), but then with all
617           new-lines removed.  This is the normal way to get the content of
618           unstructured fields.  Character-set encodings will still be in
619           place.  Fields are stringified into their unfolded representation.
620
621stripCFWS()
622
623           Returns the text of structured fields, where new-lines and comments
624           are removed from the string.  This is a good start for parsing the
625           field, for instance to find e-mail addresses in them.
626
627Mail::Message::Field::Full::decodedBody()
628
629           Studied fields can produce the unfolded text decoded into utf8
630           strings.  This is an expensive process, but the only correct way to
631           get the field's data.  More useful for people who are not living in
632           ASCII space.
633
634       •   Studied fields
635
636           Studied fields have powerful methods to provide ways to access and
637           produce the contents of (structured) fields exactly as the involved
638           rfcs prescribe.
639
640       Using simplified field access
641
642       Some fields are accessed that often that there are support methods to
643       provide simplified access.  All these methods are called upon a message
644       directly.
645
646       . Example: of simplified field access
647
648        print $message->subject;
649        print $message->get('subject') || '';  # same
650
651        my @from = $message->from; # returns addresses
652        $message->reply->send if $message->sender;
653
654       The "sender" method will return the address specified in the "Sender"
655       field, or the first named in the "From" field.  It will return "undef"
656       in case no address is known.
657
658       Specifying field data
659
660       Field data can be anything, strongly dependent on the type of field at
661       hand. If you decide to construct the fields very carefully via some
662       Mail::Message::Field::Full extension (like via
663       Mail::Message::Field::Addresses objects), then you will have protection
664       build-in.  However, you can bluntly create any Mail::Message::Field
665       object based on some data.
666
667       When you create a field, you may specify a string, object, or an array
668       of strings and objects.  On the moment, objects are only used to help
669       the construction on e-mail addresses, however you may add some of your
670       own.
671
672       The following rules (implemented in stringifyData()) are obeyed given
673       the argument is:
674
675       •   a string
676
677           The string must be following the (complicated) rules of the
678           rfc2822, and is made field content as specified.  When the string
679           is not terminated by a new-line ("\n") it will be folded according
680           to the standard rules.
681
682       •   a Mail::Address object
683
684           The most used Perl object to parse and produce address lines.  This
685           object does not understand character set encodings in phrases.
686
687       •   a Mail::Identity object
688
689           As part of the User::Identity distribution, this object has full
690           understanding of the meaning of one e-mail address, related to a
691           person.  All features defined by rfc2822 are implemented.
692
693       •   a User::Identity object
694
695           A person is specified, which may have more than one
696           Mail::Identity's defined.  Some methods, like
697           Mail::Message::reply() and Mail::Message::forward() try to select
698           the right e-mail address smart (see their method descriptions), but
699           in other cases the first e-mail address found is used.
700
701       •   a User::Identity::Collection::Emails object
702
703           All Mail::Identity objects in the collection will be included in
704           the field as a group carying the name of the collection.
705
706       •   any other object
707
708           For all other objects, the stringification overload is used to
709           produce the field content.
710
711       •   an ARRAY
712
713           You may also specify an array with a mixture of any of the above.
714           The elements will be joined as comma-separated list.  If you do not
715           want comma's inbetween, you will have to process the array
716           yourself.
717
718       . Example: specifying simple field data
719
720        my $f = Mail::Message::Field->new(Subject => 'hi!');
721        my $b = Mail::Message->build(Subject => 'monkey');
722
723       . Example: s specifying e-mail addresses for a field
724
725        use Mail::Address;
726        my $fish = Mail::Address->new('Mail::Box', 'fish@tux.aq');
727        print $fish->format;   # ==> Mail::Box <fish@tux.aq>
728        my $exa  = Mail::Address->new(undef, 'me@example.com');
729        print $exa->format;    # ==> me@example.com
730
731        my $b = $msg->build(To => "you@example.com");
732        my $b = $msg->build(To => $fish);
733        my $b = $msg->build(To => [ $fish, $exa ]);
734
735        my @all = ($fish, "you@example.com", $exa);
736        my $b = $msg->build(To => \@all);
737        my $b = $msg->build(To => [ "xyz", @all ]);
738
739       . Example: specifying identities for a field
740
741        use User::Identity;
742        my $patrik = User::Identity->new
743         ( name      => 'patrik'
744         , full_name => "Patrik Fältström"  # from rfc
745         , charset   => "ISO-8859-1"
746         );
747        $patrik->add
748         ( email    => "him@home.net"
749         );
750
751        my $b = $msg->build(To => $patrik);
752
753        $b->get('To')->print;
754          # ==> =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?=
755          #     <him@home.net>
756
757   Field class implementation
758       For performance reasons only, there are three types of fields: the
759       fast, the flexible, and the full understander:
760
761       •   Mail::Message::Field::Fast
762
763           "Fast" objects are not derived from a "Mail::Reporter".  The
764           consideration is that fields are so often created, and such a small
765           objects at the same time, that setting-up a logging for each of the
766           objects is relatively expensive and not really useful.  The fast
767           field implementation uses an array to store the data: that will be
768           faster than using a hash.  Fast fields are not easily inheritable,
769           because the object creation and initiation is merged into one
770           method.
771
772       •   Mail::Message::Field::Flex
773
774           The flexible implementation uses a hash to store the data.  The
775           new() and "init" methods are split, so this object is extensible.
776
777       •   Mail::Message::Field::Full
778
779           With a full implementation of all applicable RFCs (about 5), the
780           best understanding of the fields is reached.  However, this comes
781           with a serious memory and performance penalty.  These objects are
782           created from fast or flex header fields when study() is called.
783

DIAGNOSTICS

785       Warning: Field content is not numerical: $content
786           The numeric value of a field is requested (for instance the "Lines"
787           or "Content-Length" fields should be numerical), however the data
788           contains weird characters.
789
790       Warning: Illegal character in field name $name
791           A new field is being created which does contain characters not
792           permitted by the RFCs.  Using this field in messages may break
793           other e-mail clients or transfer agents, and therefore mutulate or
794           extinguish your message.
795
796       Error: Package $package does not implement $method.
797           Fatal error: the specific package (or one of its superclasses) does
798           not implement this method where it should. This message means that
799           some other related classes do implement this method however the
800           class at hand does not.  Probably you should investigate this and
801           probably inform the author of the package.
802

SEE ALSO

804       This module is part of Mail-Message distribution version 3.012, built
805       on February 11, 2022. Website: http://perl.overmeer.net/CPAN/
806

LICENSE

808       Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>]. For other
809       contributors see ChangeLog.
810
811       This program is free software; you can redistribute it and/or modify it
812       under the same terms as Perl itself.  See http://dev.perl.org/licenses/
813
814
815
816perl v5.36.0                      2023-01-20           Mail::Message::Field(3)
Impressum