LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2005, 07:15 PM   #1
schentor
Member
 
Registered: Jul 2005
Distribution: RHEL, Mint, Ubuntu
Posts: 32

Rep: Reputation: 15
sendmail connection error


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
 
Old 07-21-2005, 07:00 AM   #2
Brian Knoblauch
Member
 
Registered: Jan 2005
Distribution: OpenSuse Tumbleweed
Posts: 288

Rep: Reputation: 39
check your relay-domains file?
 
Old 07-21-2005, 11:56 AM   #3
schentor
Member
 
Registered: Jul 2005
Distribution: RHEL, Mint, Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
Is the relay-domains file supposed to be in /etc/mail? There was no such file, so I created it and added 127.0.0.1. I also tried adding 127.0.0.1, localhost, and the hostname to the local-host-names file, but I always get the same error. I've checked iptables as well, and it doesn't seem to be blocking anything:
Code:
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     ipv6-crypt--  anywhere             anywhere
ACCEPT     ipv6-auth--  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:5353
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
 
Old 07-21-2005, 12:02 PM   #4
Brian Knoblauch
Member
 
Registered: Jan 2005
Distribution: OpenSuse Tumbleweed
Posts: 288

Rep: Reputation: 39
Quote:
Originally posted by schentor
Is the relay-domains file supposed to be in /etc/mail?
Yes. Not sure what else to tell you
 
Old 07-21-2005, 01:06 PM   #5
schentor
Member
 
Registered: Jul 2005
Distribution: RHEL, Mint, Ubuntu
Posts: 32

Original Poster
Rep: Reputation: 15
It turned out to be a silly error -- the sendmail daemon wasn't running. Rebooting the computer had made the root partition group-writable, so sendmail couldn't start. After fixing the permissions, I thought the script calling sendmail would be enough, but it wasn't. When I restarted the daemon, everything worked.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection refused in sendmail pjon SUSE / openSUSE 3 05-26-2005 06:42 AM
LDAP SERVER Client Connection on SUSE 9.2 - connection error jcarton Linux - Networking 3 03-19-2005 12:40 PM
LDAP SERVER - CLIENT CONNECTION on suse 9.2 - connection error nicolasdiogo Linux - Networking 4 03-01-2005 01:43 PM
LDAP SERVER - CLIENT CONNECTION on suse 9.2 - connection error nicolasdiogo SUSE / openSUSE 0 03-01-2005 05:43 AM
Sendmail Error while sendmail mail palavsachin27 Linux - Networking 1 01-22-2003 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration