Operating System - Linux
1830340 Members
2259 Online
110001 Solutions
New Discussion

send mail out connection refused as normal user

 
SOLVED
Go to solution
Ratzie
Super Advisor

send mail out connection refused as normal user

I have a RedHat ES 3.0 server that I set up. I copied over the /etc/passwd, /etc/group, and shadow passwd from a previous RedHat 7.3 server that I built. I did find that I was missing the user...
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
so I added that to the /etc/passwd file.

Here is what I want to do...
I only have this server sending out bound mail on our network. So I do not need sendmail running, I shut down that service.
/etc/rc.d/init.d/sendmail stop





I have been able to get the outgoing mail to work ALL UNDER ROOT!
This is what I added to submit.cf
# "Smart" relay host (may be null)
DSsmtp_server.mts.mb.ca

And the mail goes thru correctly...
Mar 25 10:55:02 myserver sendmail[997]: i2PGt2ti000997: from=root, size=43, class=0, nrcpts=1, msgid=<200403251655.i2PGt2ti000997@myserver.mts.mb.ca>, relay=root@localhost
Mar 25 10:55:02 myserver sendmail[997]: i2PGt2ti000997: to=lhradowy@mts.ca, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30043, relay=smtp_server.mts.mb.ca. [192.168.2.1], dsn=2.0.0, stat=Sent (Message accepted for delivery)


BUT IF I LOG IN AS A REGULAR USER... I get a connection refused


Mar 25 10:55:44 myserver sendmail[1031]: i2PGtifY001031: from=lhradowy, size=26, class=0, nrcpts=1, msgid=<200403251655.i2PGtifY001031@myserver.mts.mb.ca>, relay=lhradowy@localhost
Mar 25 10:55:44 opsftp sendmail[1031]: i2PGtifY001031: to=lhradowy@mts.ca, ctladdr=lhradowy (520/50), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30026, relay=smtp_server.mts.mb.ca. [192.168.2.1], dsn=4.0.0, stat=Deferred: Connection refused by smtp_server.mts.mb.ca.

I also get an error if I run mailq as a regular user...
lhradowy@myserver ~$ mailq
can not chdir(/var/spool/mqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

Mar 25 10:46:58 myserver sendmail[937]: NOQUEUE: SYSERR(lhradowy): can not chdir(/var/spool/mqueue/): Permission denied

Anyone can help?
2 REPLIES 2
Steven E. Protter
Exalted Contributor
Solution

Re: send mail out connection refused as normal user

mailq is a root program.

Users normally should not be able to use it.

Problem:
stat=Deferred: Connection refused by smtp_server.mts.mb.ca

You have a DS directive in sendmail.cf

The server smtp_server.mts.mb.ca is refusing to relay mail.

If its one of your servers, check the file /etc/mail/access

Make sure the server you are sending the mail from is listed as a valid relay server:

yourserver RELAY

rebuild your hast databases(see attachment for a model)

service sendmail restart

If someone else is responsible for that smtp relay server have them make sure it allows mail relay from your server.

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
Ratzie
Super Advisor

Re: send mail out connection refused as normal user

GOT IT WORKING...

needed to add my relay server to the sendmail.cf file as well!

I still do not have sendmail running, nor do I want to.