[vox-tech] Perl programming problem
Mitch Patenaude
mrp at sonic.net
Thu Jan 13 14:05:00 PST 2005
On Jan 13, 2005, at 1:46 PM, Richard S. Crawford wrote:
> Actually, I do. Here is the relevant code:
>
> my $fromAddress='rcrawford at unexmail.ucdavis.edu';
> my $toAddress='rcrawford at unexmail.ucdavis.edu';
> my $body="Neo is down as of $timeString\n";
> my $mailer=open ({From => $fromAddress, To => toAddress,
> Subject=>$subject});
> print $mailer $body;
> $mailer->close();
The PERL module you are using is almost certainly just passing off the
mail to your underlying Mail Transport Agent (MTA). It looks like your
home machine's MTA isn't configured correctly. You can try to send the
mail directly from the command line with the command mail. Type is
'mail rcrawford at unexmail.ucdavis.edu' at the command line, type in a
message, and terminate with a single period on a line by itself. (the
way email used to be done in the old days :-) If that works, then the
MTA is configured correctly.
If it isn't configured correctly.. then you'll need to configure you
MTA. In the old days that would have been sendmail, configured with a
file like /etc/sendmail/sendmail.cf, though I wouldn't recommend
sendmail now. On my Mandrake 8.1 box it's postfix, and I think you can
configure it by editing the file /etc/postfix/main.cf, and
uncommenting/changing the lines for mydomain. (by default it pulls it
from the gethostname() library call, but that isn't set up correctly on
most small home boxes, and therefore returns 'localhost.localdomain' by
default.)
If your MTA is something else (like qmail), then you'll have to figure
out how to configure it properly for that MTA.. a google search should
do you well there.
Alternately, you could set up your machine so that gethostname(3)
returns the proper value. That's going to be distro dependent.... I'm
not even sure how on my Mandrake box frankly.
-- Mitch
More information about the vox-tech
mailing list