I'm probably supposed to write an X-loop header into the out bound mail headers, but I haven't done that.:0 h b * !^FROM_DAEMON * !^X-Loop: igor@jcwren.dyndns.org | ~/test.pl
#!/usr/local/bin/perl -w use strict; use Mail::Internet; my %commands = ("help" => \&do_help, "commands" => \&do_help, "weather" => \&do_weather); { my $rreplytext = [ ]; my @maildata = <>; my $mail = new Mail::Internet (\@maildata); $mail->remove_sig (); $mail->tidy_body (); foreach (@{$mail->body ()}) { chomp; tr /A-Z/a-z/; if (exists $commands {$_}) { $rreplytext = [ @$rreplytext, "Results for command '$_'\n", & +{$commands {$_}}, "\n" ]; } else { $rreplytext = [ @$rreplytext, "Unknown command '$_'\n" ]; } } $rreplytext = [ @$rreplytext, "----\n", "Send 'help' or 'commands' +in the body for supported commands\n", "\n", "Generated by igor\@jcwr +en.dyndns.org\n" ]; my $reply = $mail->reply (); $reply->body ($rreplytext); $reply->smtpsend (Host => 'localhost'); } sub do_help { my @text = (); push @text, "$_\n" foreach sort keys %commands; return (@text); } sub do_weather { `/home/system/weather/wx.pl 2>&1`; }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: K-Mart Blue Light E-mail Auto-responder
by merlyn (Sage) on Aug 20, 2000 at 00:50 UTC | |
by Anonymous Monk on Aug 20, 2000 at 04:09 UTC | |
by Anonymous Monk on Aug 26, 2000 at 06:55 UTC | |
by Anonymous Monk on Aug 20, 2000 at 04:09 UTC |