X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=blobdiff_plain;f=stump%2Fbin%2Femail-server.pl;h=6170cb7eda578cc699db7c1eda45ed297665a753;hb=acff1ba7277dfa00ee47688742f2a3910ea6c106;hp=c54de157862067094a4ae520d4efa045e35847fa;hpb=0f086a3142fbd6951cea31e37cb20ebf2c895ba6;p=modbot-ulm.git diff --git a/stump/bin/email-server.pl b/stump/bin/email-server.pl index c54de15..6170cb7 100755 --- a/stump/bin/email-server.pl +++ b/stump/bin/email-server.pl @@ -248,15 +248,15 @@ sub reply { 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 "$? $!"; } @@ -340,7 +340,7 @@ sub command_get { my $reply_body = ""; - open( FILE, $file ); + open( FILE, $file ) or die $!; $reply_body .= $_ while( ); close( FILE ); @@ -351,32 +351,32 @@ sub command_get { } } -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;