summaryrefslogtreecommitdiff
path: root/rt/t/mail/fake-sendmail
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-04-24 11:35:56 -0700
committerIvan Kohler <ivan@freeside.biz>2012-04-24 11:35:56 -0700
commit6587f6ba7d047ddc1686c080090afe7d53365bd4 (patch)
treeec77342668e8865aca669c9b4736e84e3077b523 /rt/t/mail/fake-sendmail
parent47153aae5c2fc00316654e7277fccd45f72ff611 (diff)
first pass RT4 merge, RT#13852
Diffstat (limited to 'rt/t/mail/fake-sendmail')
-rw-r--r--rt/t/mail/fake-sendmail27
1 files changed, 27 insertions, 0 deletions
diff --git a/rt/t/mail/fake-sendmail b/rt/t/mail/fake-sendmail
new file mode 100644
index 000000000..44c237746
--- /dev/null
+++ b/rt/t/mail/fake-sendmail
@@ -0,0 +1,27 @@
+#!/usr/bin/env perl
+
+# captures command line arguments so you can validate
+# what is being generated in sendmailpipe
+
+use strict;
+use warnings;
+
+die "No \$RT_MAILLOGFILE set in environment"
+ unless $ENV{RT_MAILLOGFILE};
+open LOG, ">", $ENV{RT_MAILLOGFILE}
+ or die "Can't write to $ENV{RT_MAILLOGFILE}: $!";
+
+my $needs_newline;
+for (@ARGV) {
+ if (/^-/) {
+ print LOG "\n" if $needs_newline++;
+ print LOG $_;
+ } else {
+ print LOG " $_";
+ }
+}
+print LOG "\n";
+
+1 while $_ = <STDIN>;
+
+exit 0;