-   Linux - Newbie (
-   -   Sendmail Help! (

ccbtech1 08-05-2004 11:21 AM

Sendmail Help!

I am new to this forum. However, I have a question that I have been trying to solve for several days now. I tried to search for the answer on google, but no matter where I go, I find different suggestions and nothing has seemed to work yet. I am a bit confused on this....

The question is dealing with sendmail. We use webmin and the command prompt to work on our Linux server (Red Hat Linux). Everything seems to be set up correctly. However, for some reason, our application through which we send mail from (using php), does not want to send out email to EXTERNAL addresses. I have no problem sending out email to internal addresses (meaning within our campus). However, if I try to send out an email to someone with an address at comcast or hotmail, the email gets stuck in the mail queue, with the error message: " route to host." Is this an issue with relaying? Or perhaps I have configured incorrectly? Could you please give me some suggestions of what can be done to fix this problem! This would be really appreciated!



Charalambos 08-05-2004 11:55 AM

Can you ping addresses outside your campus?
It seems like a routing problem. Have you specified the right standard gateway?

ccbtech1 08-05-2004 12:18 PM

Actually, I can ping addresses outside my computer. I am able to access the internet overall. -I do have an IP address. Or do you mean pinging through sendmail? (How would I try this?) (I know that I can go to Start > Run > cmd > and ping an external address, like This works by the way.)

Inside the file, i have this option set: ('Smart_Host',''). In other words, the relay server is listed: Could this be a problem with relaying?

Also, I have this option set: dn1 DAEMON_OPTIONS('Port=smtp, Addr =, Name=MTA')

-I thought perhaps this was where the problem was, since the IP address is only specified from (our campus). However, when I changed this option to equal, the problem still exists. The mail, although I flushed it after this, still is in the outbox. (I compiled and restarted sendmail after making the changes of course.)

First I thought perhaps the addresses have something wrong with them. However, I even tried a test email and tried to send out an email to one of MY external addresses. Sure enough, this email got stuck also in the outbox.

Any suggestions?



ccbtech1 08-05-2004 12:31 PM

Correction: I meant I can ping addresses outside the CAMPUS (wrote computer). I thought this may have been a routing issue... but when I contacted the ITS center for our campus, everything seems to be fine. It seems that this is only a Sendmail issue. Perhaps it is not configured properly... I started using sendmail quite recently and therefore, am very new to it. As a result, I am not sure what is causing this problem. Perhaps someone has experienced this problem before, with Sendmail?


Pete M 08-05-2004 01:17 PM


This line has a few errors, not sure if you copied and pasted it

Should look like

There is a subtle difference between ` and '

Also this line dn1 should be dnl
dn1 DAEMON_OPTIONS('Port=smtp, Addr =, Name=MTA')

Should be
dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl

Doing this allows Sendmail to listen on all available interfaces

Another observation is that perhaps will not allow relaying from your IP or domain, SMART_HOST defines where external mail is directed to


ccbtech1 08-05-2004 01:26 PM

Hello Pete,

Thanks for the reply. I actually did not copy & paste the line(s). -I probably should have done that! But thanks for the corrections. I looked at and it looks like I have this setup correctly:

(copied & pasted):

dnl define(`SMART_HOST',`')

dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')
~This line, however, does not have the dnl at the end. (I just noticed this.) So I will try this!

As far as sending email, the email is sent out from different addresses, through our ticketing system. Here is an example of a message that I have "stuck" in the outbox:

Tue, 3 Aug 2004 09:35:37 -0400 someone' someone' 1 kB Deferred: No route to host

I will change the above line & will let you guys know if this works!

Thanks for your help!


ccbtech1 08-05-2004 01:35 PM


It's me again. (Sorry for all these postings.) Pete, you wrote this line in your previous posting:
" will not allow relaying..."

Do you know this can be fixed? In other words, how should sendmail be configured on a server, using relaying... ?

Thanks again...


Pete M 08-05-2004 04:17 PM

Hi -Olga

I think you will find that your host name is the problem not Sendmail

I am pretty sure Sendmail will not send mail out to the internet unless it originates from a FQDN ( fully qualified domain name )

Which Linux distribution are you using ? the following is based on Redhat

At the command prompt type

]$ hostname
If the answer you get is localhost.localdomain then this is more than likely your problem

localhost.localdomain is not a FQDN in other words it will not resolve to a MX record via DNS but this is the host Sendmail is using or trying to

Take a look in /etc/hosts, again based on Redhat, probably looks like this localhost.localdomain localhost

Try it this way this localhost.localdomain localhost

You will need to reboot to make the change take effect

I must warn you that this is only an educated guess so no guarantees given but now Sendmail should have a FQDN or host which will resolve

If everything looks OK then try sending your mail again, if not you can always change /etc/hosts back to the way it was

Hope this helps


ccbtech1 08-06-2004 01:25 PM

Hey guys! Thanks for all your help! I finally got this issue resolved! Pete, the distribution that I am using is Red Hat. However, when I checked the setup at /etc/mail/local-host-names, everything seems to be setup correctly there. Also, when I typed the command 'hostname,' it looks like I do have a FQDN.

But I finally got the mail to send out to external addresses by playing with the options for Sendmail via Webmin. :-) (Webmin makes it a lot easier to configure Sendmail.) All I did was go into "Sendmail Options" and changed the first option "Send outgoing mail via host" FROM deliver directly,TO the name of our ISPs SMTP server. And sure enough, all stuck messages (and there were a lot) successfully sent out! I have sent some test emails and everything seems to be working now. So I guess this was basically a routing problem? For some reason the mail did not want to send via the host DIRECTLY and forwarding it via our ISPs SMTP server got it to work! I will continue to monitor this though.

Thanks guys!

-Olga :)

subaruwrx 08-30-2004 02:48 AM

Can I ask what are the configs that you changed?

dnl define(`SMART_HOST',`smtp.your.provider')

DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl


webmin - "send outgoing via host"

Is that all?

btw, where do I find the messages that failed to send out?

subaruwrx 09-02-2004 05:27 AM


Originally posted by subaruwrx
Can I ask what are the configs that you changed?

dnl define(`SMART_HOST',`smtp.your.provider')

DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl


webmin - "send outgoing via host"

Is that all?

btw, where do I find the messages that failed to send out?


subaruwrx 09-04-2004 02:02 PM


Originally posted by subaruwrx
Can I ask what are the configs that you changed?

dnl define(`SMART_HOST',`smtp.your.provider')

DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl


webmin - "send outgoing via host"

Is that all?

btw, where do I find the messages that failed to send out?


ccbtech1 09-04-2004 03:00 PM

Hello user "subaruwrx,"

Sorry for the delayed reply. To answer your question, the messages that failed to send out via sendmail reside at the following path: /var/spool/mqueue

I believe that all users that have sendmail setup and configured, the mail queue always resides in this location. If there are messages there, then they have not been sent out yet. I checked the dates on mine and realized that mail to external addresses was not sending out for about 2-3 days. Therefore, I archived and zipped the messages and saved them in a different location. When I finally got the issue resolved, I placed these messages back into the mail queue and they were then successfully sent out (after restarting sendmail).

You are correct, the only thing that I changed was a "sendmail option." However, I did this via webmin. (Using webmin, there is a way to see if there are messages stuck in your mail queue also. From memory, I believe you go into Servers > Sendmail > & Outgoing Mail). (I currently do not have any of this opened, thus writing from memory.) The thing that fixed the problem was changing the first option (in "Sendmail Options") "Send outgoing mail via host" FROM: 'DELIVERY DIRECTLY' (through the host), TO: 'the name of our ISPS SMTP server' (in my case it was mail.your.provider). In other words, I realized that for some reason, mail was not sending out to external addresses DIRECTLY through the host. Forwarding it to our provider, however, succesfully sends out the messages.

At the moment, I am not sure of the route that one would take via command prompt, since I did this via webmin. When I look into it, I will let you know. In the mean time, I hope I have answered your question(s).

subaruwrx 09-05-2004 01:10 AM

Thanks for the reply.

However, I was told by my friend that he did not configure is sendmail but hes still able to mail to his hotmail account using "mail". :confused:

All times are GMT -5. The time now is 02:29 PM.