mime encoded mailpacks
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 921
MIME::EncWords 0.040
MIME::EncWords is a Perl module created to deal with RFC-1522 encoded words (improved). more>>
MIME::EncWords is a Perl module created to deal with RFC-1522 encoded words (improved).
SYNOPSIS
MIME::EncWords is aimed to be another implimentation of MIME::Words so that it will achive more exact conformance with MIME specifications. Additionally, it contains some improvements. Following synopsis and descriptions are inherited from its inspirer, with description of improvements and clarifications added.
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
use MIME::EncWords qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Split string into array of decoded [DATA,CHARSET] pairs:
AT decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Encode a single unsafe word:
$encoded = encode_mimeword("xABFranxE7oisxBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and xABFranxE7oisxBB in town");
Fellow Americans, you probably wont know what the hell this module is for. Europeans, Russians, et al, you probably do.
For example, heres a valid MIME header you might get:
From: =?US-ASCII?Q?Keith_Moore?= < moore AT utk.edu >
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= < keld AT dkuug.dk >
CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard < PIRARD AT vm1.ulg.ac.be >
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
=?US-ASCII?Q?.._cool!?=
The fields basically decode to (sorry, I can only approximate the Latin characters with 7 bit sequences /o and e):
From: Keith Moore < moore AT cs.utk.edu >
To: Keld J/orn Simonsen < keld AT dkuug.dk >
CC: Andre Pirard < PIRARD AT vm1.ulg.ac.be >
Subject: If you can read this you understand the example... cool!
Supplement: Fellow Americans, Europeans, you probably wont know what the hell this module is for. East Asians, et al, you probably do.
For example, heres a valid MIME header you might get:
Subject: =?EUC-KR?B?sNTAuLinKGxhemluZXNzKSwgwvzB9ri7seIoaW1w?=
=?EUC-KR?B?YXRpZW5jZSksILGzuLgoaHVicmlzKQ==?=
The fields basically decode to (sorry, I cannot approximate the non-Latin multibyte characters with any 7 bit sequences):
Subject: ???(laziness), ????(impatience), ??(hubris)
<<lessSYNOPSIS
MIME::EncWords is aimed to be another implimentation of MIME::Words so that it will achive more exact conformance with MIME specifications. Additionally, it contains some improvements. Following synopsis and descriptions are inherited from its inspirer, with description of improvements and clarifications added.
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
use MIME::EncWords qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Split string into array of decoded [DATA,CHARSET] pairs:
AT decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Encode a single unsafe word:
$encoded = encode_mimeword("xABFranxE7oisxBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and xABFranxE7oisxBB in town");
Fellow Americans, you probably wont know what the hell this module is for. Europeans, Russians, et al, you probably do.
For example, heres a valid MIME header you might get:
From: =?US-ASCII?Q?Keith_Moore?= < moore AT utk.edu >
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= < keld AT dkuug.dk >
CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard < PIRARD AT vm1.ulg.ac.be >
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
=?US-ASCII?Q?.._cool!?=
The fields basically decode to (sorry, I can only approximate the Latin characters with 7 bit sequences /o and e):
From: Keith Moore < moore AT cs.utk.edu >
To: Keld J/orn Simonsen < keld AT dkuug.dk >
CC: Andre Pirard < PIRARD AT vm1.ulg.ac.be >
Subject: If you can read this you understand the example... cool!
Supplement: Fellow Americans, Europeans, you probably wont know what the hell this module is for. East Asians, et al, you probably do.
For example, heres a valid MIME header you might get:
Subject: =?EUC-KR?B?sNTAuLinKGxhemluZXNzKSwgwvzB9ri7seIoaW1w?=
=?EUC-KR?B?YXRpZW5jZSksILGzuLgoaHVicmlzKQ==?=
The fields basically decode to (sorry, I cannot approximate the non-Latin multibyte characters with any 7 bit sequences):
Subject: ???(laziness), ????(impatience), ??(hubris)
Download (0.021MB)
Added: 2007-07-09 License: Perl Artistic License Price:
841 downloads
MIME::WordDecoder 5.420
MIME::WordDecoder is a Perl module to decode RFC-1522 encoded words to a local representation. more>>
MIME::WordDecoder is a Perl module to decode RFC-1522 encoded words to a local representation.
SYNOPSIS
See MIME::Words for the basics of encoded words. See "DESCRIPTION" for how this class works.
use MIME::WordDecoder;
### Get the default word-decoder (used by unmime()):
$wd = default MIME::WordDecoder;
### Get a word-decoder which maps to ISO-8859-1 (Latin1):
$wd = supported MIME::WordDecoder "ISO-8859-1";
### Decode a MIME string (e.g., into Latin1) via the default decoder:
$str = $wd->decode(To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= );
### Decode a string using the default decoder, non-OO style:
$str = unmime(To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= );
A MIME::WordDecoder consists, fundamentally, of a hash which maps a character set name (US-ASCII, ISO-8859-1, etc.) to a subroutine which knows how to take bytes in that character set and turn them into the target string representation. Ideally, this target representation would be Unicode, but we dont want to overspecify the translation that takes place: if you want to convert MIME strings directly to Big5, thats your own decision.
The subroutine will be invoked with two arguments: DATA (the data in the given character set), and CHARSET (the upcased character set name).
For example:
### Keep 7-bit characters as-is, convert 8-bit characters to #:
sub keep7bit {
local $_ = shift;
tr/x00-x7F/#/c;
$_;
}
Heres a decoder which uses that:
### Construct a decoder:
$wd = MIME::WordDecoder->new({US-ASCII => "KEEP", ### sub { $_[0] }
ISO-8859-1 => &keep7bit,
ISO-8859-2 => &keep7bit,
Big5 => "WARN",
* => "DIE"});
### Convert some MIME text to a pure ASCII string...
$ascii = $wd->decode(To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= < keld >);
### ...which will now hold: "To: Keld J#rn Simonsen < keld >"
<<lessSYNOPSIS
See MIME::Words for the basics of encoded words. See "DESCRIPTION" for how this class works.
use MIME::WordDecoder;
### Get the default word-decoder (used by unmime()):
$wd = default MIME::WordDecoder;
### Get a word-decoder which maps to ISO-8859-1 (Latin1):
$wd = supported MIME::WordDecoder "ISO-8859-1";
### Decode a MIME string (e.g., into Latin1) via the default decoder:
$str = $wd->decode(To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= );
### Decode a string using the default decoder, non-OO style:
$str = unmime(To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= );
A MIME::WordDecoder consists, fundamentally, of a hash which maps a character set name (US-ASCII, ISO-8859-1, etc.) to a subroutine which knows how to take bytes in that character set and turn them into the target string representation. Ideally, this target representation would be Unicode, but we dont want to overspecify the translation that takes place: if you want to convert MIME strings directly to Big5, thats your own decision.
The subroutine will be invoked with two arguments: DATA (the data in the given character set), and CHARSET (the upcased character set name).
For example:
### Keep 7-bit characters as-is, convert 8-bit characters to #:
sub keep7bit {
local $_ = shift;
tr/x00-x7F/#/c;
$_;
}
Heres a decoder which uses that:
### Construct a decoder:
$wd = MIME::WordDecoder->new({US-ASCII => "KEEP", ### sub { $_[0] }
ISO-8859-1 => &keep7bit,
ISO-8859-2 => &keep7bit,
Big5 => "WARN",
* => "DIE"});
### Convert some MIME text to a pure ASCII string...
$ascii = $wd->decode(To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= < keld >);
### ...which will now hold: "To: Keld J#rn Simonsen < keld >"
Download (0.37MB)
Added: 2006-08-30 License: Perl Artistic License Price:
1150 downloads
jMimeMagic 0.1.0
jMimeMagic is a Java library for determining the MIME or content type of files or streams. more>>
jMimeMagic project is a Java library for determining the MIME or content type of files or streams.
Enhancements:
- The build system has been migrated to maven 1.x.
- Subversion is now used.
- A hinting flag has been added for file extensions hints.
- The ability to disable sub-matches for MIME-only detection has been added, and still needs work (e.g. submatch until a MIME is found).
- Content detection plugins are now supported.
- Logging has been switched over to commons-logging.
- This release cleans up Javadoc and enables site generation.
- There is other miscellaneous cleanup.
<<lessEnhancements:
- The build system has been migrated to maven 1.x.
- Subversion is now used.
- A hinting flag has been added for file extensions hints.
- The ability to disable sub-matches for MIME-only detection has been added, and still needs work (e.g. submatch until a MIME is found).
- Content detection plugins are now supported.
- Logging has been switched over to commons-logging.
- This release cleans up Javadoc and enables site generation.
- There is other miscellaneous cleanup.
Download (0.044MB)
Added: 2006-09-08 License: LGPL (GNU Lesser General Public License) Price:
1147 downloads
Encode::MIME::Header 2.23
Encode::MIME::Header is a Perl module that contains MIME B and Q header encoding. more>>
Encode::MIME::Header is a Perl module that contains MIME B and Q header encoding.
SYNOPSIS
use Encode qw/encode decode/;
$utf8 = decode(MIME-Header, $header);
$header = encode(MIME-Header, $utf8);
ABSTRACT
This module implements RFC 2047 Mime Header Encoding. There are 3 variant encoding names; MIME-Header, MIME-B and MIME-Q. The difference is described below
decode() encode()
----------------------------------------------
MIME-Header Both B and Q =?UTF-8?B?....?=
MIME-B B only; Q croaks =?UTF-8?B?....?=
MIME-Q Q only; B croaks =?UTF-8?Q?....?=
When you decode(=?encoding?X?ENCODED WORD?=), ENCODED WORD is extracted and decoded for X encoding (B for Base64, Q for Quoted-Printable). Then the decoded chunk is fed to decode(encoding). So long as encoding is supported by Encode, any source encoding is fine.
When you encode, it just encodes UTF-8 string with X encoding then quoted with =?UTF-8?X?....?= . The parts that RFC 2047 forbids to encode are left as is and long lines are folded within 76 bytes per line.
<<lessSYNOPSIS
use Encode qw/encode decode/;
$utf8 = decode(MIME-Header, $header);
$header = encode(MIME-Header, $utf8);
ABSTRACT
This module implements RFC 2047 Mime Header Encoding. There are 3 variant encoding names; MIME-Header, MIME-B and MIME-Q. The difference is described below
decode() encode()
----------------------------------------------
MIME-Header Both B and Q =?UTF-8?B?....?=
MIME-B B only; Q croaks =?UTF-8?B?....?=
MIME-Q Q only; B croaks =?UTF-8?Q?....?=
When you decode(=?encoding?X?ENCODED WORD?=), ENCODED WORD is extracted and decoded for X encoding (B for Base64, Q for Quoted-Printable). Then the decoded chunk is fed to decode(encoding). So long as encoding is supported by Encode, any source encoding is fine.
When you encode, it just encodes UTF-8 string with X encoding then quoted with =?UTF-8?X?....?= . The parts that RFC 2047 forbids to encode are left as is and long lines are folded within 76 bytes per line.
Download (1.9MB)
Added: 2007-07-17 License: Perl Artistic License Price:
829 downloads
Bundle::Encode 0.03
Bundle::Encode is a Perl bundle to install Encode modules and dependencies. more>>
Bundle::Encode is a Perl bundle to install Encode modules and dependencies.
SYNOPSIS
perl -MCPAN -e install Bundle::Encode
CONTENTS
Text::Iconv
Module::Build
Module::Build::Compat
Test::Simple
Test::More
Unicode::Japanese
CGI
ExtUtils::CBuilder
XML::Parser::Expat
IO::File
MIME::Base64
Getopt::Std
Getopt::Long
Unicode::Normalize
Font::TTF
Compress::Zlib
Spiffy
Cwd
File::Find
File::Path
FindBin
Config
Test::Builder
Test::Base
HTML::Entities::Pictogram
XSLoader
IDNA::Punycode
Net::IDN::Nameprep
Unicode::Normalize
Unicode::String
Scalar::Util
Encoding::BER
encoding::split
encoding::warnings
HTML::Encoding
Term::Encoding
XML::Encoding
Template::Provider::Encoding
Catalyst::Plugin::Unicode::Encoding
Email::MIME::Encodings
Convert::Charmap
Encode
Encode::IBM
Encode::compat
Encode::InCharset
Encode::JIS2K
Encode::ZapCP1252
Encode::Unicode::Japanese
Encode::HEBCI
Encode::Detect
Encode::HanConvert
Encode::Registry
Encode::TECkit
Encode::UTR22
Encode::DoubleEncodedUTF8
Encode::First
Encode::JavaScript::UCS
Encode::JP::Mobile
Encode::Punycode
Encode::BOCU1
Encode::BOCU1::XS
Encode::EUCJPMS
Encode::CNMap
Encode::Unicode::UTF7
Encode::IMAPUTF7
Encode::Mapper
<<lessSYNOPSIS
perl -MCPAN -e install Bundle::Encode
CONTENTS
Text::Iconv
Module::Build
Module::Build::Compat
Test::Simple
Test::More
Unicode::Japanese
CGI
ExtUtils::CBuilder
XML::Parser::Expat
IO::File
MIME::Base64
Getopt::Std
Getopt::Long
Unicode::Normalize
Font::TTF
Compress::Zlib
Spiffy
Cwd
File::Find
File::Path
FindBin
Config
Test::Builder
Test::Base
HTML::Entities::Pictogram
XSLoader
IDNA::Punycode
Net::IDN::Nameprep
Unicode::Normalize
Unicode::String
Scalar::Util
Encoding::BER
encoding::split
encoding::warnings
HTML::Encoding
Term::Encoding
XML::Encoding
Template::Provider::Encoding
Catalyst::Plugin::Unicode::Encoding
Email::MIME::Encodings
Convert::Charmap
Encode
Encode::IBM
Encode::compat
Encode::InCharset
Encode::JIS2K
Encode::ZapCP1252
Encode::Unicode::Japanese
Encode::HEBCI
Encode::Detect
Encode::HanConvert
Encode::Registry
Encode::TECkit
Encode::UTR22
Encode::DoubleEncodedUTF8
Encode::First
Encode::JavaScript::UCS
Encode::JP::Mobile
Encode::Punycode
Encode::BOCU1
Encode::BOCU1::XS
Encode::EUCJPMS
Encode::CNMap
Encode::Unicode::UTF7
Encode::IMAPUTF7
Encode::Mapper
Download (0.002MB)
Added: 2007-05-25 License: Perl Artistic License Price:
882 downloads
MIMEDefang 2.63
MIMEDefang is a flexible MIME email scanner. more>>
MIMEDefang is a flexible MIME email scanner designed to do all kinds of email processing, including anti-virus scanning, anti-spam scanning, replacing parts of messages with URLs, adding boilerplate disclaimers, and so on.
It can alter or delete various parts of a MIME message according to a Perl-based policy filter. It can also bounce messages with unacceptable attachments and modify SMTP response codes on the fly.
MIMEDefang works with the Sendmail 8.11 and newer "Milter" API, which makes it more flexible and efficient than procmail-based approaches.
Enhancements:
- A bug that caused SpamAssassin to leave files lying around in /tmp has been fixed.
- If no queue-ID exists when the DATA phase begins, this release attempts to obtain one (which improves Postfix compatibility.)
- There were several other minor bugfixes.
<<lessIt can alter or delete various parts of a MIME message according to a Perl-based policy filter. It can also bounce messages with unacceptable attachments and modify SMTP response codes on the fly.
MIMEDefang works with the Sendmail 8.11 and newer "Milter" API, which makes it more flexible and efficient than procmail-based approaches.
Enhancements:
- A bug that caused SpamAssassin to leave files lying around in /tmp has been fixed.
- If no queue-ID exists when the DATA phase begins, this release attempts to obtain one (which improves Postfix compatibility.)
- There were several other minor bugfixes.
Download (0.30MB)
Added: 2007-08-13 License: GPL (GNU General Public License) Price:
805 downloads
MIME::Head 5.420
MIME::Head is a MIME message header (a subclass of Mail::Header). more>>
MIME::Head is a MIME message header (a subclass of Mail::Header).
SYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
Construction
### Create a new, empty header, and populate it manually:
$head = MIME::Head->new;
$head->replace(content-type, text/plain; charset=US-ASCII);
$head->replace(content-length, $len);
### Parse a new header from a filehandle:
$head = MIME::Head->read(*STDIN);
### Parse a new header from a file, or a readable pipe:
$testhead = MIME::Head->from_file("/tmp/test.hdr");
$a_b_head = MIME::Head->from_file("cat a.hdr b.hdr |");
Output
### Output to filehandle:
$head->print(*STDOUT);
### Output as string:
print STDOUT $head->as_string;
print STDOUT $head->stringify;
Getting field contents
### Is this a reply?
$is_reply = 1 if ($head->get(Subject) =~ /^Re: /);
### Get receipt information:
print "Last received from: ", $head->get(Received, 0), "n";
@all_received = $head->get(Received);
### Print the subject, or the empty string if none:
print "Subject: ", $head->get(Subject,0), "n";
### Too many hops? Count em and see!
if ($head->count(Received) > 5) { ...
### Test whether a given field exists
warn "missing subject!" if (! $head->count(subject));
Setting field contents
### Declare this to be an HTML header:
$head->replace(Content-type, text/html);
Manipulating field contents
### Get rid of internal newlines in fields:
$head->unfold;
### Decode any Q- or B-encoded-text in fields (DEPRECATED):
$head->decode;
Getting high-level MIME information
### Get/set a given MIME attribute:
unless ($charset = $head->mime_attr(content-type.charset)) {
$head->mime_attr("content-type.charset" => "US-ASCII");
}
### The content type (e.g., "text/html"):
$mime_type = $head->mime_type;
### The content transfer encoding (e.g., "quoted-printable"):
$mime_encoding = $head->mime_encoding;
### The recommended name when extracted:
$file_name = $head->recommended_filename;
### The boundary text, for multipart messages:
$boundary = $head->multipart_boundary;
<<lessSYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
Construction
### Create a new, empty header, and populate it manually:
$head = MIME::Head->new;
$head->replace(content-type, text/plain; charset=US-ASCII);
$head->replace(content-length, $len);
### Parse a new header from a filehandle:
$head = MIME::Head->read(*STDIN);
### Parse a new header from a file, or a readable pipe:
$testhead = MIME::Head->from_file("/tmp/test.hdr");
$a_b_head = MIME::Head->from_file("cat a.hdr b.hdr |");
Output
### Output to filehandle:
$head->print(*STDOUT);
### Output as string:
print STDOUT $head->as_string;
print STDOUT $head->stringify;
Getting field contents
### Is this a reply?
$is_reply = 1 if ($head->get(Subject) =~ /^Re: /);
### Get receipt information:
print "Last received from: ", $head->get(Received, 0), "n";
@all_received = $head->get(Received);
### Print the subject, or the empty string if none:
print "Subject: ", $head->get(Subject,0), "n";
### Too many hops? Count em and see!
if ($head->count(Received) > 5) { ...
### Test whether a given field exists
warn "missing subject!" if (! $head->count(subject));
Setting field contents
### Declare this to be an HTML header:
$head->replace(Content-type, text/html);
Manipulating field contents
### Get rid of internal newlines in fields:
$head->unfold;
### Decode any Q- or B-encoded-text in fields (DEPRECATED):
$head->decode;
Getting high-level MIME information
### Get/set a given MIME attribute:
unless ($charset = $head->mime_attr(content-type.charset)) {
$head->mime_attr("content-type.charset" => "US-ASCII");
}
### The content type (e.g., "text/html"):
$mime_type = $head->mime_type;
### The content transfer encoding (e.g., "quoted-printable"):
$mime_encoding = $head->mime_encoding;
### The recommended name when extracted:
$file_name = $head->recommended_filename;
### The boundary text, for multipart messages:
$boundary = $head->multipart_boundary;
Download (0.38MB)
Added: 2007-08-13 License: Perl Artistic License Price:
803 downloads
Added: 2009-07-15 License: Perl Artistic License Price: FREE
10 downloads
MIME::Words 5.420
MIME::Words is a Perl module to deal with RFC-1522 encoded words. more>>
MIME::Words is a Perl module to deal with RFC-1522 encoded words.
SYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
use MIME::Words qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Split string into array of decoded [DATA,CHARSET] pairs:
@decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Encode a single unsafe word:
$encoded = encode_mimeword("xABFranxE7oisxBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and xABFranxE7oisxBB in town");
Fellow Americans, you probably wont know what the hell this module is for. Europeans, Russians, et al, you probably do.
For example, heres a valid MIME header you might get:
From: =?US-ASCII?Q?Keith_Moore?= < moore@cs.utk.edu>
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= < keld@dkuug.dk>
CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard < PIRARD@vm1.ulg.ac.be>
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
=?US-ASCII?Q?.._cool!?=
The fields basically decode to (sorry, I can only approximate the Latin characters with 7 bit sequences /o and e):
From: Keith Moore < moore@cs.utk.edu>
To: Keld J/orn Simonsen < keld@dkuug.dk>
CC: Andre Pirard < PIRARD@vm1.ulg.ac.be>
Subject: If you can read this you understand the example... cool!
<<lessSYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
use MIME::Words qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Split string into array of decoded [DATA,CHARSET] pairs:
@decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Encode a single unsafe word:
$encoded = encode_mimeword("xABFranxE7oisxBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and xABFranxE7oisxBB in town");
Fellow Americans, you probably wont know what the hell this module is for. Europeans, Russians, et al, you probably do.
For example, heres a valid MIME header you might get:
From: =?US-ASCII?Q?Keith_Moore?= < moore@cs.utk.edu>
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= < keld@dkuug.dk>
CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard < PIRARD@vm1.ulg.ac.be>
Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
=?US-ASCII?Q?.._cool!?=
The fields basically decode to (sorry, I can only approximate the Latin characters with 7 bit sequences /o and e):
From: Keith Moore < moore@cs.utk.edu>
To: Keld J/orn Simonsen < keld@dkuug.dk>
CC: Andre Pirard < PIRARD@vm1.ulg.ac.be>
Subject: If you can read this you understand the example... cool!
Download (0.38MB)
Added: 2007-07-20 License: Perl Artistic License Price:
828 downloads
MIME::Parser 5.420
MIME::Parser is a experimental class for parsing MIME streams. more>>
MIME::Parser is a experimental class for parsing MIME streams.
SYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
Basic usage examples
### Create a new parser object:
my $parser = new MIME::Parser;
### Tell it where to put things:
$parser->output_under("/tmp");
### Parse an input filehandle:
$entity = $parser->parse(*STDIN);
### Congratulations: you now have a (possibly multipart) MIME entity!
$entity->dump_skeleton; # for debugging
Examples of input
### Parse from filehandles:
$entity = $parser->parse(*STDIN);
$entity = $parser->parse(IO::File->new("some command|");
### Parse from any object that supports getline() and read():
$entity = $parser->parse($myHandle);
### Parse an in-core MIME message:
$entity = $parser->parse_data($message);
### Parse an MIME message in a file:
$entity = $parser->parse_open("/some/file.msg");
### Parse an MIME message out of a pipeline:
$entity = $parser->parse_open("gunzip - < file.msg.gz |");
### Parse already-split input (as "deliver" would give it to you):
$entity = $parser->parse_two("msg.head", "msg.body");
Examples of output control
### Keep parsed message bodies in core (default outputs to disk):
$parser->output_to_core(1);
### Output each message body to a one-per-message directory:
$parser->output_under("/tmp");
### Output each message body to the same directory:
$parser->output_dir("/tmp");
### Change how nameless message-component files are named:
$parser->output_prefix("msg");
Examples of error recovery
### Normal mechanism:
eval { $entity = $parser->parse(*STDIN) };
if ($@) {
$results = $parser->results;
$decapitated = $parser->last_head; ### get last top-level head
}
### Ultra-tolerant mechanism:
$parser->ignore_errors(1);
$entity = eval { $parser->parse(*STDIN) };
$error = ($@ || $parser->last_error);
### Cleanup all files created by the parse:
eval { $entity = $parser->parse(*STDIN) };
...
$parser->filer->purge;
Examples of parser options
### Automatically attempt to RFC-1522-decode the MIME headers?
$parser->decode_headers(1); ### default is false
### Parse contained "message/rfc822" objects as nested MIME streams?
$parser->extract_nested_messages(0); ### default is true
### Look for uuencode in "text" messages, and extract it?
$parser->extract_uuencode(1); ### default is false
### Should we forgive normally-fatal errors?
$parser->ignore_errors(0); ### default is true
Miscellaneous examples
### Convert a Mail::Internet object to a MIME::Entity:
@lines = (@{$mail->header}, "n", @{$mail->body});
$entity = $parser->parse_data(@lines);
<<lessSYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
Basic usage examples
### Create a new parser object:
my $parser = new MIME::Parser;
### Tell it where to put things:
$parser->output_under("/tmp");
### Parse an input filehandle:
$entity = $parser->parse(*STDIN);
### Congratulations: you now have a (possibly multipart) MIME entity!
$entity->dump_skeleton; # for debugging
Examples of input
### Parse from filehandles:
$entity = $parser->parse(*STDIN);
$entity = $parser->parse(IO::File->new("some command|");
### Parse from any object that supports getline() and read():
$entity = $parser->parse($myHandle);
### Parse an in-core MIME message:
$entity = $parser->parse_data($message);
### Parse an MIME message in a file:
$entity = $parser->parse_open("/some/file.msg");
### Parse an MIME message out of a pipeline:
$entity = $parser->parse_open("gunzip - < file.msg.gz |");
### Parse already-split input (as "deliver" would give it to you):
$entity = $parser->parse_two("msg.head", "msg.body");
Examples of output control
### Keep parsed message bodies in core (default outputs to disk):
$parser->output_to_core(1);
### Output each message body to a one-per-message directory:
$parser->output_under("/tmp");
### Output each message body to the same directory:
$parser->output_dir("/tmp");
### Change how nameless message-component files are named:
$parser->output_prefix("msg");
Examples of error recovery
### Normal mechanism:
eval { $entity = $parser->parse(*STDIN) };
if ($@) {
$results = $parser->results;
$decapitated = $parser->last_head; ### get last top-level head
}
### Ultra-tolerant mechanism:
$parser->ignore_errors(1);
$entity = eval { $parser->parse(*STDIN) };
$error = ($@ || $parser->last_error);
### Cleanup all files created by the parse:
eval { $entity = $parser->parse(*STDIN) };
...
$parser->filer->purge;
Examples of parser options
### Automatically attempt to RFC-1522-decode the MIME headers?
$parser->decode_headers(1); ### default is false
### Parse contained "message/rfc822" objects as nested MIME streams?
$parser->extract_nested_messages(0); ### default is true
### Look for uuencode in "text" messages, and extract it?
$parser->extract_uuencode(1); ### default is false
### Should we forgive normally-fatal errors?
$parser->ignore_errors(0); ### default is true
Miscellaneous examples
### Convert a Mail::Internet object to a MIME::Entity:
@lines = (@{$mail->header}, "n", @{$mail->body});
$entity = $parser->parse_data(@lines);
Download (0.38MB)
Added: 2006-11-17 License: Perl Artistic License Price:
1073 downloads
HTML Entity Based Codepage Inference 0.01
HEBCI is a technique that allows a Web form handler to transparently detect the character set with which its data was encoded. more>> <<less
Download (0.005MB)
Added: 2005-07-05 License: GPL (GNU General Public License) Price:
1575 downloads
MIME::AltWords 0.12
MIME::AltWords Perl module can properly deal with RFC-1522 encoded words. more>>
MIME::AltWords Perl module can properly deal with RFC-1522 encoded words.
SYNOPSIS
The Perl module MIME::AltWords is recommended for encoding and decoding MIME words (such as =?ISO-8859-2?Q?_=E1ll_e=E1r?=) found in e-mail message headers (mostly Subject, From and To).
MIME::AltWords is similar to MIME::Words in MIME::Tools, but it provides an alternate implementation that follows the MIME specification more carefully, and it is actually compatible with existing mail software (tested with Mutt, Pine, JavaMail and OpenWebmail). MIME::AltWords extends the functionality of MIME::Words (version 5.420) by adding more functions and more options to existing functions. The original interface is changed in an upward-compatible way.
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
use MIME::AltWords qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Split string into array of decoded [DATA,CHARSET] pairs:
@decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Encode a single unsafe word:
$encoded = encode_mimeword("xABFranxE7oisxBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and xABFranxE7oisxBB in town");
<<lessSYNOPSIS
The Perl module MIME::AltWords is recommended for encoding and decoding MIME words (such as =?ISO-8859-2?Q?_=E1ll_e=E1r?=) found in e-mail message headers (mostly Subject, From and To).
MIME::AltWords is similar to MIME::Words in MIME::Tools, but it provides an alternate implementation that follows the MIME specification more carefully, and it is actually compatible with existing mail software (tested with Mutt, Pine, JavaMail and OpenWebmail). MIME::AltWords extends the functionality of MIME::Words (version 5.420) by adding more functions and more options to existing functions. The original interface is changed in an upward-compatible way.
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
use MIME::AltWords qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Split string into array of decoded [DATA,CHARSET] pairs:
@decoded = decode_mimewords(
To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= ,
);
### Encode a single unsafe word:
$encoded = encode_mimeword("xABFranxE7oisxBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and xABFranxE7oisxBB in town");
Download (0.021MB)
Added: 2007-07-20 License: Perl Artistic License Price:
826 downloads
MIME-tool 1.5
MIME-tool is a little mime encoding tool. more>>
MIME-tool is a little mime encoding tool I slapped together when I needed something on a production box at work (productions = no C development environment, only the ancient K&R compiler required for god-knows-what sys-admin task).
The resulting program will compile happilly on both the crippled C compilers bundled with some commercial *nix distributions, and on full ANSI/ISO C compilers like gcc.
I wrote this program when I needed a tool to construct MIME encoded emails with file attachments in job scripts on a production box. Being a production box it didnt have any development tools installed. However, the box DID have a K&R C compiler that appears to be necessary for some administrative task or another (configuring the kernel?). If you tried to compile even fairly simple ANSI/ISO C source the compiler bitched and moaned about all the stuff it didnt support, which will stop most folk (at least those who dont know anything about the history of the C programming language) from building their own binaries.
Since Im old enough to actually have written C code back before we had the ANSI/ISO standard and all the accompanying niceties, I was not stymied by a the lack of ANSI/ISO support. Its really not all that hard to write K&R compliant code, so long as you dont need the compiler to check your function calls for you. For a program this small, however, thats not much of a concern.
Since the program is meant to be compiled on systems with minimal support (there is no telling what unrestrained IT staff will decide must be removed in the interest of system security) I didnt bother to include a makefile. On every system I have tried, however, the program compiled with the simple incantation
cc -o mime mime.c
but your selected target system may require extra special magics.
The program supports the basic MIME standard: The caller can select the content type (application/octet-stream, text/plain, or user specified), content type encoding (7bit, 8bit, binary, base64 or auto-detected) and the boundry string (defaults to "=_MIME_CONTENT_BREAK_="). Further, the caller may specify the e-mail subject, to address, from address, carbon copy address and text for a prolog and epilog. The content type and encoding may be specified separately for each attached file.
The programs calling format is:
mime [-dDvV] [-S subject] [-F from-address] [-T to-address]
[-C carbon-copy address] [-P prolog-text] [-E epiplogue-text]
[-B boundry] {[-78abqux] [-t content-type] filename}
-d low detail debugging
-D high detail debugging
-v verbose messages
-V very verbose messages
-7 7-bit ASCII encoding
-8 8-bit ASCII encoding
-a application/octet-stream content type
-b binary encoding
-q quoted-printable encoding
-t text/plain content type
-u unknown encoding, auto-detect
-x base64 encoding
Theres really not much to this program. Once you know how the MIME messages are constructed you could do most of it manually (except for the base64 encoding, which would require a program like this), but if there are any problems with it, I would like to know about them.
Enhancements:
- A typo in the online help message was fixed.
- A known bugs section was added to the manpage.
- Proper quoting and folding were added to the filename header.
<<lessThe resulting program will compile happilly on both the crippled C compilers bundled with some commercial *nix distributions, and on full ANSI/ISO C compilers like gcc.
I wrote this program when I needed a tool to construct MIME encoded emails with file attachments in job scripts on a production box. Being a production box it didnt have any development tools installed. However, the box DID have a K&R C compiler that appears to be necessary for some administrative task or another (configuring the kernel?). If you tried to compile even fairly simple ANSI/ISO C source the compiler bitched and moaned about all the stuff it didnt support, which will stop most folk (at least those who dont know anything about the history of the C programming language) from building their own binaries.
Since Im old enough to actually have written C code back before we had the ANSI/ISO standard and all the accompanying niceties, I was not stymied by a the lack of ANSI/ISO support. Its really not all that hard to write K&R compliant code, so long as you dont need the compiler to check your function calls for you. For a program this small, however, thats not much of a concern.
Since the program is meant to be compiled on systems with minimal support (there is no telling what unrestrained IT staff will decide must be removed in the interest of system security) I didnt bother to include a makefile. On every system I have tried, however, the program compiled with the simple incantation
cc -o mime mime.c
but your selected target system may require extra special magics.
The program supports the basic MIME standard: The caller can select the content type (application/octet-stream, text/plain, or user specified), content type encoding (7bit, 8bit, binary, base64 or auto-detected) and the boundry string (defaults to "=_MIME_CONTENT_BREAK_="). Further, the caller may specify the e-mail subject, to address, from address, carbon copy address and text for a prolog and epilog. The content type and encoding may be specified separately for each attached file.
The programs calling format is:
mime [-dDvV] [-S subject] [-F from-address] [-T to-address]
[-C carbon-copy address] [-P prolog-text] [-E epiplogue-text]
[-B boundry] {[-78abqux] [-t content-type] filename}
-d low detail debugging
-D high detail debugging
-v verbose messages
-V very verbose messages
-7 7-bit ASCII encoding
-8 8-bit ASCII encoding
-a application/octet-stream content type
-b binary encoding
-q quoted-printable encoding
-t text/plain content type
-u unknown encoding, auto-detect
-x base64 encoding
Theres really not much to this program. Once you know how the MIME messages are constructed you could do most of it manually (except for the base64 encoding, which would require a program like this), but if there are any problems with it, I would like to know about them.
Enhancements:
- A typo in the online help message was fixed.
- A known bugs section was added to the manpage.
- Proper quoting and folding were added to the filename header.
Download (0.013MB)
Added: 2006-06-04 License: GPL (GNU General Public License) Price:
1245 downloads
MIME::Charset 0.044
MIME::Charset module contains charset informations for MIME. more>>
MIME::Charset module contains charset information for MIME.
SYNOPSIS
Getting charset informations:
use MIME::Charset qw(:info);
$benc = body_encoding("iso-8859-2"); # "Q"
$cset = canonical_charset("ANSI X3.4-1968"); # "US-ASCII"
$henc = header_encoding("utf-8"); # "S"
$cset = output_charset("shift_jis"); # "ISO-2022-JP"
Translating text data:
use MIME::Charset qw(:trans);
($text, $charset, $encoding) =
header_encode(
"xc9xc2xc5xaaxc0xdexc3xefxc5xaa".
"xc7xd1xcaxaaxbdxd0xcexcfxb4xef",
"euc-jp");
# ...returns (< converted >, "ISO-2022-JP", "B");
($text, $charset, $encoding) =
body_encode(
"Collectioneur pathxe9tiquement ".
"xe9clectique de dxe9chets",
"latin1");
# ...returns (< original >, "ISO-8859-1", "QUOTED-PRINTABLE");
$len = encoded_header_len(
"Perlxe8xa8x80xe8xaax9e", "b", "utf-8"); # 28
Manipulating module defaults:
use MIME::Charset;
MIME::Charset::alias("csEUCKR", "euc-kr");
MIME::Charset::default("iso-8859-1");
MIME::Charset::fallback("us-ascii");
<<lessSYNOPSIS
Getting charset informations:
use MIME::Charset qw(:info);
$benc = body_encoding("iso-8859-2"); # "Q"
$cset = canonical_charset("ANSI X3.4-1968"); # "US-ASCII"
$henc = header_encoding("utf-8"); # "S"
$cset = output_charset("shift_jis"); # "ISO-2022-JP"
Translating text data:
use MIME::Charset qw(:trans);
($text, $charset, $encoding) =
header_encode(
"xc9xc2xc5xaaxc0xdexc3xefxc5xaa".
"xc7xd1xcaxaaxbdxd0xcexcfxb4xef",
"euc-jp");
# ...returns (< converted >, "ISO-2022-JP", "B");
($text, $charset, $encoding) =
body_encode(
"Collectioneur pathxe9tiquement ".
"xe9clectique de dxe9chets",
"latin1");
# ...returns (< original >, "ISO-8859-1", "QUOTED-PRINTABLE");
$len = encoded_header_len(
"Perlxe8xa8x80xe8xaax9e", "b", "utf-8"); # 28
Manipulating module defaults:
use MIME::Charset;
MIME::Charset::alias("csEUCKR", "euc-kr");
MIME::Charset::default("iso-8859-1");
MIME::Charset::fallback("us-ascii");
Download (0.029MB)
Added: 2007-07-09 License: Perl Artistic License Price:
840 downloads
Encode::PerlIO 5.8.1
Encode::PerlIO is a detailed document on Encode and PerlIO. more>>
Encode::PerlIO is a detailed document on Encode and PerlIO.
Overview
It is very common to want to do encoding transformations when reading or writing files, network connections, pipes etc. If Perl is configured to use the new perlio IO system then Encode provides a "layer" (see PerlIO) which can transform data as it is read or written.
Here is how the blind poet would modernise the encoding:
use Encode;
open(my $iliad,:utf8,iliad.utf8);
my @epic = < $iliad >;
print $utf8 @epic;
close($utf8);
close($illiad);
In addition, the new IO system can also be configured to read/write UTF-8 encoded characters (as noted above, this is efficient):
open(my $fh,>:utf8,anything);
print $fh "Any x{0021} string N{SMILEY FACE}n";
Either of the above forms of "layer" specifications can be made the default for a lexical scope with the use open ... pragma. See open.
Once a handle is open, its layers can be altered using binmode.
Without any such configuration, or if Perl itself is built using the systems own IO, then write operations assume that the file handle accepts only bytes and will die if a character larger than 255 is written to the handle. When reading, each octet from the handle becomes a byte-in-a-character. Note that this default is the same behaviour as bytes-only languages (including Perl before v5.6) would have, and is sufficient to handle native 8-bit encodings e.g. iso-8859-1, EBCDIC etc. and any legacy mechanisms for handling other encodings and binary data.
In other cases, it is the programs responsibility to transform characters into bytes using the API above before doing writes, and to transform the bytes read from a handle into characters before doing "character operations" (e.g. lc, /W+/, ...).
You can also use PerlIO to convert larger amounts of data you dont want to bring into memory. For example, to convert between ISO-8859-1 (Latin 1) and UTF-8 (or UTF-EBCDIC in EBCDIC machines):
open(F, ":utf8", "data.utf") or die $!;
while (< F >) { print G }
# Could also do "print G < F >" but that would pull
# the whole file into memory just to write it out again.
More examples:
open(my $f, ":encoding(iso-8859-2)")
open(my $h, ">:encoding(latin9)") # iso-8859-15
<<lessOverview
It is very common to want to do encoding transformations when reading or writing files, network connections, pipes etc. If Perl is configured to use the new perlio IO system then Encode provides a "layer" (see PerlIO) which can transform data as it is read or written.
Here is how the blind poet would modernise the encoding:
use Encode;
open(my $iliad,:utf8,iliad.utf8);
my @epic = < $iliad >;
print $utf8 @epic;
close($utf8);
close($illiad);
In addition, the new IO system can also be configured to read/write UTF-8 encoded characters (as noted above, this is efficient):
open(my $fh,>:utf8,anything);
print $fh "Any x{0021} string N{SMILEY FACE}n";
Either of the above forms of "layer" specifications can be made the default for a lexical scope with the use open ... pragma. See open.
Once a handle is open, its layers can be altered using binmode.
Without any such configuration, or if Perl itself is built using the systems own IO, then write operations assume that the file handle accepts only bytes and will die if a character larger than 255 is written to the handle. When reading, each octet from the handle becomes a byte-in-a-character. Note that this default is the same behaviour as bytes-only languages (including Perl before v5.6) would have, and is sufficient to handle native 8-bit encodings e.g. iso-8859-1, EBCDIC etc. and any legacy mechanisms for handling other encodings and binary data.
In other cases, it is the programs responsibility to transform characters into bytes using the API above before doing writes, and to transform the bytes read from a handle into characters before doing "character operations" (e.g. lc, /W+/, ...).
You can also use PerlIO to convert larger amounts of data you dont want to bring into memory. For example, to convert between ISO-8859-1 (Latin 1) and UTF-8 (or UTF-EBCDIC in EBCDIC machines):
open(F, ":utf8", "data.utf") or die $!;
while (< F >) { print G }
# Could also do "print G < F >" but that would pull
# the whole file into memory just to write it out again.
More examples:
open(my $f, ":encoding(iso-8859-2)")
open(my $h, ">:encoding(latin9)") # iso-8859-15
Download (11.3MB)
Added: 2007-08-07 License: Perl Artistic License Price:
809 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above mime encoded mailpacks search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed