Imported Upstream version 3.3.2
[debian/amanda] / installcheck / mock / mail.pl
1 #! @PERL@
2 # Copyright (c) 2010-2012 Zmanda, Inc.  All Rights Reserved.
3 #
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License version 2 as published
6 # by the Free Software Foundation.
7 #
8 # This program is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11 # for more details.
12 #
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
19
20 use strict;
21 use warnings;
22 use Data::Dumper;
23
24 my $outfile = $ENV{'INSTALLCHECK_MOCK_MAIL_OUTPUT'};
25 die "INSTALLCHECK_MOCK_MAIL_OUTPUT not defined" unless defined $outfile;
26
27 # just copy data
28 open(my $out, ">", $outfile) or die("Could not open '$outfile'");
29
30 my $dumper = Data::Dumper->new([\@ARGV], [qw(ARGS)]);
31 $dumper->Indent(0);
32 print $out $dumper->Dump, "\n";
33
34 while (1) {
35     my $data = <STDIN>;
36     last unless $data;
37     print $out $data;
38 }
39 close($out);