1Mail::Message::Head::PaUrsteiralC(o3n)tributed Perl DocuMmaeinlt:a:tMieosnsage::Head::Partial(3)
2
3
4

NAME

6       Mail::Message::Head::Partial - subset of header information of a
7       message
8

INHERITANCE

10        Mail::Message::Head::Partial
11          is a Mail::Message::Head::Complete
12          is a Mail::Message::Head
13          is a Mail::Reporter
14

SYNOPSIS

16        my $partial = $head->strip;
17        $partial->isa('Mail::Message::Head')  # true
18        $partial->isDelayed                      # false
19        $partial->isPartial                      # true
20
21        $partial->removeFields( qr/^X-/ );
22        $partial->removeFieldsExcept( qw/To From/ );
23        $partial->removeResentGroups;
24        $partial->removeListGroup;
25        $partial->removeSpamGroups;
26

DESCRIPTION

28       Header information consumes a considerable amount of memory.  Most of
29       this information is only useful during a short period of time in your
30       program, or sometimes it is not used at all.  You then can decide to
31       remove most of the header information.  However, be warned that it will
32       be lost permanently: the header (and therefore the message) gets
33       mutulated!
34

OVERLOADED

36       overload: ""
37           See "OVERLOADED" in Mail::Message::Head
38
39       overload: bool
40           See "OVERLOADED" in Mail::Message::Head
41

METHODS

43   Constructors
44       $obj->build([PAIR|FIELD]-LIST)
45           See "Constructors" in Mail::Message::Head::Complete
46
47       $obj->clone([NAMES|ARRAY-OF-NAMES|REGEXS])
48           See "Constructors" in Mail::Message::Head::Complete
49
50       Mail::Message::Head::Partial->new(OPTIONS)
51           See "Constructors" in Mail::Message::Head
52
53   The header
54       $obj->isDelayed
55           See "The header" in Mail::Message::Head
56
57       $obj->isEmpty
58           See "The header" in Mail::Message::Head
59
60       $obj->isModified
61           See "The header" in Mail::Message::Head
62
63       $obj->knownNames
64           See "The header" in Mail::Message::Head
65
66       $obj->message([MESSAGE])
67           See "The header" in Mail::Message::Head
68
69       $obj->modified([BOOLEAN])
70           See "The header" in Mail::Message::Head
71
72       $obj->nrLines
73           See "The header" in Mail::Message::Head::Complete
74
75       $obj->orderedFields
76           See "The header" in Mail::Message::Head
77
78       $obj->size
79           See "The header" in Mail::Message::Head::Complete
80
81       $obj->wrap(INTEGER)
82           See "The header" in Mail::Message::Head::Complete
83
84   Access to the header
85       $obj->add(FIELD | LINE | (NAME,BODY[,ATTRS]))
86           See "Access to the header" in Mail::Message::Head::Complete
87
88       $obj->addListGroup(OBJECT)
89           See "Access to the header" in Mail::Message::Head::Complete
90
91       $obj->addResentGroup(RESENT-GROUP|DATA)
92           See "Access to the header" in Mail::Message::Head::Complete
93
94       $obj->addSpamGroup(OBJECT)
95           See "Access to the header" in Mail::Message::Head::Complete
96
97       $obj->cleanupOrderedFields
98           The header maintains a list of fields which are ordered in sequence
99           of definition.  It is required to maintain the header order to keep
100           the related fields of resent groups together.  The fields are also
101           included in a hash, sorted on their name for fast access.
102
103           The references to field objects in the hash are real, those in the
104           ordered list are weak.  So when field objects are removed from the
105           hash, their references in the ordered list are automagically
106           undef'd.
107
108           When many fields are removed, for instance with removeFields() or
109           removeFieldsExcept(), then it is useful to remove the list of
110           undefs from the ordered list as well.  In those cases, this method
111           is called automatically, however you may have your own reasons to
112           call this method.
113
114       $obj->count(NAME)
115           See "Access to the header" in Mail::Message::Head::Complete
116
117       $obj->delete(NAME)
118           See "Access to the header" in Mail::Message::Head::Complete
119
120       $obj->get(NAME [,INDEX])
121           See "Access to the header" in Mail::Message::Head
122
123       $obj->grepNames([NAMES|ARRAY-OF-NAMES|REGEXS])
124           See "Access to the header" in Mail::Message::Head::Complete
125
126       $obj->listGroup
127           See "Access to the header" in Mail::Message::Head::Complete
128
129       $obj->names
130           See "Access to the header" in Mail::Message::Head::Complete
131
132       $obj->print([FILEHANDLE])
133           See "Access to the header" in Mail::Message::Head::Complete
134
135       $obj->printSelected(FILEHANDLE, (STRING|REGEXP)s)
136           See "Access to the header" in Mail::Message::Head::Complete
137
138       $obj->printUndisclosed([FILEHANDLE])
139           See "Access to the header" in Mail::Message::Head::Complete
140
141       $obj->removeContentInfo
142           See "Access to the header" in Mail::Message::Head::Complete
143
144       $obj->removeField(FIELD)
145           See "Access to the header" in Mail::Message::Head::Complete
146
147       $obj->removeFields(STRING|REGEXP, [STRING|REGEXP, ...])
148           Remove the fields from the header which are exactly named 'STRING'
149           (case insensitive) or match the REGular EXPresssion.  Do not forget
150           to add the 'i' modifier to the REGEXP, because fields are case
151           insensitive.
152
153           See also removeField() which is used to remove one field object
154           from the header.  The reverse specification can be made with
155           "removeFieldsExcept()".
156
157           example:
158
159            $head->removeFields('bcc', 'received');
160            $head->removeFields( qr/^content-/i );
161
162       $obj->removeFieldsExcept(STRING|REGEXP, [STRING|REGEXP, ...])
163           Remove all fields from the header which are not equivalent to one
164           of the specified STRINGs (case-insensitive) and which are not
165           matching one of the REGular EXPressions.  Do not forget to add the
166           'i' modifier to the REGEXP, because fields are case insensitive.
167
168           See also removeField() which is used to remove one field object
169           from the header.  The reverse specification can be made with
170           "removeFields()".
171
172           example:
173
174            $head->removeFieldsExcept('subject', qr/^content-/i );
175            $head->removeFieldsExcept( qw/subject to from sender cc/ );
176
177       $obj->removeListGroup
178           Removes all header lines which are used to administer mailing
179           lists.  Which fields that are is explained in
180           Mail::Message::Head::ListGroup.  Returned is the number of removed
181           lines.
182
183       $obj->removeResentGroups
184           Removes all header lines which are member of a resent group, which
185           are explained in Mail::Message::Head::ResentGroup.  Returned is the
186           number of removed lines.
187
188           For removing single groups (for instance because you want to keep
189           the last), use Mail::Message::Head::FieldGroup::delete().
190
191       $obj->removeSpamGroups
192           Removes all header lines which were produced by spam detection and
193           spam-fighting software.  Which fields that are is explained in
194           Mail::Message::Head::SpamGroup.  Returned is the number of removed
195           lines.
196
197       $obj->resentGroups
198           See "Access to the header" in Mail::Message::Head::Complete
199
200       $obj->reset(NAME, FIELDS)
201           See "Access to the header" in Mail::Message::Head::Complete
202
203       $obj->set(FIELD | LINE | (NAME, BODY [,ATTRS]))
204           See "Access to the header" in Mail::Message::Head::Complete
205
206       $obj->spamDetected
207           See "Access to the header" in Mail::Message::Head::Complete
208
209       $obj->spamGroups([NAMES])
210           See "Access to the header" in Mail::Message::Head::Complete
211
212       $obj->string
213           See "Access to the header" in Mail::Message::Head::Complete
214
215       $obj->study(NAME [,INDEX])
216           See "Access to the header" in Mail::Message::Head
217
218   About the body
219       $obj->guessBodySize
220           See "About the body" in Mail::Message::Head
221
222       $obj->guessTimeStamp
223           See "About the body" in Mail::Message::Head::Complete
224
225       $obj->isMultipart
226           See "About the body" in Mail::Message::Head
227
228       $obj->recvstamp
229           See "About the body" in Mail::Message::Head::Complete
230
231       $obj->timestamp
232           See "About the body" in Mail::Message::Head::Complete
233
234   Internals
235       $obj->addNoRealize(FIELD)
236           See "Internals" in Mail::Message::Head
237
238       $obj->addOrderedFields(FIELDS)
239           See "Internals" in Mail::Message::Head
240
241       $obj->createFromLine
242           See "Internals" in Mail::Message::Head::Complete
243
244       $obj->createMessageId
245           See "Internals" in Mail::Message::Head::Complete
246
247       $obj->fileLocation
248           See "Internals" in Mail::Message::Head
249
250       $obj->load
251           See "Internals" in Mail::Message::Head
252
253       $obj->messageIdPrefix([PREFIX, [HOSTNAME]|CODE])
254           Mail::Message::Head::Partial->messageIdPrefix([PREFIX,
255           [HOSTNAME]|CODE])
256
257           See "Internals" in Mail::Message::Head::Complete
258
259       $obj->moveLocation(DISTANCE)
260           See "Internals" in Mail::Message::Head
261
262       $obj->read(PARSER)
263           See "Internals" in Mail::Message::Head
264
265       $obj->setNoRealize(FIELD)
266           See "Internals" in Mail::Message::Head
267
268   Error handling
269       $obj->AUTOLOAD
270           See "Error handling" in Mail::Reporter
271
272       $obj->addReport(OBJECT)
273           See "Error handling" in Mail::Reporter
274
275       $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK])
276           Mail::Message::Head::Partial->defaultTrace([LEVEL]|[LOGLEVEL,
277           TRACELEVEL]|[LEVEL, CALLBACK])
278
279           See "Error handling" in Mail::Reporter
280
281       $obj->errors
282           See "Error handling" in Mail::Reporter
283
284       $obj->log([LEVEL [,STRINGS]])
285           Mail::Message::Head::Partial->log([LEVEL [,STRINGS]])
286
287           See "Error handling" in Mail::Reporter
288
289       $obj->logPriority(LEVEL)
290           Mail::Message::Head::Partial->logPriority(LEVEL)
291
292           See "Error handling" in Mail::Reporter
293
294       $obj->logSettings
295           See "Error handling" in Mail::Reporter
296
297       $obj->notImplemented
298           See "Error handling" in Mail::Reporter
299
300       $obj->report([LEVEL])
301           See "Error handling" in Mail::Reporter
302
303       $obj->reportAll([LEVEL])
304           See "Error handling" in Mail::Reporter
305
306       $obj->trace([LEVEL])
307           See "Error handling" in Mail::Reporter
308
309       $obj->warnings
310           See "Error handling" in Mail::Reporter
311
312   Cleanup
313       $obj->DESTROY
314           See "Cleanup" in Mail::Reporter
315
316       $obj->inGlobalDestruction
317           See "Cleanup" in Mail::Reporter
318

DETAILS

320   Ordered header fields
321   Head class implementation
322   Subsets of header fields
323   Reducing the header size
324       A message header is very large in memory and quite large on disk, and
325       therefore a good candidate for size reduction.  One way to reduce the
326       size is by simply eliminating superfluous header fields.  Each field
327       requires at least 100 bytes of run-time memory, so this may help!
328
329       Before you start playing around with removeFields() and
330       removeFieldsExcept(), you may take a look at two large groups of fields
331       which can be removes as sets: the resent headers and the mailinglist
332       headers.
333
334       Resent headers describe the intermediate steps in the transmission
335       process for the messages.  After successful delivery, they are rarely
336       useful.
337
338       When you are archiving a mailinglist, it is hardly ever useful to store
339       a the list administration lines for each message as well.
340

DIAGNOSTICS

342       Warning: Cannot remove field $name from header: not found.
343           You ask to remove a field which is not known in the header.  Using
344           delete(), reset(), or set() to do the job will not result in
345           warnings: those methods check the existence of the field first.
346
347       Warning: Field objects have an implied name ($name)
348       Error: Package $package does not implement $method.
349           Fatal error: the specific package (or one of its superclasses) does
350           not implement this method where it should. This message means that
351           some other related classes do implement this method however the
352           class at hand does not.  Probably you should investigate this and
353           probably inform the author of the package.
354

SEE ALSO

356       This module is part of Mail-Box distribution version 2.097, built on
357       January 26, 2011. Website: http://perl.overmeer.net/mailbox/
358

LICENSE

360       Copyrights 2001-2011 by Mark Overmeer. For other contributors see
361       ChangeLog.
362
363       This program is free software; you can redistribute it and/or modify it
364       under the same terms as Perl itself.  See
365       http://www.perl.com/perl/misc/Artistic.html
366
367
368
369perl v5.12.3                      2011-01-26   Mail::Message::Head::Partial(3)
Impressum