Solved

Sendmail config

Posted on 2006-06-09
6
1,460 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
  • 2
  • 2
  • 2
6 Comments
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:harlemit
Comment Utility
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 250 total points
Comment Utility
>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 250 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now