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