|  | s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre | 
| Next
Previous
Contents 3. Configuring sendmail3.1 The main configuration fileSendmail uses a highly complex rule system for it's
configuration.  While you can do lots of neat tricks with
this stuff, writing a  
 Instead of hand-crafting these rules, we will rely on
the  
 Let's look at the first lines of the  
 include(/usr/lib/sendmail.cf/m4/cf.m4) VERSIONID(`sendmail.mc - roessler@guug.de') OSTYPE(debian) define(`ALIAS_FILE',`/etc/mail/aliases') In the beginning,  
 The following lines tell sendmail to use the
 FEATURE(masquerade_envelope) FEATURE(genericstable, `hash -o /etc/mail/genericstable') GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain') The masquerade_envelopefeature tells sendmail to
apply header rewriting to the envelope sender of a
message.  This is the mail address to which external mail
delivery subsystems will direct their delivery failure
reports and warning messages.  Thegenerics*files
will be explained below.
 Now, we have to define a so-called smart host, that is, a machine which will handle outgoing mail for your system. Note that this machine may be different from your ISP's POP and IMAP servers. If in doubt, contact the hotline. The code in the master configuration file: define(`SMART_HOST',`mail-out.your.provider') Please replace mail-out.your.provider by the fully qualified hostname of your internet service provider. 
 The final two lines include the "mailer" definitions which are needed by sendmail to find out how to handle various types of mail: MAILER(local) MAILER(smtp) 
 To generate the  # m4 sendmail.mc > _sendmail.cf # mv -f _sendmail.cf sendmail.cf Note the technique of writing m4's output to a
temporary file which is thereafter moved to the proper
place.  This helps us to prevent sendmail from reading
partially written configuration files.
 3.2 Address rewritingFirst, we have to tell sendmail what addresses are to
be considered local (and thus should be subjected to the
rewriting).  This is quite simple: Just put the fully
qualified host name of your machine into the file
 $ hostname -f 
 Now, let's come to the rewriting table proper:
 
 harry harryx@your.isp maude maudey@her.isp root fredx@your.isp news fredx@your.isp Note that there should be one entry for each account on the local machine, so that automatically generated mail which leaks out of the local system carries correct header information. 
 For performance reasons, sendmail won't use this text file directly, but rely on a "hashed" version instead. To generate it, type the following command: 
 # makemap -r hash genericstable.db < genericstable 
 Note that the rewriting rules from the
 
 3.3 AliasesThe aliases file contains additional local names which
are only valid for local messages.  This is useful for
administrative accounts like  
 A reasonable start for
 
 root: fred news: root postmaster: root mail: root www: root nobody: /dev/null MAILER-DAEMON: nobody This example will forward local mail for the  
 Just like the  
 Next Previous Contents |