I'm trying to make a script that will automatically read incoming mail, parse the recipient, then send a file off to the recipient.
(Name of file = mail.pl)
$mailDir = "/var/spool/mail/"
$user = print `cat <STDIN> | grep To: | cut -b5-`;
print `elm -s Awaiting Mail $user < /tmp/alert";
And the entry in the aliases file goes:
test: "| /home/mail/mail.pl"
is that correct aswell?