I just wrote a Perl script that gets an e-mail address from the command line
and then subs it in as the To: field in mailwrapper output. While the
program worked just fine when I manually entered the To: field, it appends
@www.schnarff.com to that field when I get it from the command line.
The relevant part of the script appears below:
$recip = $ARGV[0];
$recip =~ s/\@/\\\@/g;
print $recip;
open (MAIL, "|/usr/sbin/sendmail -t");
print MAIL "To: $recip\n";
print MAIL "From: quoteoftheday\@schnarff.com\n";
print MAIL "Reply-to: alex\@schnarff.com\n";
print MAIL "Subject: Quote for $date\n";
print MAIL $sdata[rand(@sdata)];
close MAIL;
$recip, when I printed it to the screen for testing purposes, came out as
user\@domain.com, which is exactly what I need.
Any idea why the mailwrapper would append my local domain like that?
Thanks,
Alex Le Fevre