Operating System - Linux
1822036 Members
3450 Online
109639 Solutions
New Discussion юеВ

Re: Receiving Mail on Linux Redhat

 
SOLVED
Go to solution
Marty Metras
Super Advisor

Receiving Mail on Linux Redhat

I am setting up a RedHat 7.1 Linux server to be a Mail Server. I have setup sendmail. I think?
If I stay on the the box and email between users it works fine. If I email between Linux boxes on the same network it works fine.
If I email from the internet the mail is refused and returned.
I have a Web site on this box that can be seen from the internet.
I can get mail from this box from other PCs on the local network.
I can send email from the box to the Internet.
Summary:
The the box send/receives email local and sends to the Internet. Will not receive email from the Internet.
It host a web site that works fine.
I'm missing something??????????
Can you help?
Marty
The only thing that always remain the same are the changes.
10 REPLIES 10
K.C. Chan
Trusted Contributor

Re: Receiving Mail on Linux Redhat

You need to set-up an MX record in DNS which points to your mail server.
Reputation of a thousand years can be determined by the conduct of an hour
benoit Bruckert
Honored Contributor
Solution

Re: Receiving Mail on Linux Redhat

Hi,
What is the log you have ??
When you say it's refused , what is the exact message.

The best way to diagnose the problem is to connect to internet trough a dial up connection.
Then you telnet from this work station to your public ip address on the port 25.
Syntax :
telnet 25
You should have at this time the sendmail greeting message.
To send a message from there :
#helo hp.com
#mail from:fred@hp.com
#rcpt to:@yourdomain
#mail
this is your message
.
"The dot alone is important to finish the message"
You should have at this time message delivered...

Hope this helps.
Benoit
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Jeffrey S. Sims
Trusted Contributor

Re: Receiving Mail on Linux Redhat

I believe Michael and Benoit had great suggestions, but I would also like to add that you may want to check any firewall rules that you may have present even if you didn't install any knowingly. They would probably be in /etc/rc.d/rc.firewall or many other places. I think you can type
ipchains
and it will list the rules. If not then ipchains with an option should list them such as --list. I use iptables so I can't say for certain.

Also are you sending to a normal user or root or who?

The MX record would be my first guess though, then the firewall.

Hope this helps.
Marty Metras
Super Advisor

Re: Receiving Mail on Linux Redhat

I can not telnet to port 25. I get "connection refused"
I can telnet to the IP address. and login.
So it lookst to me that the Linux box is not listening for port 25.
What did I miss that will disallow port 25?
Marty


The only thing that always remain the same are the changes.
K.C. Chan
Trusted Contributor

Re: Receiving Mail on Linux Redhat

Is sendmail actually running, verify it with ps. If it's not running, you should start it up. Hope this helps.
Reputation of a thousand years can be determined by the conduct of an hour
Marty Metras
Super Advisor

Re: Receiving Mail on Linux Redhat

Benoit,

I can not connect to port 25.
Telnet return a "conection refuesed" message.
I can telnet to the box and log in.
I verigied that I was not blocking port 25 on the router. It is open.
I also tried to telnet to port 25 while on the local box itseld and it also refused the connection.
Meaning that port 25 is blocked or not listening?
How do I check that?
Marty
The only thing that always remain the same are the changes.
Marty Metras
Super Advisor

Re: Receiving Mail on Linux Redhat

No firewall.

ipchains returns input, output and forward (policy ACCEPT)

Sendmail is running.

I checked in /etc/services and port 25 is in there for smtp 25/tcp and 25/upd.

Where do I set it up to allow or disallow ports on the box itself.
While on the box I can not telnet to port 25.
Marty
The only thing that always remain the same are the changes.
Mark Fenton
Esteemed Contributor

Re: Receiving Mail on Linux Redhat

Marty,

pursuing the possible firewall angle:

1) check for instances of port 25 in your /var/log/messages log.

# grep -i "dport=25" /var/log/messages

2) verify that sendmail is accepting connections:

# ps -ef |grep sendmail
# root 3540 1 0 Date ? 00:00:00 sendmail: accepting connections

3) check /var/log/maillog for clues.

From your inability to
# telnet localhost 25
though, it would look more like a (linux) firewall issue than anything else.

hth

Mark
benoit Bruckert
Honored Contributor

Re: Receiving Mail on Linux Redhat

Another answer after the W.E. :
I really don't understand how you can send mail trough boxes on the same network, if you cannot telnet 25 on the same network !
Mark gave good way to solve you trouble,
I will give you another one, can you do on your redhat server :
netstat -a | grep smtp,
you should see as output :
*.smtp LISTEN,
If it's not the case, then sendmail is not runnig properly, nor listening on another port ??
May be you are using uucp on your network to send email each other ?
Can you check sendmail.cf to see the DaemonPort line (it should be commented),
Can you check also access file in etc/mail (check accesses !!).
Which sendmail version are you using ?

Many questions and not really an answer
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Marty Metras
Super Advisor

Re: Receiving Mail on Linux Redhat

I got it!
In /etc/sendmail.cf is an option thar was only letting smtp(Port 25) to be used on the localhost.
It was this line:
--------------
# SMTP daemon options
#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
---------------------
After remarking it out the who thing started to work.
Thanks for all for your help.
Marty
Marty@doerofthings.com (and it works)
The only thing that always remain the same are the changes.