GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Sisimai::RFC2045(3) User Contributed Perl Documentation Sisimai::RFC2045(3)

Sisimai::RFC2045 - MIME Utilities

    use Sisimai::RFC2045;
    my $e = '=?utf-8?B?55m954yr44Gr44KD44KT44GT?=';
    my $v = Sisimai::RFC2045->is_encoded(\$e);
    print $v;   # 1
    my $x = Sisimai::RFC2045->decodeH([$e]);
    print $x;

"Sisimai::RFC2045" is MIME Utilities for Sisimai, is formerly known as "Sisimai::MIME".

"is_encoded(Scalar Reference)"

is_encoded() method returns that the argument is a MIME-Encoded string or not.

    my $e = '=?utf-8?B?55m954yr44Gr44KD44KT44GT?=';
    my $v = Sisimai::RFC2045->is_encoded(\$e);  # 1

decodeH() method is a decoding method for getting the original string from the MIME-Encoded string in the email headers.

    my $r = '=?utf-8?B?55m954yr44Gr44KD44KT44GT?=';
    my $v = Sisimai::RFC2045->decodeH([$r]);

"decodeB" method is a decoding method for getting the original string from the MIME Base64 encoded string.

    my $r = '44Gr44KD44O844KT';
    my $v = Sisimai::RFC2045->decodeB(\$r);

"decodeQ" method is a decoding method for getting the original string from the MIME quoted-printable encoded string.

    my $r = '=4e=65=6b=6f';
    my $v = Sisimai::RFC2045->decodeQ(\$r);

"parameter(String, String)"

parameter() method returns the value of parameter in "Content-Type:" header.

    my $r = 'Content-Type: multipart/mixed; boundary=Apple-Mail-1-526612466'; charset=utf8;
    print Sisimai::RFC2045->parameter($r, 'charset');  # utf8
    print Sisimai::RFC2045->parameter($r, 'boundary'); # Apple-Mail-1-526612466
    print Sisimai::RFC2045->parameter($r);             # multipart/mixed

"boundary(String, Integer)"

boundary() method returns the boundary string from the value of "Content-Type:" header.

    my $r = 'Content-Type: multipart/mixed; boundary=Apple-Mail-1-526612466';
    my $v = Sisimai::RFC2045->boundary($r);
    print $v;   # Apple-Mail-1-526612466
    print Sisimai::RFC2045->boundary($r, 0); # --Apple-Mail-1-526612466
    print Sisimai::RFC2045->boundary($r, 1); # --Apple-Mail-1-526612466--

"haircut(\String, Boolean)"

haircut() method remove unused headers from the "multipart/* "block.

"levelout(String, \String)"

"levelout" method breaks the "multipart/*" message block into each part and returns an array reference.

"makeflat(String, \String)"

"makeflat" method makes flat "multipart/*" message: This method breaks "multipart/*" block into each part, remove parts which are not needed to decode the bounce message such as "image/*" MIME type, and decode the encoded text part ("text/*", "message/*") in the body of each part that has "Content-Transfer-Encoding:" header and the value of the header is quoted-printabe, base64, or 7bit.

azumakuniyuki

Copyright (C) 2014-2016,2018-2024 azumakuniyuki, All rights reserved.

This software is distributed under The BSD 2-Clause License.

2025-03-28 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.