summaryrefslogtreecommitdiff
path: root/regress/base/multipart_maker.pl
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-02-11 15:18:51 +0000
committerfukachan <fukachan>2001-02-11 15:18:51 +0000
commit70e332c2b29f8d5af99b314f63c242c8dd30d4c6 (patch)
treeac93c411f1b47391b8c2c5b6421b2fb647e28159 /regress/base/multipart_maker.pl
parent45ccef8a71275ae9343e1834894d5640b90b3314 (diff)
downloadfml8-70e332c2b29f8d5af99b314f63c242c8dd30d4c6.tar.gz
fml8-70e332c2b29f8d5af99b314f63c242c8dd30d4c6.tar.bz2
fml8-70e332c2b29f8d5af99b314f63c242c8dd30d4c6.zip
-m mail mode
-r recipient if -m && -r are specified, output looks a multipart mail
Diffstat (limited to 'regress/base/multipart_maker.pl')
-rwxr-xr-xregress/base/multipart_maker.pl37
1 files changed, 33 insertions, 4 deletions
diff --git a/regress/base/multipart_maker.pl b/regress/base/multipart_maker.pl
index 3df4208f..af558882 100755
--- a/regress/base/multipart_maker.pl
+++ b/regress/base/multipart_maker.pl
@@ -1,13 +1,20 @@
use strict;
use File::Basename;
use MailingList::Messages;
+use Getopt::Std;
+
+my %opts;
+
+getopts('mr:', \%opts);
+
+my $rcpt = $opts{ r } || undef;
my $dir = dirname($0);
$| = 1;
my $header;
-my $boundary;
+my $boundary = "--". time;
my $body;
my $m_prev;
my $msg;
@@ -15,21 +22,43 @@ my $master;
my @m = ();
for $msg (@ARGV) {
- my $m = new MailingList::Messages {
- content_type => 'text/plain',
- charset => 'iso-2022-jp',
+ my $args = {
boundary => $boundary,
filename => $msg,
debug => 1,
};
+
+ # mail ?
+ if ($opts{ m }) {
+ $args->{ content_type } = 'message/rfc822';
+ }
+ # text
+ else {
+ $args->{ content_type } = 'text/plain';
+ $args->{ charset } = 'iso-2022-jp';
+ }
+
+ my $m = new MailingList::Messages $args;
push(@m, $m);
}
$master = $m[0];
$master = $master->build_mime_multipart_chain( {
base_content_type => 'multipart/mixed',
+ boundary => $boundary,
message_list => \@m,
});
+
+
+if ($rcpt) {
+ print "From: $rcpt\n";
+ print "To: $rcpt\n";
+ print "MIME-version: 1.0\n";
+ print "Content-Type: multipart/mixed;\n";
+ print " boundary=\"$boundary\"\n";
+ print "\n";
+}
+
$master->raw_print;
exit 0;