open( SENDMAIL, "|$sendmail '$address'" )
|| die "Could not start sendmail in $sendmail";
- print SENDMAIL "From: $To\n";
- print SENDMAIL "To: $address\n";
- print SENDMAIL "Subject: Re: $Subject\n";
+ print SENDMAIL "From: $To\n" or die $!;
+ print SENDMAIL "To: $address\n" or die $!;
+ print SENDMAIL "Subject: Re: $Subject\n" or die $!;
- print SENDMAIL "\n";
+ print SENDMAIL "\n" or die $!;
- print SENDMAIL "$msg\n";
+ print SENDMAIL "$msg\n" or die $!;
- close( SENDMAIL );
+ close( SENDMAIL ) or die "$? $!";
}
my $reply_body = "";
- open( FILE, $file );
+ open( FILE, $file ) or die $!;
$reply_body .= $_ while( <FILE> );
close( FILE );
}
}
-sub command_set {
- my $arg = pop( @_ );
-
- my $file = &file_from_arg( $arg );
- my $mode = &mode_from_arg( $arg );
-
- &user_error( "File $arg is not in the list of available files." )
- if( !$file );
-
- if( -w $file && -f $file && $mode eq "rw" ) {
-
- my $reply_body = "Succeeded in writing to file '$arg':\n\n$Body";
-
- if( open( FILE, ">$file" ) ) {
- print FILE $Body;
- close( FILE );
- } else {
- $reply_body = "Failed to write to file $arg:\n\n$Body";
- }
-
- &reply( $reply_body );
-
- } else {
- &user_error( "File $arg does not exist or is not writable" );
- }
-}
+# sub command_set {
+# my $arg = pop( @_ );
+#
+# my $file = &file_from_arg( $arg );
+# my $mode = &mode_from_arg( $arg );
+#
+# &user_error( "File $arg is not in the list of available files." )
+# if( !$file );
+#
+# if( -w $file && -f $file && $mode eq "rw" ) {
+#
+# my $reply_body = "Succeeded in writing to file '$arg':\n\n$Body";
+#
+# if( open( FILE, ">$file" ) ) {
+# print FILE $Body;
+# close( FILE );
+# } else {
+# $reply_body = "Failed to write to file $arg:\n\n$Body";
+# }
+#
+# &reply( $reply_body );
+#
+# } else {
+# &user_error( "File $arg does not exist or is not writable" );
+# }
+# }
sub main {
&init;