?
Solved

Sendmail config

Posted on 2006-06-09
6
Medium Priority
?
1,485 Views
Last Modified: 2013-12-21
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?
0
Comment
Question by:harlemit
[X]
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
  • 2
  • 2
  • 2
6 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 16883067
what's the domainname setting for your Solaris box? type in:

domainname

to find out.

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

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)
DSmailhost.abc.com

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

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:
   http://www.experts-exchange.com/Networking/Email_Groupware/Sendmail/


 also please read the following sendmail FAQ and tips:
http://www.sendmail.org/faq/
http://www.akadia.com/services/sendmail_tips.html
http://www.sendmail.org/~ca/email/setup1.html   
   



   
   
0
 

Expert Comment

by:z670193
ID: 16895090
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.
0
 

Author Comment

by:harlemit
ID: 16898194
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
#Dj$w.harlem.com
Dj$w.harlemfurniture.com

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.
0
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

by:harlemit
ID: 16898343
More info,
When sending an email with this:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.harlem.com
Dj$w.harlemfurniture.com

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
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 1000 total points
ID: 16899151
>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

harlemfurniture.com


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

you can also coment out:
Dj$w.harlemfurniture.com

in sendmail.cf file

To:
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.
0
 

Accepted Solution

by:
z670193 earned 1000 total points
ID: 16902718
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')
MASQUERADE_AS(`example.com')
FEATURE(`masquerade_envelope')

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
root

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!!
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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