1Mail::Box::Parser::PerlU(s3e)r Contributed Perl DocumentaMtaiioln::Box::Parser::Perl(3)
2
3
4

NAME

6       Mail::Box::Parser::Perl - reading messages from file using Perl
7

INHERITANCE

9        Mail::Box::Parser::Perl
10          is a Mail::Box::Parser
11          is a Mail::Reporter
12

SYNOPSIS

DESCRIPTION

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
18       compiler is available.
19
20       Extends "DESCRIPTION" in Mail::Box::Parser.
21

METHODS

23       Extends "METHODS" in Mail::Box::Parser.
24
25   Constructors
26       Extends "Constructors" in Mail::Box::Parser.
27
28       Mail::Box::Parser::Perl->new(%options)
29            -Option           --Defined in       --Default
30             file               Mail::Box::Parser  undef
31             filename           Mail::Box::Parser  <required>
32             fix_header_errors                     <false>
33             log                Mail::Reporter     'WARNINGS'
34             mode               Mail::Box::Parser  'r'
35             trace              Mail::Reporter     'WARNINGS'
36             trusted                               <false>
37
38           file => FILE-HANDLE
39           filename => FILENAME
40           fix_header_errors => BOOLEAN
41             When header errors are detected, the parsing of the header will
42             be stopped.  Other header lines will become part of the body of
43             the message.  Set this flag to have the erroneous line added to
44             the previous header line.
45
46           log => LEVEL
47           mode => OPENMODE
48           trace => LEVEL
49           trusted => BOOLEAN
50             Is the input from the file to be trusted, or does it require
51             extra tests.  Related to Mail::Box::new(trusted).
52
53   The parser
54       Extends "The parser" in Mail::Box::Parser.
55
56       $obj->fileChanged()
57           Inherited, see "The parser" in Mail::Box::Parser
58
59       $obj->filename()
60           Inherited, see "The parser" in Mail::Box::Parser
61
62       $obj->fixHeaderErrors( [BOOLEAN] )
63           If set to "true", parsing of a header will not stop on an error,
64           but attempt to add the erroneous this line to previous field.
65           Without BOOLEAN, the current setting is returned.
66
67           example:
68
69            $folder->parser->fixHeaderErrors(1);
70            my $folder = $mgr->open('folder', fix_header_errors => 1);
71
72       $obj->restart()
73           Inherited, see "The parser" in Mail::Box::Parser
74
75       $obj->start(%options)
76           Inherited, see "The parser" in Mail::Box::Parser
77
78       $obj->stop()
79           Inherited, see "The parser" in Mail::Box::Parser
80
81   Parsing
82       Extends "Parsing" in Mail::Box::Parser.
83
84       $obj->bodyAsFile( $fh [$chars, [$lines]] )
85           Inherited, see "Parsing" in Mail::Box::Parser
86
87       $obj->bodyAsList( [$chars, [$lines]] )
88           Inherited, see "Parsing" in Mail::Box::Parser
89
90       $obj->bodyAsString( [$chars, [$lines]] )
91           Inherited, see "Parsing" in Mail::Box::Parser
92
93       $obj->bodyDelayed( [$chars, [$lines]] )
94           Inherited, see "Parsing" in Mail::Box::Parser
95
96       $obj->filePosition( [$position] )
97           Inherited, see "Parsing" in Mail::Box::Parser
98
99       $obj->lineSeparator()
100           Inherited, see "Parsing" in Mail::Box::Parser
101
102       $obj->popSeparator()
103           Inherited, see "Parsing" in Mail::Box::Parser
104
105       $obj->pushSeparator(STRING|Regexp)
106           Inherited, see "Parsing" in Mail::Box::Parser
107
108       $obj->readHeader()
109       $obj->readSeparator(%options)
110           Inherited, see "Parsing" in Mail::Box::Parser
111
112   Internals
113       Extends "Internals" in Mail::Box::Parser.
114
115       $obj->closeFile()
116           Inherited, see "Internals" in Mail::Box::Parser
117
118       $obj->defaultParserType( [$class] )
119       Mail::Box::Parser::Perl->defaultParserType( [$class] )
120           Inherited, see "Internals" in Mail::Box::Parser
121
122       $obj->openFile($args)
123           Inherited, see "Internals" in Mail::Box::Parser
124
125       $obj->takeFileInfo()
126           Inherited, see "Internals" in Mail::Box::Parser
127
128   Error handling
129       Extends "Error handling" in Mail::Box::Parser.
130
131       $obj->AUTOLOAD()
132           Inherited, see "Error handling" in Mail::Reporter
133
134       $obj->addReport($object)
135           Inherited, see "Error handling" in Mail::Reporter
136
137       $obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,
138       $callback] )
139       Mail::Box::Parser::Perl->defaultTrace( [$level]|[$loglevel,
140       $tracelevel]|[$level, $callback] )
141           Inherited, see "Error handling" in Mail::Reporter
142
143       $obj->errors()
144           Inherited, see "Error handling" in Mail::Reporter
145
146       $obj->log( [$level, [$strings]] )
147       Mail::Box::Parser::Perl->log( [$level, [$strings]] )
148           Inherited, see "Error handling" in Mail::Reporter
149
150       $obj->logPriority($level)
151       Mail::Box::Parser::Perl->logPriority($level)
152           Inherited, see "Error handling" in Mail::Reporter
153
154       $obj->logSettings()
155           Inherited, see "Error handling" in Mail::Reporter
156
157       $obj->notImplemented()
158           Inherited, see "Error handling" in Mail::Reporter
159
160       $obj->report( [$level] )
161           Inherited, see "Error handling" in Mail::Reporter
162
163       $obj->reportAll( [$level] )
164           Inherited, see "Error handling" in Mail::Reporter
165
166       $obj->trace( [$level] )
167           Inherited, see "Error handling" in Mail::Reporter
168
169       $obj->warnings()
170           Inherited, see "Error handling" in Mail::Reporter
171
172   Cleanup
173       Extends "Cleanup" in Mail::Box::Parser.
174
175       $obj->DESTROY()
176           Inherited, see "Cleanup" in Mail::Reporter
177

DIAGNOSTICS

179       Warning: File $filename changed during access.
180           When a message parser starts working, it takes size and
181           modification time of the file at hand.  If the folder is written,
182           it checks whether there were changes in the file made by external
183           programs.
184
185           Calling Mail::Box::update() on a folder before it being closed will
186           read these new messages.  But the real source of this problem is
187           locking: some external program (for instance the mail transfer
188           agent, like sendmail) uses a different locking mechanism as you do
189           and therefore violates your rights.
190
191       Error: Package $package does not implement $method.
192           Fatal error: the specific package (or one of its superclasses) does
193           not implement this method where it should. This message means that
194           some other related classes do implement this method however the
195           class at hand does not.  Probably you should investigate this and
196           probably inform the author of the package.
197
198       Warning: Unexpected end of header in $source: $line
199           While parsing a message from the specified source (usually a file
200           name), the parser found a syntax error.  According to the MIME
201           specification in the RFCs, each header line must either contain a
202           colon, or start with a blank to indicate a folded field.
203           Apparently, this header contains a line which starts on the first
204           position, but not with a field name.
205
206           By default, parsing of the header will be stopped.  If there are
207           more header lines after the erroneous line, they will be added to
208           the body of the message.  In case of new(fix_headers) set, the
209           parsing of the header will be continued.  The erroneous line will
210           be added to the preceding field.
211

SEE ALSO

213       This module is part of Mail-Message distribution version 3.009, built
214       on February 07, 2020. Website: http://perl.overmeer.net/CPAN/
215

LICENSE

217       Copyrights 2001-2020 by [Mark Overmeer <markov@cpan.org>]. For other
218       contributors see ChangeLog.
219
220       This program is free software; you can redistribute it and/or modify it
221       under the same terms as Perl itself.  See http://dev.perl.org/licenses/
222
223
224
225perl v5.32.0                      2020-07-28        Mail::Box::Parser::Perl(3)
Impressum