[lug] standalone sendmail

karl horlen horlenkarl at yahoo.com
Mon Nov 26 04:17:25 MST 2007

> Set up the local box to be a smart relay and the
> remote box to allow relay from the local box.
> If the remote box is sendmail/CentOS then you'd edit
> /etc/mail/access and follow instructions in that
> file.  For the local box, edit /etc/mail/sendmail.mc
> and search for SMART_HOST, uncomment and edit
> appropriately.
> Run "make -C /etc/mail" after you are done.

I'm not a sendmail expert by any means and have been
trying to figure out how to make this work reading
tons of stuff online.

I can actually send mail to my isp account withOUT
having to set up the smart host per your original
recommendation.  In order to make it work, I configure
my local FQDN to an existing real one registered with
DNS even though my sendmail server lives on a private
network behind a firewall.

What I don't understand is this.

In my /etc/aliases i alias root to an outside account
at the isp:

root:  name at ispdomain.com

I configure the following:

/etc/hosts www.realdomainAAA.com localhost.localdomain

And then for shits and grins I configured the hostname
from the commandline to another different but "live"
realdomain.  I thought this would help me
differentiate where the sendmail parameters were being
set from behind the scenes in the log files.

# hostname www.realdomainBBB.com

I then issue a dummy email to root.

#  echo test|mail -s test root

The mail does get delivered to my ISP domain account. 

The header lists it as coming `from
"root at realdomainBBB.com" (the cmdline hostname entry)
for name at ispdomain.com' 

Yet the To: address is actually to
root at realdomainBBB.com and not to name at ispdomain.com.

That seems odd but maybe it isn't.  I would think the
To: address would be to my isp address since that's
what root is aliased to.

Now I check to see how this all plays out behind the

# cat /etc/var/maillog

It's rather bizzarre.

at first we have from=<root,....

then from=<root,... becomes
from=<root at realdomainBBB.com (the FQDN specified with
hostname command)

however that same log entry specifies
relay=www.realdomainAAA.com (FQDN from /etc/hosts not
the hostname cmd)

So it appears that sendmail pulls from both the
/etc/hosts file and whatever is set in the hostname
cmd for different parts of its processing.

Curious if anyone knows how or why it does that?

I'm also more curious why sendmail tries to relay to
www.realdomainAAA.com at all.  Shouldn't it just
immediately try to contact my ISP domain account first
since root is aliased to my ISP account?  It seems
like  it wants to take an extra step that has no
bearing on the transaction at all.

I'm not sure if you can follow that but I can't find
the answers online.

What is apparent is I have to trick the receiving MTA
at the ISP to believe it's talking to a real domain
via SPF guidelines.  Setting my private network server
to a real FQDN I own elsewhere is a crazy way to make
this work though.  I don't like having to do it.

Is there anyway I can keep my private internal FQDN
config (etc/hosts /etc/sysconfig/network) private
while only allowing sendmail to send on the public
live registered domain (insert the appropriate
headers) by setting a sendmail.mc option?   Hoping
this is a simple one liner or three.

Sorry for the long post.

Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  http://overview.mail.yahoo.com/

More information about the LUG mailing list