Sendmail woes on Solaris 8

Posted on 2001-07-02
Last Modified: 2013-12-21
I can't figure out how to get Sendmail to work properly by calling it from programs.

And (I apologize for my ignorance here), I can't figure out how to send an email to another box on the same subnet with either mail or mailx (I tried to install pine, but it was rough going).  A few weeks ago I was able to get mail (something about keeping the msg on the same line and using ctrl-d) and mailx working, but I forgot how I did it :(

I'm pretty sure it'll send mail to another comp on the same subnet (i.e. rich@  But, I never got it working to send to the outside world:  I think this is my big problem.

I don't know if it's because of DNS or what...  Here's how my DNS is setup:

I configured client side DNS on this box like this (since I don't have a registered domain name for it):

I added the file /etc/resolv.conf
editted /etc/nsswitch.conf

And I can get the DNS to work for things such as ping and web surfing.


If I can get a local Sendmail to send to the outside world, that would be great.  When I set my smtpHost in a Java program to localhost, here's the error (I don't know why it loops, but it works fine on a Linux box):

Here is the report:This is the content of the report
the to email addy
Mail sent to:
the to email addy
Mail sent to:
the to email addy is:null
javax.mail.SendFailedException: Sending failed;
  nested exception is:
        javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
        javax.mail.SendFailedException: 550 <null>... User unknown

I also tried to have it use a remote smtpServer (on the same subnet), but that isn't working either:

javax.mail.SendFailedException: Sending failed;
  nested exception is:
        javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
        javax.mail.SendFailedException: 450 4.7.1 <>... Relaying temporarily denied. Cannot resolve PTR record for (this isn't my real ip, the security on the box is pretty loose tho).

If anyone can help me get through this last configuration problem, I would be ecstatic!  I just want this box to be able to send email to the outside world without having a registered domain name for it's IP address.  I'll throw in another 25-75 points depending on how detailed the help is for this Solaris NewB.

Thx :)

Question by:richyz26
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 6249119
try using

/usr/lib/sendmail -v

then enter something and finish wit ctrl-D

that should give you some information about what is happening with your mail.
LVL 40

Expert Comment

ID: 6250890
This is a case where you should be using a SMART_HOST that is part of a registered domain for non-local mail. Even if you managed to get sendmial to send the message out, quite a lot of the Internet mail servers will reject mail from machines that aren't part of a registered domain. I can't tell from the way the question is phrased if there is a valid mail server for your local network, or if real email services are handled by your service provider. You should setup sendmail so that it uses the mail server for your local network to use that mail server as a relay. That's done by including:

define(`SMART_HOST', `mail.ours.tld.')dnl

in your .mc file and building a new

Now, if your real mail server is local it may not allow you to relay mail through it unless it recognizes your system as lying within the domain of the mail server, as evidenced by a reverse lookup of your system's IP or by finding a host record for your system on the mail server. That's probably why you got the "Relaying temporarily denied" when you attempted to use a local sendmail server. If that local machine is the real mail server for your local network you need to speak to your network administrators about the reverse lookup problem.

Author Comment

ID: 6256549
Here's the output I now get from Sendmail:
bash-2.03$ /usr/lib/sendmail -v
yo Connecting to via relay... Host unknown (Name server: host not found)
/export/home/cfe/dead.letter... Saved message in /export/home/cfe/dead.letter

Before, it was complaining that my box had an unqualified hostname (solinf2) and it was saying that I need to set some $j var in the sendmail config file.  Then, I changed the hostname on the box, and I didn't get that error anymore.

Now, I suspect that I don't have sendmail properly configured.  I just used the default install for sendmail.  And, I'm working on getting it configured.  It doesn't look that easy so I might abandon Sendmail and try to get qmail working.  I wonder how I would configure things so that the java programs used qmail instead of sendmail if I did take this approach.

I might be facing an uphill battle since this sun box isn't part of a registered domain.

We don't have any internal mail server within our network.  (We just use pop accounts with some ISP).  I have a linux box that sends emails via sendmail within our network and it doesn't have any problems.  Sendmail on Solaris seems to be another beast!

I'm still battling it out.  Any advice?

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 6257540
I got it working by temporarily using a registered domain name and ip from one of the servers here.

It seems it won't work without using a registered domain name.  I keep getting that host unknown error that I listed above.

Is there any way to do what I'm trying to do without a registered domain name?

If not, I'll give jlms the points since that command was very valuable in helping me troubleshoot this problem.

LVL 40

Accepted Solution

jlevie earned 75 total points
ID: 6257875
Yes you can make it work without having a registered domain name for the Solaris box. From everything that is in the question and other comments it would seem that this system is probably part of a local network that is using one of the private, non-routable, IP address ranges. And furthermore it seems likely that there is not a local DNS server for this network, and that your organization doesn't have a registered domain name. The solution will change slightly if any of that isn't true, which your local network administator will know.

Since you stated that you read mail via POP from your service provider's mail server, you will need to set up the Solaris system to use that SMTP server as an out-going mail relay or SMART HOST. Now for sendmail to run properly it will need to believe that it has a Fully Qualified Domain Name (FQDN) and that can be a made up name as long as it is defined properly. On a Solaris system the hostname is stored in several places and the easiest way to change the hostname is by doing a "sys-unconfig" and entering the correct data on the next boot. Ideally you'd like for the Solaris system to have a name that appears to lie within the domain of your service provider. So if you pop mail from, say, you could make up a name that lies within that domain, say The only thing that would be important is that you not use an FQDN that actually exists (check by trying to resolve the name with nslookup, e.g., "nslookup").

Okay, with a valid hostname on the box the next step is to configure sendmail to use your provider's mail server as a SMART HOST. That means creating a sendmail mc file with the correct definitions and building a file from it. I'm not where I can see a Solaris 8 system right now, but I think the sendmail cf directory is in /usr/share. A pretty minimal mc file that should work for you follows. It will need editing to change the "" stuff to match that of your service provider and their mail server. Do make sure that that you don't use a windows box to mess with the data or it'll insert carriage returns on each line and that'll cause problems. Also when you paste it from this question you'll probably have white space at the beginning of each line which must be removed.
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
#       All rights reserved.
# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
# Copyright (c) 1988, 1993
#       The Regents of the University of California.  All rights reserved.
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.

#  This is a generic configuration file for SunOS 5.x (a.k.a. Solaris 2.x)
#  It has support for local and SMTP mail only.  If you want to
#  customize it, copy it to a name appropriate for your environment
#  and do the modifications there.

VERSIONID(`$Id:,v 8.11 1999/02/07 07:26:03 gshapiro Exp $')
define(`SMART_HOST', `')dnl

The above sould be saved in the cf directory as While in that directory you can build the new file with the command:

m4 ../m4/cf.m4 >

Copy the resultant file to /etc/mail and restart sendmail. It should start up without fussing and you should be able to send an outgoing message with sendmail directly (as above) or with:

> mail -s "Test message" some-addr@some.dom
...type in message, Control-D when done...

A good test would be to send a message to your email account at your ISP.
LVL 21

Expert Comment

ID: 8051510
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by jlevie

Please leave any comments here within the next 7 days


Cleanup Volunteer

Expert Comment

ID: 8100121
per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 169
Remote Change Dates on AIX Automation 7 76
Unix/bash: scripted arithmetic 13 102
MarkLogic 1 102
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question