HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/share/doc/libmime-lite-perl/examples/mime_longlines
#!/usr/bin/perl -w


=head1 NAME

mime_longlines - generate a test message with long lines


=head1 SYNOPSIS

Usage:

    mime_longlines [-s]

Options:

    -s   Stringify message first, and print the *string* to STDOUT.


=head1 DESCRIPTION

Assemble and print (to the standard output) a multipart message 
with 5 attachments, for the purpose of "eyeballing" how well the 
encoders are working.

Each attachments holds the same data -- some 8-bit text, and a long 
line consisting of 1000 "a"s followed by a few "b"s) -- but each
has a different encoding (the "Content-transfer-encoding" field
will tell you which is which).

All of the encodings (except for the first one, "binary") should 
break the long line before the b's.


=head1 AUTHOR

Eryq, eryq@zeegee.com

=cut

use strict;
use MIME::Lite;
use Getopt::Std;

### Set up a long message:
my $DATA = <<EOF;
Here's a line with some 8-bit characters... the "7bit" encoding should
strip them out: 

    \xABFran\xE7ois M\xFCller\xBB.

The line below is REALLY long.  It contains 1000 a's, followed by some b's.
All of the encodings (except binary) should break the line before the b's:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbb

EOF

#------------------------------
# main
#------------------------------
sub main {
    my %opts;

    ### Get options:
    getopts('s', \%opts) or die "usage error\n";

    ### Create a new multipart message:
    my $msg = new MIME::Lite
	From    =>'me@myhost.com',
        To      =>'you@yourhost.com',
        Cc      =>'some@other.com, some@more.com',
        Subject =>'The Magnificent Five (encodings, that is)',
        Type    =>'multipart/mixed';

    ### Add parts:
    foreach my $enc (qw(binary 8bit 7bit quoted-printable base64)) {
	$msg->attach(Type => 'TEXT',   
		     Data => $DATA,
		     Encoding => $enc);
    }

    ### Print:
    if ($opts{'s'}) { print $msg->stringify }
    else            { $msg->print(\*STDOUT) }
    1;
}
exit (&main ? 0 : -1);
1;

__END__