
my $sendmail = '/afs/athena/user/j/d/jdaniel/scripts/sendmail.pl';




sub szs_relay($$$) {
    my ($to, $sender, $msg) = @_;

    $sender =~ tr/@/%/;
    $from = $sender.'@szs.mit.edu';
    szs_send($to, $from, $msg);
}

sub szs_send($$$) {
    my ($to, $from, $msg) = @_;

    open SENDMAIL, "| $sendmail -f $from -t $to";
    print SENDMAIL <<EOF;
To: $to
From: $from


$msg
EOF
    close SENDMAIL;
    owl::command("aperl 'Sent message to $to from $from'");
}

my $debug = shift;
sub szs_test() {
    szs_relay('jdaniel-phone@mit.edu', 'jdaniel@szs.mit.edu', 'test msg');
}

szs_test if $debug;

1;
