old-www/LDP/solrhe/Securing-Optimizing-Linux-R.../chap22sec180.html

391 lines
6.7 KiB
HTML

<HTML
><HEAD
><TITLE
>The /etc/mail/local-host-names file </TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.60"><LINK
REL="HOME"
TITLE="Securing and Optimizing Linux"
HREF="index.html"><LINK
REL="UP"
TITLE="Software -Server/Mail Network"
HREF="soser-mailn.html"><LINK
REL="PREVIOUS"
TITLE="The /etc/mail/aliases and aliases.db files"
HREF="chap22sec179.html"><LINK
REL="NEXT"
TITLE="The /etc/rc.d/init.d/sendmail script file"
HREF="chap22sec181.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Securing and Optimizing Linux: RedHat Edition -A Hands on Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="chap22sec179.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 22. Software -Server/Mail Network</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="chap22sec181.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="AEN12384"
>22.8. The <TT
CLASS="filename"
>/etc/mail/local-host-names</TT
> file</A
></H1
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
><SPAN
CLASS="inlinemediaobject"
><IMG
SRC="./images/Note.gif"
ALT="Note"
></IMG
></SPAN
>: </B
>
Please note that the <TT
CLASS="filename"
>/etc/mail/local-host-names</TT
> file is for all type of configuration.
</P
></BLOCKQUOTE
></DIV
><P
>&#13; The <TT
CLASS="filename"
>/etc/mail/local-host-names</TT
> file is read to obtain alternative names for the local host. One use for such a file might be to declare a list of hosts in your network for which the
local host is acting as the <TT
CLASS="literal"
>MX</TT
> recipient. On that machine we simply need to add the names of machines for which it i.e. <TT
CLASS="literal"
>mail.openna.com</TT
>, will handle mail to <TT
CLASS="filename"
>/etc/mail/local-host-names</TT
>.
Here is an example:
</P
><DIV
CLASS="example"
><A
NAME="AEN12401"
></A
><P
><B
>Example 22-2. Alternative names</B
></P
><P
>&#13; Create the local-host-names file, <B
CLASS="command"
>touch</B
> <TT
CLASS="filename"
>/etc/mail/local-host-names</TT
> and add the following line:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13; # local-host-names - include all aliases for your machine here.
openna.com
deep.openna.com
www.openna.com
win.openna.com
mail.openna.com
</PRE
></TD
></TR
></TABLE
>
With this type of configuration, all mail sent will appear as if it were sent from <TT
CLASS="literal"
>openna.com</TT
>, and any mail sent to <TT
CLASS="literal"
>www.openna.com</TT
> or the other hosts will be delivered to <TT
CLASS="literal"
>mail.openna.com</TT
> our mail Hub.
</P
></DIV
><DIV
CLASS="caution"
><P
></P
><TABLE
CLASS="caution"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
><SPAN
CLASS="inlinemediaobject"
><IMG
SRC="./images/Caution.gif"
ALT="Caution"
></IMG
></SPAN
></B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13; Please be aware that if you configure your system to masquerade as another, any e-mail sent from your system to your system will be sent to the machine you are masquerading as. For example, in the above illustration, log
files that are periodically sent to <TT
CLASS="email"
>&#60;<A
HREF="mailto:root@www.openna.com"
>root@www.openna.com</A
>&#62;</TT
> by the cron daemon of Linux would be sent to <TT
CLASS="email"
>&#60;<A
HREF="mailto:root@mail.openna.com"
>root@mail.openna.com</A
>&#62;</TT
> our Mail Hub.
</P
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="AEN12420"
>22.8.1. Configure the <TT
CLASS="filename"
>/etc/sysconfig/sendmail</TT
> file</A
></H2
><P
>&#13; The <TT
CLASS="filename"
>/etc/sysconfig/sendmail</TT
> file is used to specify <TT
CLASS="literal"
>SENDMAIL</TT
> configuration information, such as if sendmail should run as a daemon, if it should listen for mail or not, and how much time
to wait before sending a warning if messages in the queue directory have not been delivered.
</P
><P
>&#13; Create the sendmail file <B
CLASS="command"
>touch</B
> <TT
CLASS="filename"
>/etc/sysconfig/sendmail</TT
> and add in this file:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13; DAEMON=yes <A
NAME="dmys"
><IMG
SRC="../images/callouts/1.gif"
HSPACE="0"
VSPACE="0"
BORDER="0"
ALT="(1)"></A
>
QUEUE=1h <A
NAME="qeys"
><IMG
SRC="../images/callouts/2.gif"
HSPACE="0"
VSPACE="0"
BORDER="0"
ALT="(2)"></A
>
</PRE
></TD
></TR
></TABLE
>
<DIV
CLASS="calloutlist"
><DL
COMPACT="COMPACT"
><DT
><A
HREF="chap22sec180.html#dmys"
><IMG
SRC="../images/callouts/1.gif"
HSPACE="0"
VSPACE="0"
BORDER="0"
ALT="(1)"></A
></DT
><DD
>&#13; The <TT
CLASS="envar"
>DAEMON=yes</TT
> option instructs Sendmail to run as a daemon. This line is useful when Sendmail client machines are configured to not accept mail directly from outside in favor of forwarding all local mail to a
Central Hub, <EM
>not running a daemon also improves security</EM
>. If you have configured your server or client machines in this way, all you have to do is to replace the <TT
CLASS="envar"
>DAEMON=yes</TT
> to <TT
CLASS="envar"
>DAEMON=no</TT
>.
</DD
><DT
><A
HREF="chap22sec180.html#qeys"
><IMG
SRC="../images/callouts/2.gif"
HSPACE="0"
VSPACE="0"
BORDER="0"
ALT="(2)"></A
></DT
><DD
>&#13; Mail is usually placed into the queue because it could not be transmitted immediately. The <TT
CLASS="envar"
>QUEUE=1h</TT
> sets the time interval before sends a warning to the sender if the messages has not been delivered.
</DD
></DL
></DIV
>
</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="chap22sec179.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="chap22sec181.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The <TT
CLASS="filename"
>/etc/mail/aliases</TT
> and <TT
CLASS="filename"
>aliases.db</TT
> files</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="soser-mailn.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The <TT
CLASS="filename"
>/etc/rc.d/init.d/sendmail</TT
> script file</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>