sendmail 8.12.11 question

Jay Nugent jjn
Mon May 17 11:59:39 PDT 2004


Greetings,

On Mon, 23 Feb 2004, M.W. Chang wrote:

> I set up a local zone localzone.org in my BIND-9. This is a private
> zone, not registered. The linux become become server.localzone.org.
> 
> I registered in dyndns.org for host name "myname.homeip.net".
> 
> Now when I run "mail auser_at_remotedomain.com"  as root to send a 
> message, The sender address of the message would appear as
> "root_at_server.localzone.org".
> 
> I tried define(`confDOMAIN_NAME',`myname.homeip.net') to redefine $j,
> but the mail command still use "server.localzone.org".
> 
> How could I rewrite "root_at_server.localzone.org" to 
> "root_at_myname.homeip.net"?

   Sendmail *usually* comes ready to run as-is right out of the box.  
Although there are two things that must be done.

   1) Sendmail needs to be able to determine the name of the host machine 
it is running on.  It does this by reading the results of 'hostname'.  The 
FQDN (Fully Qualified Domain Name) *MUST* contain a resolvable host in 
DNS.  So if your 'hostname' results in "localhost.localdomain", sendmail 
will crap out on you.  But if it gets "chang.homeip.net" -and- it is 
resolvable in DNS (IP to Name and Name to IP) then you should be good.

   2) Sendmail, due to security issues, is configured to ONLY listen to 
the loopback (lo) interface on your machine.  It needs to be told to 
listen to your ethernet (or whatever interface routes to the Internet). 
Lots of folks will tell you that you HAVE to edit sendmail.mc and run m4 
to generate a new sendmail.cf.   But you really only need to edit ONE line 
in sendmail.cf to accomplish this.  Here is what *I* do:

   Find the "DaemonPortOptions" line in /etc/sendmail.cf

   Edit it to look like this:

# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

   Then stop and restart sendmail:
      /etc/rc.d/init.d/sendmail stop
      /etc/rc.d/init.d/sendmail start


   ...or I guess you can put the 'dnl' in front of this line in 
sendmail.mc and run m4:

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')


   Good luck!
      --- Jay
             
"Those that sacrifice essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."  -- Ben Franklin (1759) 
+------------------------------------------------------------------------+
| Jay Nugent   jjn at nuge.com    (734)484-5105    (734)544-4326/Fax        |
| Nugent Telecommunications  [www.nuge.com]     (734)649-0850/Cell       |
|   Internet Consulting/Linux SysAdmin/Engineering & Design/ISP Reseller |
| ISP Monitoring [www.ispmonitor.net] ISP & Modem Performance Monitoring |
| Web-Pegasus    [www.webpegasus.com] Web Hosting/DNS Hosting/Shell Accts|
| LinuxNIC, Inc. [www.linuxnic.net]   Registrar of the .linux TLD        |
+------------------------------------------------------------------------+
  10:01pm  up 158 days, 14:26,  4 users,  load average: 0.71, 0.26, 0.15




More information about the Linux-users mailing list