Click to See Complete Forum and Search --> : Sendmail/Pop/telnet issues


zekeman
01-24-2003, 05:31 PM
I'm trying to configure my RedHat 8.0 box to run SendMail & POP3. I want the box to send out mail without using another mail server and it won't be setup to receive mail from the outside. I want to be able to use POP3 from another machine to send mail thru this box to the outside world and people on our network (not Spam - email reports & statements). But I'm having problems - I can't seem to send mail out from the linux box, and I can't connect to port 110 from another machine. The machines name is linux.

This is what I have:
1. /etc/hosts
127.0.0.1 localhost.localadmin localhost
xxx.xx.xx.xxx linux.localdomain linux

2. If I run /etc/init.d/sendmail restart:
shutting down sendmail - ok
shutting down sm-client - ok
starting sendmail - ok
starting sm-client - ok

3. In /etc/mail/sendmail.mc

I commented out the DAEMON_OPTIONS line to accept incoming connections

4. If I try to send mail using mail (changed address) I get....

[root@linux postfix]# mail -v test@test.com
Subject: test me
test
.
Cc:
test@test.com... Connecting to localhost.localdomain. via relay...
220 linux.localdomain ESMTP Sendmail 8.12.5/8.12.5; Fri, 24 Jan 2003 16:26:23 -0
500
>>> EHLO linux.localdomain
250-linux.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet y
ou
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<root@linux.localdomain> SIZE=56
250 2.1.0 <root@linux.localdomain>... Sender ok
>>> RCPT To:<test@test.com>
>>> DATA
250 2.1.5 <test@test.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 h0OLQN8G006521 Message accepted for delivery
test@test.com... Sent (h0OLQN8G006521 Message accepted for delivery)
Closing connection to localhost.localdomain.
>>> QUIT
221 2.0.0 linux.localdomain closing connection

The mail is never received.

5. Last by not least, if I try telnetting into port 110 from another machine I get:

C:\>telnet xxx.xx.xx.xxx 25
Connecting To xxx.xx.xx.xxx ...Could not open a connection to host on port 25 : Connect failed

I didn't setup a firewall (that I know of), but I have no idea how to check if something is blocking my ability to telnet there.

Any help would be GREATLY appreciated.

Thanx.

pcghost
01-24-2003, 06:59 PM
First of all I would suggest if you are planning to tackle sendmail, you should get the O'Reilly book Sendmail. It's outstanding. Second, I have had troubles telneting to mail ports recently too. Make sure you have telnet installed and running.

If you didn't install a firewall, are you sure? Many distro's install iptables by default. If you never configured it, you run the risk of getting hacked, especially with the telnet server running. Be careful not to leave your machine connected to the internet for any length of time without a firewall in place.

Unfortunatly there are not that many Sendmail guru's left at LNO or anywhere else I have found. I don't know why but people just don;t use it like they used to. I will check up on this post over the weekend and see if there is anything I can do to help. It's been a few months since I played (or got the crap kicked out of me) with Sendmail. :D
.
Oh Yeah, just to rule out the recieving maching, check the Sendmail que to see if the outgoing messages are still onboard. That way you know for sure if they actually were in fact sent..

zekeman
01-24-2003, 07:09 PM
Well, I got my telnet to port 110 problem solved - iptables was in fact implemented. Now I just need to figure out how to open port 110. Any ideas? This machine is already behind a firewall, so that shouldn't be a problem. I'm only using it to send mail out to clients and internal users rather than pound our other server.

The other problem seems to be that my mail isn't going out. I can connect and send, but it never arrives. Any ideas on that one?

Thanx again.

JohnT
01-24-2003, 07:19 PM
5. Last by not least, if I try telnetting into port 110 from another machine I get:

C:\>telnet xxx.xx.xx.xxx 25
Connecting To xxx.xx.xx.xxx ...Could not open a connection to host on port 25 : Connect failed

Hee's another test you can run.
SMTP (http://www.icon.co.za/~psheer/book/node13.html.gz#SECTION001310000000000000000)

pcghost
01-24-2003, 07:20 PM
To open port 110 from the CLI type:
iptables -A INPUT -p tcp -i $EXTINT -j ACCEPT
replacing $EXTINT with the external nic (ie eth0 or eth1)
That opens your port 110 to outside connections coming in.
To allow outgoing on 110 type
iptables -A OUTPUT -p tcp -o $EXTINT -j ACCEPT

Like I said before, make sure to check the que to see if they actually left. I need to look some stuff up to help you more...

Gaston
01-25-2003, 10:02 PM
Zekeman,

Looking at the verbose output of your command, you're
actually sending the mail to yourself on local server.
Running mail/elm/pine, as root, and you'll see that the email
is sent yourself.

Subject: test me
test
.
Cc:
test@test.com... Connecting to localhost.localdomain. via relay...
220 linux.localdomain ESMTP Sendmail 8.12.5/8.12.5; Fri, 24 Jan 2003 16:26:23 -0

You might want to set the smart relay to something in your
sendmail.cf file, for example to test.com, this might have
security indications, though, hackers might start using your
box as mail relay, read more about this later.

Just edit sendmail.cf, and change the following:

# "Smart" relay host (may be null)
DSlocal

to

DSmailserver.test.com

Where mailserver is their mailserver name

If you want to and you only need to send mails from your
server, in sendmail startup script change the sendmail
to only run in queue mode, ie, it will only check the queue
and send mails but not receive anything. This will disallow
anyone relaying mails via your box.

For example, to run the queue every 30 mins, do the following,
in the startup script find the line which reads something like:

/usr/lib/sendmail -bv -15m

and change it to:

/usr/lib/sendmail -q30m

Then just start|stop sendmail

I strongly suggest that you read the FAQ's at http://www.sendmail.org

I would suggest that you try postfix or qmail, both are much
more secure out of the box, faster and easier to configure
than sendmail

http://www.postfix.org
http://www.qmail.org/

Also please apply the changes to your iptables as suggested
on earlier thread.

If you insist using sendmail, please read the FAQ's and prepare
yourself for loads of work. The O'reilly Sendmail book's the best
if you're planning to get serious about sendmail.