Subject: | Other patches |
MIME-Lite-needs-Message-ID gets rid of 552 errors when sending from some
servers, and the SetErrorMode uses the Win32API::File::SetErrorMode()
call in order to avoid popups on Win32 systems.
Subject: | Test-Smoke-MIME-Lite-needs-Message-ID.patch |
Index: lib/Test/Smoke/Mailer.pm
===================================================================
--- lib/Test/Smoke/Mailer.pm (revision 1272)
+++ lib/Test/Smoke/Mailer.pm (working copy)
@@ -466,11 +466,13 @@
my $subject = $self->fetch_report();
my $cc = $self->_get_cc( $subject );
+ require POSIX;
my %message = (
- To => $self->{to},
- Subject => $subject,
- Type => "TEXT",
- Data => $self->{body},
+ 'To' => $self->{to},
+ 'Subject' => $subject,
+ 'Message-ID' => '<smoker.' . time . '@' . (POSIX::uname())[1] . '>',
+ 'Type' => "TEXT",
+ 'Data' => $self->{body},
);
$message{Cc} = $cc if $cc;
$message{Bcc} = $self->{bcc} if $self->{bcc};
Subject: | Test-Smoke-SetErrorMode.patch |
Index: smokeperl.pl
===================================================================
--- smokeperl.pl (revision 1272)
+++ smokeperl.pl (working copy)
@@ -119,6 +119,18 @@
=cut
+# MSWin32: Disable critical error popups
+if ($^O eq "MSWin32") {
+ # Call kernel32.SetErrorMode(SEM_FAILCRITICALERRORS):
+ # "The system does not display the critical-error-handler message box.
+ # Instead, the system sends the error to the calling process." and
+ # "A child process inherits the error mode of its parent process."
+ if (eval {require Win32API::File}) {
+ Win32API::File->import(qw(SetErrorMode SEM_FAILCRITICALERRORS SEM_NOGPFAULTERRORBOX));
+ SetErrorMode(SEM_FAILCRITICALERRORS() | SEM_NOGPFAULTERRORBOX());
+ }
+}
+
# Try cwd() first, then $findbin
my $config_file = File::Spec->catfile( cwd(), $options{config} );
unless ( read_config( $config_file ) ) {