• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1498
  • Last Modified:

Sendmail config

We run Exchange internally for email and have a Solaris server that runs our main systems
We have Sendmail configured enough that we can send email from the Sun server to internal users, but cannot send outside of our network.
Our email domain is @harlemfurniture.com, our Solaris logs show the email coming from  @harlem.harlem.com...?
Where do I need to look to correct the @harlem.com to @harlemfurniture.com?
  • 2
  • 2
  • 2
2 Solutions
what's the domainname setting for your Solaris box? type in:


to find out.

Do you have a mailserver already up and runing? (it can be used as a mail samrt

And you also need to check the followings for your Solaris box:

1) DNS settings:
    Check the following files in your Solaris box:
    a) edit you /etc/resolv.conf file, to put your DNS server ip in, the file looks like:
        nameserver your-isp-dnsserver-ip
    b) make sure that the hosts record in  /etc/nsswitch.conf  file looks like:
        hosts:     files dns [NOTFOUND=continue]

2) check your sendmail configuration file (/etc/mail/sendmail.cf)
     check if the smart hosts is defined:
it should looks like:

# "Smart" relay host (may be null)

You can use your ISP's mail server as the Smart relay hosts.
if your ISP's mailhost name is fred.abc.com, you can do:

3) If you want the Solaris box as a real mail server (can send and received email
    from the outside of the world, you need to setupDNS  MX record for the  
    Solaris box:
   Check the DNS to see if your mail server has MX record:
nslookup -type=MX you-machine-name
man nslookup

If you are not runing a DNS server, you need to ask your ISP you add the DNS record with
MX for your box.

   If your domain name is harlem.com  for the sunbox, and you want to make the
Solaris can received mails for box harlem.com   and harlemfurniture.com

    you need to make sure sendmail.cf has something like:
#   local info   #

# Cwlocalhost
Cwlocalhost harlem.com   harlemfurniture.com

   Note: you need to remember to restart sendmail after you modify the sendmail.cf file.

   EE has a sendmail TA, for sendmail question, it is better to post it in:

 also please read the following sendmail FAQ and tips:

To change from @harlem.com to @harlemfurniture.com, this could be done by the process called masquerading. If you go through the available sendmail docs for masqurading howto, you should be able to figure out how to do it.
harlemitAuthor Commented:
We are getting close.
We do have internal DNS and a separate SMTP server.

When I try 'domainname' I get no response?

It does not appear that my email are being forwarded to my SMTP server though.
In the logs it shows that yahoo is rejecting my mail sent from this server rather than our SMTP server.
What do I need to do to ensure that sendmail routes this email through our SMTP server?

I found an entry in the sendmail.cf file:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain

The Dj$w.harlem.com was the original entry, we would then get a denial stating our from domain was harlem.harlem.com.
After changing this record to the Dj$w.harlemfurniture.com, the denial now states that the from domain is harlem.harlemfurniture.com.

BTW, harlem is the name of the server, so I am reading this as it is sending this email from itself rather than through our internal SMTP server which has a legit MX record.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

harlemitAuthor Commented:
More info,
When sending an email with this:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain

Included in our sendmail.cf file, the email shows up as coming from Super-User@localhost and from the server harlem.harlemfurniture.com

If I remove this line, then the email looks better formatted coming from Super-User@harlem.com and from the server harlem.com.

Now, where does sendmail determine it's domain?
I need to change it from harlem.com to harlemfurniture.com
>When I try 'domainname' I get no response?

you need to set the domain for your box, login as root or su as root, use a text
editor (eg vi, dtpad) to edit (or create) /etc/defaultdomain file
and put your domainname inside the file, eg


also edit /etc/hosts file to  add the full name in the  file, eg:
xxx.xxx.xx.x mybox loghost

you can also coment out:

in sendmail.cf file

xxx.xxx.xx.x mybox.harlemfurniture.com    mybox loghost

where: xxx.xxx.xx.x is the IP of your box, and mybox is your hostname.

then reboot the system.
Hi harlemit,

I don't know what version of sendmail you are working with, but the below steps should resolve one of the issues that you are having. To change from @harlem.harlemfurniture.com to @harlemfurniture.com -- as I had already mentioned -- you would have to follow the steps for masquerading. Below are the steps to do so.

Configuring the Solaris-supplied version of Sendmail
In this example, I will configure the version of Sendmail (8.11.7) that was installed by default on a Solaris 8 system. Sendmail will be configured to use header sender and envelope sender address masquerading and a "smart host."

On Solaris 9, substitute main.mc for main-v7sun.mc in the instructions.

1. Change to the directory containing the Sendmail configuration files.
cd /usr/lib/mail/cf

2. Make a copy of main-v7sun.mc as sendmail.mc, and make modifications to sendmail.mc.
cp main-v7sun.mc sendmail.mc

3. Configure sendmail.mc. In this example, we want to use the "smart host" smart_host.example.com and masquerade both the header sender and envelope sender addresses as example.com.

vi sendmail.mc

Insert the following entries before the MAILER lines:

define(`SMART_HOST', `smart_host.example.com')

4. Build the sendmail.cf file from the sendmail.mc file.
# /usr/ccs/bin/m4 ../m4/cf.m4 sendmail.mc > sendmail.cf

5. Test the sendmail.cf file.
/usr/lib/sendmail -bt -C./sendmail.cf

Make sure that root is an "exposed user." An exposed user is a user that will not be masqueraded. This is used when accounts, such as root, are not unique across systems.

> $=E

Test header sender and envelope sender masquerading:
> /tryflags HS
> /try esmtp user@host.example.com
Rcode = 0, addr = user@example.com

> /tryflags ES
> /try esmtp user@host.example.com
Rcode = 0, addr = user@example.com

6. Backup the existing sendmail.cf file.
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.date

7. Install the new sendmail.cf file.
cp sendmail.cf /etc/mail/sendmail.cf

8. Sendmail the Sendmail process a SIGHUP to begin using the new configuration file.
kill -HUP `head -1 /var/run/sendmail.pid`


As far as sending mails through smtp server, you would have to check if the mail is relaying through the SMTP server properly. If the yahoo header is indicating that your email messages are being rejected is because of the box you are working on -- most probably it is not relaying properly via the SMTP server. Please check configuration files on relaying...

If you could mention the steps that you had taken to configure relaying your outgoing messages, probably we could help.

Hopefully this helps.. Cheers!!

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now