Earlier today, I rebooted a Fedora Core 4 machine that I maintain, and since then, sendmail has not been working properly. I have a Perl script that tries to send an email with lines like the following:
Code:
$sendmail = "/usr/sbin/sendmail -t -n";
$email = "user1\@mydomain.com";
$msg = "test\n";
$admin_email = "user2\@mydomain.com";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!\n";
print SENDMAIL "To: $email\n";
print SENDMAIL "Cc: $admin_email\n";
print SENDMAIL "From: sender\@host.mydomain.com\n";
print SENDMAIL "Reply-to: $admin_email\n";
print SENDMAIL "Subject: Arrival of Requested Data\n";
print SENDMAIL $msg;
close(SENDMAIL);
Before rebooting, the script would send emails correctly, but now it no longer works. /var/log/maillog shows the following lines:
Code:
Jul 20 16:54:37 host sendmail[10437]: j6KNsbfw010437: from=sender, size=163, class=0, nrcpts=2, msgid=<200507202354.j6KNsbfw010437@host.mydomain.com>, relay=sender@localhost
Jul 20 16:54:37 host sendmail[10437]: j6KNsbfw010437: to=user2@mydomain.com,user1@mydomain.com, ctladdr=sender (500/500), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=60163, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
When I try running sendmail -t -n from the command line, I get an error:
Code:
/etc/mail/submit.cf: line 545: fileclass: cannot open '/etc/mail/trusted-users': Group writable directory
However, /etc/mail is not a group-writable directory. I searched on Google and found a suggestion to change /etc/hosts to read:
Code:
127.0.0.1 localhost localhost.localdomain
, which I did, but sendmail still doesn't work. I haven't changed any of the other network configuration files or the firewall. I would greatly appreciate any help.
-- S. Chen