1Mail::Box::Parser::PerlU(s3e)r Contributed Perl DocumentaMtaiioln::Box::Parser::Perl(3)
2
3
4
6 Mail::Box::Parser::Perl - reading messages from file using Perl
7
9 Mail::Box::Parser::Perl
10 is a Mail::Box::Parser
11 is a Mail::Reporter
12
15 The "Mail::Box::Parser::Perl" implements parsing of messages in Perl.
16 This may be a little slower than the "C" based parser
17 Mail::Box::Parser::C, but will also work on platforms where no C com‐
18 piler is available.
19
21 Constructors
22
23 Mail::Box::Parser::Perl->new(OPTIONS)
24
25 Option --Defined in --Default
26 file Mail::Box::Parser undef
27 filename Mail::Box::Parser <required>
28 fix_header_errors <false>
29 log Mail::Reporter 'WARNINGS'
30 mode Mail::Box::Parser 'r'
31 trace Mail::Reporter 'WARNINGS'
32 trusted <false>
33
34 . file FILE-HANDLE
35
36 . filename FILENAME
37
38 . fix_header_errors BOOLEAN
39
40 When header errors are detected, the parsing of the header will
41 be stopped. Other header lines will become part of the body of
42 the message. Set this flag to have the erroneous line added to
43 the previous header line.
44
45 . log LEVEL
46
47 . mode OPENMODE
48
49 . trace LEVEL
50
51 . trusted BOOLEAN
52
53 Is the input from the file to be trusted, or does it require
54 extra tests. Related to Mail::Box::new(trusted).
55
56 The parser
57
58 $obj->fileChanged
59
60 See "The parser" in Mail::Box::Parser
61
62 $obj->filename
63
64 See "The parser" in Mail::Box::Parser
65
66 $obj->fixHeaderErrors([BOOLEAN])
67
68 If set to "true", parsing of a header will not stop on an error,
69 but attempt to add the erroneous this line to previous field.
70 Without BOOLEAN, the current setting is returned.
71
72 Example:
73
74 $folder->parser->fixHeaderErrors(1);
75 my $folder = $mgr->open('folder', fix_header_errors => 1);
76
77 $obj->restart
78
79 See "The parser" in Mail::Box::Parser
80
81 $obj->start(OPTIONS)
82
83 See "The parser" in Mail::Box::Parser
84
85 $obj->stop
86
87 See "The parser" in Mail::Box::Parser
88
89 Parsing
90
91 $obj->bodyAsFile(FILEHANDLE [,CHARS [,LINES]])
92
93 See "Parsing" in Mail::Box::Parser
94
95 $obj->bodyAsList([,CHARS [,LINES]])
96
97 See "Parsing" in Mail::Box::Parser
98
99 $obj->bodyAsString([,CHARS [,LINES]])
100
101 See "Parsing" in Mail::Box::Parser
102
103 $obj->bodyDelayed([,CHARS [,LINES]])
104
105 See "Parsing" in Mail::Box::Parser
106
107 $obj->filePosition([POSITION])
108
109 See "Parsing" in Mail::Box::Parser
110
111 $obj->lineSeparator
112
113 See "Parsing" in Mail::Box::Parser
114
115 $obj->popSeparator
116
117 See "Parsing" in Mail::Box::Parser
118
119 $obj->pushSeparator(STRING⎪REGEXP)
120
121 See "Parsing" in Mail::Box::Parser
122
123 $obj->readHeader
124
125 $obj->readSeparator(OPTIONS)
126
127 See "Parsing" in Mail::Box::Parser
128
129 Internals
130
131 $obj->closeFile
132
133 See "Internals" in Mail::Box::Parser
134
135 $obj->defaultParserType([CLASS])
136
137 Mail::Box::Parser::Perl->defaultParserType([CLASS])
138
139 See "Internals" in Mail::Box::Parser
140
141 $obj->openFile(ARGS)
142
143 See "Internals" in Mail::Box::Parser
144
145 $obj->takeFileInfo
146
147 See "Internals" in Mail::Box::Parser
148
149 Error handling
150
151 $obj->AUTOLOAD
152
153 See "Error handling" in Mail::Reporter
154
155 $obj->addReport(OBJECT)
156
157 See "Error handling" in Mail::Reporter
158
159 $obj->defaultTrace([LEVEL]⎪[LOGLEVEL, TRACELEVEL]⎪[LEVEL, CALLBACK])
160
161 Mail::Box::Parser::Perl->defaultTrace([LEVEL]⎪[LOGLEVEL,
162 TRACELEVEL]⎪[LEVEL, CALLBACK])
163
164 See "Error handling" in Mail::Reporter
165
166 $obj->errors
167
168 See "Error handling" in Mail::Reporter
169
170 $obj->log([LEVEL [,STRINGS]])
171
172 Mail::Box::Parser::Perl->log([LEVEL [,STRINGS]])
173
174 See "Error handling" in Mail::Reporter
175
176 $obj->logPriority(LEVEL)
177
178 Mail::Box::Parser::Perl->logPriority(LEVEL)
179
180 See "Error handling" in Mail::Reporter
181
182 $obj->logSettings
183
184 See "Error handling" in Mail::Reporter
185
186 $obj->notImplemented
187
188 See "Error handling" in Mail::Reporter
189
190 $obj->report([LEVEL])
191
192 See "Error handling" in Mail::Reporter
193
194 $obj->reportAll([LEVEL])
195
196 See "Error handling" in Mail::Reporter
197
198 $obj->trace([LEVEL])
199
200 See "Error handling" in Mail::Reporter
201
202 $obj->warnings
203
204 See "Error handling" in Mail::Reporter
205
206 Cleanup
207
208 $obj->DESTROY
209
210 See "Cleanup" in Mail::Reporter
211
212 $obj->inGlobalDestruction
213
214 See "Cleanup" in Mail::Reporter
215
217 Warning: File $filename changed during access.
218
219 When a message parser starts working, it takes size and modification
220 time of the file at hand. If the folder is written, it checks wether
221 there were changes in the file made by external programs.
222
223 Calling Mail::Box::update() on a folder before it being closed will
224 read these new messages. But the real source of this problem is lock‐
225 ing: some external program (for instance the mail transfer agent, like
226 sendmail) uses a different locking mechanism as you do and therefore
227 violates your rights.
228
229 Error: Package $package does not implement $method.
230
231 Fatal error: the specific package (or one of its superclasses) does not
232 implement this method where it should. This message means that some
233 other related classes do implement this method however the class at
234 hand does not. Probably you should investigate this and probably
235 inform the author of the package.
236
237 Warning: Unexpected end of header in $source: $line
238
239 While parsing a message from the specified source (usually a file
240 name), the parser found a syntax error. According to the MIME specifi‐
241 cation in the RFCs, each header line must either contain a colon, or
242 start with a blank to indicate a folded field. Apparently, this header
243 contains a line which starts on the first position, but not with a
244 field name.
245
246 By default, parsing of the header will be stopped. If there are more
247 header lines after the erroneous line, they will be added to the body
248 of the message. In case of new(fix_headers) set, the parsing of the
249 header will be continued. The erroneous line will be added to the pre‐
250 ceding field.
251
253 This module is part of Mail-Box distribution version 2.070, built on
254 March 25, 2007. Website: http://perl.overmeer.net/mailbox/
255
257 Copyrights 2001-2007 by Mark Overmeer.For other contributors see
258 ChangeLog.
259
260 This program is free software; you can redistribute it and/or modify it
261 under the same terms as Perl itself. See
262 http://www.perl.com/perl/misc/Artistic.html
263
264
265
266perl v5.8.8 2007-03-25 Mail::Box::Parser::Perl(3)