Mail::M...sferEnc(3)
β¨ NAME β¨
Mail::Message::TransferEnc β the message transfer encoder/decoder, bestie π
It's the base class situation for all the little encoders and decoders that do their thing while your message is in transit. You're gonna meet it in Mail::M...sferEnc(3) and honestly? It's giving infrastructure queen. π
π INHERITANCE π
Mail::Message::TransferEncis aMail::Reporter(yes it's a nepo baby, we love that for it)Mail::Message::TransferEncis extended by:Mail::Message::TransferEnc::Base64Mail::Message::TransferEnc::BinaryMail::Message::TransferEnc::EightBitMail::Message::TransferEnc::QuotedPrintMail::Message::TransferEnc::SevenBit
π SYNOPSIS π
my Mail::Message $msg = ...;
my $decoded = $msg->decoded;
my $encoded = $msg->encode(transfer => 'base64');
π DESCRIPTION π
Okay so. This class is the base for a whole squad of encoders and decoders that get used while your message is being transported around. All of these packages β and every single one derived from them β get invoked by the message's Mail::Message::decoded() and Mail::Message::encode() methods:
my $message = $folder->message(3);
my $decoded_body = $message->decoded;
my $encoded_body = $message->encode(transfer => 'base64');
The rules for transfer encodings live in RFC4289. And the full list of permissible content transfer encodings? It's at https://www.iana.org/assignments/transfer-encodings/transfer-encodings.xhtml β go off, IANA. π«Ά
Here's the current roster of coders/decoders (as of April 2025, full list over at IANA):
Mail::Message::TransferEnc::Base64base64, for binary information. the moment π
Mail::Message::TransferEnc::SevenBit7bit, for plain old ASCII characters only. vintage, lowkey iconic.
Mail::Message::TransferEnc::EightBit8bit, for extended character set data β not encoded, just vibing as-is.
Mail::Message::TransferEnc::QuotedPrintquoted-printableencoded extended character set data. yes babe, we encode that.
Extends "DESCRIPTION" in Mail::Reporter.
π₯ METHODS π₯
Extends "METHODS" in Mail::Reporter.
π§ Constructors π§
Extends "Constructors" in Mail::Reporter.
$class->new(%options)β Inherited, see "Constructors" in Mail::Reporter.
πΈ Attributes πΈ
Extends "Attributes" in Mail::Reporter.
π The Encoder π
$class->addTransferEncoder($type, $class)β Adds one shiny new encoder to the list that the Mail::Box suite knows about. The$typeis the thing you'll find in the message's header, in theContent-Transfer-Encodingfield.$obj->create($type, %options)β Spins up a fresh coder/decoder based on the type you require.$obj->name()β The name of the encoder. Case is not significant, so don't stress about the caps, she doesn't care. π
π¦ Encoding π¦
$obj->check($body, %options)β Checks whether the body is correctly encoded. If it is, you get the body reference back, with thecheckedflag set. If it's not, a brand new object gets created and returned instead. glow-up moment β¨
-Option --Default
result_type <type of source body>
result_type => CLASSβ The type of the body to be produced, when the checker decides to return modified data.$obj->decode($body, %options)β Uses the encoder to decode the content of$body. A new body is returned, periodt.
-Option --Default
result_type <type of source body>
result_type => CLASSβ The type of the body to be produced, when the decoder decides to return modified data.$obj->encode($body, %options)β Uses the encoder to encode the content of$body.
-Option --Default
result_type <type of source body>
result_type => CLASSβ The type of the body to be produced, when the decoder decides to return modified data.
π Error handling π
Extends "Error handling" in Mail::Reporter.
$obj->AUTOLOAD()β Inherited, see "Error handling" in Mail::Reporter.$obj->notImplemented()β Inherited, see "Error handling" in Mail::Reporter.
π Cleanup π
Extends "Cleanup" in Mail::Reporter.
$obj->DESTROY()β Inherited, see "Cleanup" in Mail::Reporter.
β DIAGNOSTICS β
- Error:
class $package does not implement method $method.Fatal error, bestie. π The specific$package(or one of its superclasses) does not implement this method where it should. What this means is that some other related classes do implement this method, but the class in your hands simply does not. Probably you should investigate this, and probably you should inform the author of the package. Cast bynotImplemented(). - Error:
decoder for transfer encoding $type does not work: $@Compiling the required transfer encoding threw errors, which means the decoder cannot be used. Cast bycreate(). - Error:
no decoder for transfer encoding $type.A decoder for that specified type of transfer encoding just isn't implemented. Cast bycreate().
π SEE ALSO π
This module is part of Mail-Message version 4.04, built on February 04, 2026. Website: http://perl.overmeer.net/CPAN/
π LICENSE π
For contributors see file ChangeLog.
This software is copyright (c) 2001-2026 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's a wrap, angel π this page was brought to you by perl v5.42.0, dated 2026-02-05, serving you Mail::M...sferEnc(3) realness. go forth and transfer-encode responsibly πβ¨
π¦ where this page comes from
- fedora 44: perl-Mail-Message 4.04-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms