summaryrefslogtreecommitdiff
path: root/rt/t/mail/fake-sendmail
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-30 01:03:13 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-30 01:03:13 -0700
commitf3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7 (patch)
treee5e9a077260613e6117d4697dd2985abd9b03d34 /rt/t/mail/fake-sendmail
parentcf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 (diff)
parentcd3eb95ed1f3dc3e04cfc2b3b405f75b3ab086da (diff)
merging RT 4.0.6
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;