"service unavailable" when I go into mailq


I'm new to Linux just two days ago..  

I installed RedHat8.0 using the three installation CD's.

During the install process I configured it with a private IP address, because it's behind a Cisco Firewall, and have given it a hostname.  I also given it the IP addresses of the DNS servers of my ISP.  I can surf the net using the Netscape browser.

I'm trying to send mail via the command line to my work email address using the "mail" command.

When I type "mailq", I see my request.  However, I see "service unavailable".

What does that mean?  How can I fix it?


Who is Participating?
GnsConnect With a Mentor Commented:
"deffered" means just that:-).
For _some reason_ the mail couldn't reach it's destination (or next hop, if you have it set up as that... but you probably haven't:-), and so has been deffered until later (in hopes that the _reason_ has been cleared next time it tries).

Sendmail has probably logged something regarding this in /var/log/messages and/or /var/spool/maillog

What I'd suggest you do is:
Find out the host on the receiving end (MX for the domain you are trying to reach)and do
host <domainname for remote mailhost><Enter>
to see that the DNS at least seems to be OK.
You can then "play MTA" by
telnet <remote mailhost> 25<Enter>
<You should see a greeting here, and be able to do>
EHLO <yourhostname.yourdomain><Enter>

to verify that you can reach the remote end via SMTP.

My guess as to what is going on is:
1) Unable to ascertain the MX for the remote domain (the pix has to let DNS through.... you say you can surf, so perhaps this isn't it;),
2) Unable to use SMTP due to a local iptables (netfilter) firewall,
3) Unable to use SMTP due to the PIX,
4) problem with the recipient address, or
5) problems on the remote side;-)

-- Glenn
Is you firewall filtering out mail?  What mail are you using, sendmail perhaps?
eric1972Author Commented:
Yes, I have configured my PIX to allow outbound SMTP with the following ACL..

access-list ACLOUT permit tcp any any eq smtp

I am using sendmail.

What am I doing wrong?!?

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

What about pop?
eric1972Author Commented:
Thanks for your help on this...

I'm gonna ask a stupid a question...

How do I check for POP on Linux?!?

Thank you.
You need to configure a Mail Transfer Agent (MTA) for this to work. The two you can choose between on RH8 is Sendmail and Postfix.
Check with
ps auxww| egrep "sendmail|postfix"|grep -v grep<Enter>
which one you have running.
If you get nothing from the above, check with
rpm -qa| egrep -i "sendmail|postfix"<Enter>
which you have installed (you can have both installed) and
chkconfig --list sendmail<Enter>
chkconfig --list postfix<Enter>
which one should be running.

You would have to configure it, whichever it is, most probably:-).

There might also be some _local_ iptables firewall messing things up. Check with
iptables -L<Enter>

-- Glenn
eric1972Author Commented:
With the "rpm" command, I received the following info:


With the "chkconfig" command, I received the following info on both postfix and sendmail:

0:off 1:off 2:on 3:on 4:on 5:on 6:off

Erhm, then you should do
chkconfig <MTA> off<Enter>
for the one you _don't_ want to use.
One MTA per system is quite enough:-).
ls -l /etc/alternatives/mta<Enter>
will show which one the system "thinks" is active,
and you "switch" to the one you want with
if you don't run X.

Which one you decide to go with is a matter of personal taste. I used to prefer sendmail, but generally tend to go for postfix now. Postfix used to be called the IBM Secure Mailer and is a bit hysterical (doesn't hardly trust itself:-), before it was OpenSourced. It's fairly simple to configure... OTOH, so is sendmail too, at least if you use the m4-stuff.
Sendmail is monolithic in architecture, while postfix is a set of queue managers (separate processes)... a bit like David and Goliath:-):-)

When you've decided which to use, you'll either have to restart/flip-flop runlevels or manually stop the "unwanted one" (lets pretend that it is sendmail;):
/etc/init.d/sendmail stop<Enter>
and then restart the other one
/etc/init.d/postfix restart<Enter>

What does
say after this?

Either should be fine, provided they can get good DNS, and noone is preventing the use of outgoing SMTP.

-- Glenn
eric1972Author Commented:
I performed a "chkconfig postfix off".

I then performed a "ls -l /etc/alternatives/mta" and was returned with a "/usr/sbin/sendmail.sendmail".

I then performed a "/usr/sbin/redhat-switchmail"

I then restarted sendmail with the command "/etc/init.d/sendmail restart"

mailq still shows the mail in the queue, but instead of "service unavailable", I see "deferred".

What's next???  Thanks for your help.  I greatly appreciate it.
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept comments from Gns as answer
Please leave any comments here within the next seven days.


EE Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.