Courriel

 view release on metacpan or  search on metacpan

lib/Courriel/Headers.pm  view on Meta::CPAN


    return $p;
};

sub _inflate_header {
    my $class = shift;
    my $name  = shift;
    my $value = shift;

    my ( $header_class, $method )
        = lc $name eq 'content-type'
        ? ( 'Courriel::Header::ContentType', 'new_from_value' )
        : lc $name eq 'content-disposition'
        ? ( 'Courriel::Header::Disposition', 'new_from_value' )
        : ( 'Courriel::Header', 'new' );

    return $header_class->$method(
        name  => $name,
        value => $value,
    );
}

t/ContentType.t  view on Meta::CPAN

{
    my $ct = Courriel::Header::ContentType->new_from_value(
        value => 'text/plain' );

    is( $ct->value,     'text/plain', 'got expected value' );
    is( $ct->mime_type, 'text/plain', 'got expected mime_type' );
}

{
    my $ct = Courriel::Header::ContentType->new_from_value(
        name  => 'content-type',
        value => 'text/plain',
    );

    is( $ct->name,      'content-type', 'name from parameters is used' );
    is( $ct->mime_type, 'text/plain',   'got expected mime_type' );
}

{
    my $ct = Courriel::Header::ContentType->new_from_value(
        name  => 'content-type',
        value => 'text/plain; charset=ISO-8859-2',
    );

    is(
        $ct->attribute_value('charset'),
        'ISO-8859-2',
        'got charset attribute value'
    );

    is(

t/Part-Single.t  view on Meta::CPAN

{
    my $part = Courriel::Part::Single->new(
        headers      => Courriel::Headers->new(),
        content_type =>
            Courriel::Header::ContentType->new( mime_type => 'image/jpeg' ),
        encoded_content => 'foo',
    );

    ok(
        !Encode::is_utf8( $part->content() ),
        'part is not decoded as utf8 when content-type has no charset'
    );
}

{
    my $part = Courriel::Part::Single->new(
        headers      => Courriel::Headers->new(),
        content_type =>
            Courriel::Header::ContentType->new( mime_type => 'image/jpeg' ),
        content => 'foo',
    );

t/data/stress-test/mbox_mime_boundary.txt  view on Meta::CPAN

        id 1EXl4N-0000L8-0g
        for mason-users@lists.sourceforge.net; Thu, 03 Nov 2005 11:48:19 -0800
Received: from xproxy.gmail.com ([66.249.82.196])
        by mail.sourceforge.net with esmtp (Exim 4.44)
        id 1EXl4L-0005Hp-Rn
        for mason-users@lists.sourceforge.net; Thu, 03 Nov 2005 11:48:19 -0800
Received: by xproxy.gmail.com with SMTP id h29so600761wxd
        for <mason-users@lists.sourceforge.net>; Thu, 03 Nov 2005 11:48:15 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
        s=beta; d=gmail.com;
        h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references;
        b=lohminCmnPywDj4LOBR93LCRpYAjZQpCotbVEMp17pwihrAULjl+pElexOKcWh3fvhVyXnijnYe2AxBON5u0kYAMzefNCMWI2UvJfJi9/Dka/UmR
jIR+A3lRjNUtz0WCyakuA+BupRSPlVvbDKvIXg9AaZTyQhPZVBtd5weOhW8=
Received: by 10.70.65.17 with SMTP id n17mr1063197wxa;
        Thu, 03 Nov 2005 11:48:15 -0800 (PST)
Received: by 10.70.60.2 with HTTP; Thu, 3 Nov 2005 11:48:15 -0800 (PST)
Message-ID: <87f4e9820511031148q7e120c00p56e1d0ee826d9c15@mail.gmail.com>
From: Jason Kohles <email@jasonkohles.com>
To: nav navlan <navidunreal@yahoo.com>
Subject: Re: [Mason] apache configuration
Cc: mason-users@lists.sourceforge.net

t/data/stress-test/mbox_mime_boundary_2.txt  view on Meta::CPAN

        for <archive_catalyst_lists.rawmode.org@mazrmail.com>; Sat, 19 Nov 2005 09:37:32 -0600
Received: from localhost ([127.0.0.1])
        by rawmode.org with esmtp (Exim 4.52)
        id 1EdUf9-0005hG-QS; Sat, 19 Nov 2005 16:29:59 +0100
Received: from xproxy.gmail.com ([66.249.82.193])
        by rawmode.org with esmtp (Exim 4.52) id 1EdUf2-00032G-Rf
        for catalyst@lists.rawmode.org; Sat, 19 Nov 2005 16:29:56 +0100
Received: by xproxy.gmail.com with SMTP id t4so383035wxc
        for <catalyst@lists.rawmode.org>; Sat, 19 Nov 2005 07:35:26 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type;
        b=H8AsLHc82HF4n/oqgQLtdLzrMYeqXL/CI9GMv2DCyNL09SsfadcbXT/P0YG/xC6ChTXuJ8HSdO/buPAcQbbKUV4ZAOknULKF7cmHr+PqcV0U35yQ
el85cfOFuqHuo0jZ4y+Z9p9Nba3/8gy7BDoleiWbU3JniV1yvhmOck6I3RA=
Received: by 10.70.52.13 with SMTP id z13mr614083wxz;
        Sat, 19 Nov 2005 07:35:26 -0800 (PST)
Received: by 10.70.44.10 with HTTP; Sat, 19 Nov 2005 07:35:26 -0800 (PST)
Message-ID: <c788b4850511190735m6a48bd00l66ecb08c29ee258c@mail.gmail.com>
Date: Sat, 19 Nov 2005 10:35:26 -0500
From: Drew Taylor <taylor.andrew.j@gmail.com>
To: The elegant MVC web framework <catalyst@lists.rawmode.org>,
        handel@lists.rawmode.org

t/data/stress-test/mbox_mime_nested.txt  view on Meta::CPAN

        for <archive_catalyst_lists.rawmode.org@mazrmail.com>; Sat, 19 Nov 2005 09:37:32 -0600
Received: from localhost ([127.0.0.1])
        by rawmode.org with esmtp (Exim 4.52)
        id 1EdUf9-0005hG-QS; Sat, 19 Nov 2005 16:29:59 +0100
Received: from xproxy.gmail.com ([66.249.82.193])
        by rawmode.org with esmtp (Exim 4.52) id 1EdUf2-00032G-Rf
        for catalyst@lists.rawmode.org; Sat, 19 Nov 2005 16:29:56 +0100
Received: by xproxy.gmail.com with SMTP id t4so383035wxc
        for <catalyst@lists.rawmode.org>; Sat, 19 Nov 2005 07:35:26 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:mime-version:content-type;
        b=H8AsLHc82HF4n/oqgQLtdLzrMYeqXL/CI9GMv2DCyNL09SsfadcbXT/P0YG/xC6ChTXuJ8HSdO/buPAcQbbKUV4ZAOknULKF7cmHr+PqcV0U35yQel85cfOFuqHuo0jZ4y+Z9p9Nba3/8gy7BDoleiWbU3J
niV1yvhmOck6I3RA=
Received: by 10.70.52.13 with SMTP id z13mr614083wxz;
        Sat, 19 Nov 2005 07:35:26 -0800 (PST)
Received: by 10.70.44.10 with HTTP; Sat, 19 Nov 2005 07:35:26 -0800 (PST)
Message-ID: <c788b4850511190735m6a48bd00l66ecb08c29ee258c@mail.gmail.com>
Date: Sat, 19 Nov 2005 10:35:26 -0500
From: Drew Taylor <taylor.andrew.j@gmail.com>
To: The elegant MVC web framework <catalyst@lists.rawmode.org>,
        handel@lists.rawmode.org

t/data/stress-test/mbox_tmp_list_post.txt  view on Meta::CPAN

        for <archive_catalyst_lists.rawmode.org@mazrmail.com>; Fri, 6 Jan 2006 10:33:24 -0600
Received: from localhost ([127.0.0.1])
        by rawmode.org with esmtp (Exim 4.52)
        id 1EuuMf-00052H-Hc; Fri, 06 Jan 2006 17:22:53 +0100
Received: from nproxy.gmail.com ([64.233.182.201])
        by rawmode.org with esmtp (Exim 4.52) id 1EuuMc-0002wF-B0
        for catalyst@lists.rawmode.org; Fri, 06 Jan 2006 17:22:50 +0100
Received: by nproxy.gmail.com with SMTP id o25so1276103nfa
        for <catalyst@lists.rawmode.org>; Fri, 06 Jan 2006 08:29:29 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
        h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
        b=IGpoedvVJI6lY4VdTP4CaVuTqRb44RVmYaKwSCQDYjhMsTm3ns5QZy9vH8ID9SSHjoSdJU55+O5Vhlgco6QwvZtoxie+tNJUBsJaGfsHO6wOs3ShuOnudKD7L6AiEdBa07/2p+2d/Y9F+qQaVHJ3KvvCYhj+QJbomKRlWTZFLn8=
Received: by 10.48.30.17 with SMTP id d17mr765926nfd;
        Fri, 06 Jan 2006 08:29:27 -0800 (PST)
Received: by 10.48.42.12 with HTTP; Fri, 6 Jan 2006 08:29:27 -0800 (PST)
Message-ID: <3390cd220601060829y34db5d25t@mail.gmail.com>
Date: Fri, 6 Jan 2006 17:29:27 +0100
From: Bernard FRIT <bernard.frit@gmail.com>
To: The elegant MVC web framework <catalyst@lists.rawmode.org>
Subject: Re: [Catalyst] View::TT FILTERS and utf-8
In-Reply-To: <4f352aae0601060732r6e61bab9x@mail.gmail.com>

t/weird-input.t  view on Meta::CPAN

}

{
    my $email = _parse( $dir->file('mbox_mime_virus-alert-headers.txt') );

    my $plain = $email->plain_body_part;

    like(
        $plain->content,
        qr/V I R U S  A L E R T/,
        'found plain body content with no content-type header'
    );
}

{
    my $email = _parse( $dir->file('mbox_unknown8bit.txt') );

    my $plain = $email->plain_body_part;

    like(
        $plain->content,



( run in 0.900 second using v1.01-cache-2.11-cpan-524268b4103 )