Operating System - Linux
1820254 Members
2584 Online
109622 Solutions
New Discussion юеВ

problem sending email on redhat 8

 
K.C. Chan
Trusted Contributor

problem sending email on redhat 8

Has any run into problem with sendmail on redhat 8. My mail server is on rh73, but I can't sendmail from rh8. Here's the err:
echo "test" | mail -v perlknight@hotmail.com
perlknight@hotmail.com... Connecting to localhost via relay...
perlknight@hotmail.com... Deferred: Connection refused by localhost.

Any idea? Thanks
Reputation of a thousand years can be determined by the conduct of an hour
12 REPLIES 12
Steven E. Protter
Exalted Contributor

Re: problem sending email on redhat 8

Its your /etc/mail/access file.

It probably no longer contains localhost RELAY entry.

If I'm right add an entry that says localhost then a tab then relay. Then run this linux script to rebuild your hash database.

the script is attached.

if the post helps, please assign points.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Radhakrishnan Venkatara
Trusted Contributor

Re: problem sending email on redhat 8

hi,

there are some points to be noted.

one is /etc/mail/acces file which tells address to be access the mail service.

check in rh73 server whether the ipaddress of rh8 is added and made has ACCEPT.

another one is firewall rules.
check whether u have any firewall rules which does not allow rh8 network to rh73

radhakrishnan
Negative thinking is a highest form of Intelligence
Vitaly Karasik_1
Honored Contributor

Re: problem sending email on redhat 8

so you send mail from rh8 and use rh7.3 as mailrelay?

Does this rh7.3 accept mail from other sources?
Balaji N
Honored Contributor

Re: problem sending email on redhat 8

hi
first check if sendmail is running and listening.

ps -ef | grep sendmail.


then see if localhost is allowed to relay.

cat /etc/mail/access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY


then make the access db.

makemap hash access < access.

then check if sendmail can deliver your email address.

sendmail -bv email@dot.com

it should say how the mail will be deliverd. and then check by sending a mail.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Bill Douglass
Esteemed Contributor

Re: problem sending email on redhat 8

By default, RH8 has sendmail configured to deliver mail to sendmail on localhost.


If you don't have sendmail running as a deamon on your machine, then you get the message "Connection refused by localhost".

Start sendmail via

chkconfig sendmail on

Assuming you have an appropriate MX record for your mail server or have set up your mail relay in /etc/mail/sendmail.cf, you shoudl be good to go.
K.C. Chan
Trusted Contributor

Re: problem sending email on redhat 8

All,
Let me clarify the question. My mail server is working properly. All my Linux servers are working properly, they're sending email via our mailserver. However, I found that server running redhat 8.0 does not sent email via the mail server, you noticed when I tried sending mail via sendmail or mail it's trying to contact localhost via relay instead of "Connecting to mymailserver-name. via esmtp...". I fixed the problem by copying my sendmail.cf file from rh7.3 to this server. Then move out submit.cf. The submit.cf file does not exist in rh7.3. All is working. There must be somenthing in the submit .cf file which is cuasing to contact itself and trying to relay the mail instead of contacting the mail server via esmtp. Does any one have any idea? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
Balaji N
Honored Contributor

Re: problem sending email on redhat 8

it is a security feature, introduced. by default sendmail runs as a daemon on port 25 and delivers mail(SMTP). this uses sendmail.cf

and when a mail needs to be sent by user or program, when sendmail is invoked, it runs as a mail submission program(MSP) with minimal privileges. this uses submit.cf

read more at

http://www.sendmail.org/secure-install.html

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.

Re: problem sending email on redhat 8

I thought that I discovered this prior to 8.0 like in 7.3 but:

Take a look in sendmail.cf for a line:
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

Make it look like:

O DaemonPortOptions= Name=MTA

Take out the Port=smtp,Addr=127.0.0.1,

Look for this around line 264..

This also might restrict incomming mail.. I forget..
Sorry..
K.C. Chan
Trusted Contributor

Re: problem sending email on redhat 8

Yes, I am trying to relay my mail from rh8 to our mail server rh7. This works properly when I did my test (No sendmail service was running on rh8 server). Apparently when mail are being sent by cron, it tries to delivered mail locally to rh8 server which offcourse got deferred because there is local sendmail daemon is not started. Here's a snippet of mail header waiting in clientmqueue dir:
V6
T1068224760
K1068224761
N1
P30253
MDeferred: Connection refused by localhost.localdomain.
Fbs
$_mqm@localhost
${daemon_flags}c u
Smqm
Amqm@xxxx.mydomain [address of rh8 server]
MDeferred: Connection refused by localhost.localdomain.
C:mqm
rRFC822; mqm@xxx.mydomain [address of rh8 server]
RPFD:mqm
H?P?Return-Path: <

Any idea, how to get locally delivered mailed to be forwarded to mail server. Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
K.C. Chan
Trusted Contributor

Re: problem sending email on redhat 8

when I started sendmail, all mail works. I did not have to do this when running rh7.x. It seems the new sendmail implementation is not allowing me to sendmail out if sendmail is not running on the box. Is there a way to send mail out on the box w/o having to run sendmail daemon? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
Vitaly Karasik_1
Honored Contributor

Re: problem sending email on redhat 8

as far as I remember, you should run sendmail in modern RH linuxes in order to send emails outside.
BUT - I don't see security problem here because in default configuration sendmail listen only to 127.0.01 == localhost.
K.C. Chan
Trusted Contributor

Re: problem sending email on redhat 8

Thanks. I was hoping to get away w/o having to start up sendmail service when sending email out.
Reputation of a thousand years can be determined by the conduct of an hour