Gateway

 view release on metacpan or  search on metacpan

modules/nobinaries.al  view on Meta::CPAN

# Eventually, this really should be smarter about multipart posts....
sub nobinaries_mesg {
    my $self = shift;
    my $article = $$self{article};

    # Check the transfer encoding.
    return 'base64 encoded'
        if (lc $article->header ('content-transfer-encoding') eq 'base64');

    # Check the content type in the main article headers.
    my $type = $article->header ('content-type');
    return 'Invalid content type'
        if ($type =~ /(application|audio|image|video)/i);

    # Now, scan the body line by line, counting possibly encoded lines, and
    # reject the message if they exceed the above parameters or if we
    # encounter a Content-Type header in the body with a bad type (or a
    # Content-Transfer-Encoding header with a bad type).
    my ($lines, $uulines, $mimelines) = (0, 0, 0);
    for (@{scalar $$self{article}->body ()}) {
        $lines++;



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