.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::Box::Parser::C 3" .TH Mail::Box::Parser::C 3 2026-02-27 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::Box::Parser::C \- Parsing folders for MailBox with C routines .SH INHERITANCE .IX Header "INHERITANCE" .Vb 3 \& Mail::Box::Parser::C \& is a Mail::Box::Parser \& is a Mail::Reporter \& \& Mail::Box::Parser::C \& is a DynaLoader .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .SH DESCRIPTION .IX Header "DESCRIPTION" The Mail::Box::Parser::C implements parsing of messages in ANSI C, using Perl\*(Aqs XS extension facility. .PP This is an optional module for MailBox, and will (once installed) automatically be used by MailBox to parse e\-mail message content when the message is supplied as file\-handle. In all other cases, MailBox will use Mail::Box::Parser::Perl. .PP \&\fBBe aware:\fR This module versions 4.00 and up is not fully compatible with older releases: mainly the exception handling has changed. When you need to upgrade, please read \fIhttps://github.com/markov2/perl5\-Mail\-Box/wiki/\fR \&\fBVersion 3 is still maintained\fR and may see new releases as well. .PP Extends "DESCRIPTION" in Mail::Box::Parser. .SH METHODS .IX Header "METHODS" Extends "METHODS" in Mail::Box::Parser. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in Mail::Box::Parser. .ie n .IP $class\->\fBnew\fR(%options) 4 .el .IP \f(CW$class\fR\->\fBnew\fR(%options) 4 .IX Item "$class->new(%options)" Inherited, see "METHODS" in Mail::Box::Parser .Sp .Vb 6 \& \-Option \-\-Defined in \-\-Default \& file undef \& filename \& fix_header_errors Mail::Box::Parser false \& mode \*(Aqr\*(Aq \& trusted Mail::Box::Parser false .Ve .RS 4 .ie n .IP "file => $filehandle" 2 .el .IP "file => \f(CW$filehandle\fR" 2 .IX Item "file => $filehandle" Any IO::File or \f(CW\*(C`GLOB\*(C'\fR \f(CW$filehandle\fR which can be used to read the data from. In case this option is specified, the \f(CW\*(C`filename\*(C'\fR is informational only. .IP "filename => FILENAME" 2 .IX Item "filename => FILENAME" The name of the file to be read. .IP "fix_header_errors => BOOLEAN" 2 .IX Item "fix_header_errors => BOOLEAN" .PD 0 .ie n .IP "mode => $mode" 2 .el .IP "mode => \f(CW$mode\fR" 2 .IX Item "mode => $mode" .PD File open \f(CW$mode\fR, which defaults to \f(CW\*(Aqr\*(Aq\fR, which means \`read\-only\*(Aq. See \f(CW\*(C`perldoc \-f open\*(C'\fR for possible modes. Only applicable when no \f(CW\*(C`file\*(C'\fR is specified. .IP "trusted => BOOLEAN" 2 .IX Item "trusted => BOOLEAN" .RE .RS 4 .RE .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in Mail::Box::Parser. .ie n .IP $obj\->\fBboxnr\fR() 4 .el .IP \f(CW$obj\fR\->\fBboxnr\fR() 4 .IX Item "$obj->boxnr()" The number internally used by the C implementation to administer a single mail folder access. .ie n .IP "$any\->\fBdefaultParserType\fR( [$class] )" 4 .el .IP "\f(CW$any\fR\->\fBdefaultParserType\fR( [$class] )" 4 .IX Item "$any->defaultParserType( [$class] )" Inherited, see "Attributes" in Mail::Box::Parser .ie n .IP $obj\->\fBfile\fR() 4 .el .IP \f(CW$obj\fR\->\fBfile\fR() 4 .IX Item "$obj->file()" Only returns a value when passed as instantiation parameter. Otherwise, the used file\-handle stays in \*(AqC\-space\*(Aq. The connection between C and Perl is via the \fBboxnr()\fR. .ie n .IP $obj\->\fBfilename\fR() 4 .el .IP \f(CW$obj\fR\->\fBfilename\fR() 4 .IX Item "$obj->filename()" Returns the name of the file this parser is working on. .ie n .IP "$obj\->\fBfixHeaderErrors\fR( [BOOLEAN] )" 4 .el .IP "\f(CW$obj\fR\->\fBfixHeaderErrors\fR( [BOOLEAN] )" 4 .IX Item "$obj->fixHeaderErrors( [BOOLEAN] )" Inherited, see "Attributes" in Mail::Box::Parser .ie n .IP $obj\->\fBopenMode\fR() 4 .el .IP \f(CW$obj\fR\->\fBopenMode\fR() 4 .IX Item "$obj->openMode()" .ie n .IP $obj\->\fBtrusted\fR() 4 .el .IP \f(CW$obj\fR\->\fBtrusted\fR() 4 .IX Item "$obj->trusted()" Inherited, see "Attributes" in Mail::Box::Parser .SS Parsing .IX Subsection "Parsing" Extends "Parsing" in Mail::Box::Parser. .ie n .IP "$obj\->\fBbodyAsFile\fR( $fh [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyAsFile\fR( \f(CW$fh\fR [$chars, [$lines]] )" 4 .IX Item "$obj->bodyAsFile( $fh [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP "$obj\->\fBbodyAsList\fR( [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyAsList\fR( [$chars, [$lines]] )" 4 .IX Item "$obj->bodyAsList( [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP "$obj\->\fBbodyAsString\fR( [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyAsString\fR( [$chars, [$lines]] )" 4 .IX Item "$obj->bodyAsString( [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP "$obj\->\fBbodyDelayed\fR( [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyDelayed\fR( [$chars, [$lines]] )" 4 .IX Item "$obj->bodyDelayed( [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP $obj\->\fBlineSeparator\fR() 4 .el .IP \f(CW$obj\fR\->\fBlineSeparator\fR() 4 .IX Item "$obj->lineSeparator()" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP $obj\->\fBreadHeader\fR() 4 .el .IP \f(CW$obj\fR\->\fBreadHeader\fR() 4 .IX Item "$obj->readHeader()" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP $obj\->\fBstart\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBstart\fR(%options) 4 .IX Item "$obj->start(%options)" Start the parser by opening a file. .Sp .Vb 2 \& \-Option\-\-Default \& file undef .Ve .RS 4 .IP "file => FILEHANDLE|undef" 2 .IX Item "file => FILEHANDLE|undef" The file is already open, for instance because the data must be read from STDIN. .RE .RS 4 .RE .ie n .IP $obj\->\fBstop\fR() 4 .el .IP \f(CW$obj\fR\->\fBstop\fR() 4 .IX Item "$obj->stop()" Stop the parser, which will include a close of the file. The lock on the folder will not be removed (is not the responsibility of the parser). Improves base, see "Parsing" in Mail::Box::Parser .SS "Error handling" .IX Subsection "Error handling" Extends "Error handling" in Mail::Box::Parser. .ie n .IP $obj\->\fBAUTOLOAD\fR() 4 .el .IP \f(CW$obj\fR\->\fBAUTOLOAD\fR() 4 .IX Item "$obj->AUTOLOAD()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP $obj\->\fBnotImplemented\fR() 4 .el .IP \f(CW$obj\fR\->\fBnotImplemented\fR() 4 .IX Item "$obj->notImplemented()" Inherited, see "Error handling" in Mail::Reporter .SS Cleanup .IX Subsection "Cleanup" Extends "Cleanup" in Mail::Box::Parser. .ie n .IP $obj\->\fBDESTROY\fR() 4 .el .IP \f(CW$obj\fR\->\fBDESTROY\fR() 4 .IX Item "$obj->DESTROY()" Inherited, see "Cleanup" in Mail::Reporter .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: class $package does not implement method $method." 4 .el .IP "Error: class \f(CW$package\fR does not implement method \f(CW$method\fR." 4 .IX Item "Error: class $package does not implement method $method." Fatal error: the specific \f(CW$package\fR (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast by \f(CWnotImplemented()\fR .IP "Error: filename or handle required to create a parser." 4 .IX Item "Error: filename or handle required to create a parser." Cast by \f(CWnew()\fR .ie n .IP "Error: parser $type does not extend $pkg." 4 .el .IP "Error: parser \f(CW$type\fR does not extend \f(CW$pkg\fR." 4 .IX Item "Error: parser $type does not extend $pkg." Cast by \f(CWdefaultParserType()\fR .ie n .IP "Warning: unexpected end of header in $source: $line" 4 .el .IP "Warning: unexpected end of header in \f(CW$source:\fR \f(CW$line\fR" 4 .IX Item "Warning: unexpected end of header in $source: $line" While parsing a message from the specified source (usually a file name), the parser found a syntax error. According to the MIME specification in the RFCs, each header line must either contain a colon, or start with a blank to indicate a folded field. Apparently, this header contains a line which starts on the first position, but not with a field name. .Sp By default, parsing of the header will be stopped. If there are more header lines after the erroneous line, they will be added to the body of the message. In case of new(fix_header_errors) set, the parsing of the header will be continued. The erroneous line will be added to the preceding field. Cast by \f(CWreadHeader()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail\-Box\-Parser\-C version 4.01, built on February 25, 2026. Website: \fIhttp://perl.overmeer.net/CPAN/\fR .SH LICENSE .IX Header "LICENSE" For contributors see file ChangeLog. .PP This software is copyright (c) 2002\-2026 by Mark Overmeer. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.