aboutsummaryrefslogblamecommitdiff
path: root/el_GR.ISO8859-7/books/handbook/mail/chapter.sgml
blob: e944188951bee1ff2b20958ea3225528a4832485 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                           
    
 






                                                                
                     
 




























                                                                       
                                                                     
                                                                           
                                                                           
                                                                            
                                                                            
                                                                         
                                                                       





                                                                     
                                           



                                                                         
                                                 


                 

                                                                  



                                                                

                                                           


                 



                                                                      



                                                               
                                         











                                                                             
                          


                 

                                                                      


                 


                                                                      


                 

                                                                             


                 

                                                                   







                                                            
                                                         



                                                                       
                                                                       



                                                                         
                                                                   



                         
                                                             



                                                  







                                                                          

                         
                                        
 
                                                             
                                        
                                                                          

                                                                        
                                         








                                                                             

                         
                                                  
                 

                                                                  

                  

                                                                 

                  

                                                               

                  

                                                              

                  



                                                                        


                    
                                                      


                   
                                                         


                   
                                                       


                     








                                                                             

               







                                                                          



                         
                                  
 







                                                                            




                                    













                                                                           





                                                                         
                                     
                 

                                        

                  












                                                                             

                               










































                                                                             
                





















                                                                             


                                                               
                         
                           

                 



                                                                           


                 



                                                                       
                 
                    

                 




                                                                           

                                                                           

                                                                   
                  


                        
                                                               
 




                                                                            



                          
                                        

                                                         


                                                                         





                       




                                            

                    
                                                                  




                                                            







                                                                             
 

                                                                         

























                                                                        

                                        

                
 




                                                   


                                                          
                
 



                                                    

                                                                          
                
 



                                                             




                                                                      



                                                        

                                                            
                
 



                                                        

                                                        
                
 



                                                        


                                                         
                
 



                                                          

                                                                           




                    


















                                                                           

               

                                                        
 
                                                                                               





                                                                       


































                                                                             

               


                                       




                                                     



























                                                                            
 















                                                                             
 


                                                                             
 























                                                                              
 

                                                                 
 




                                                                              
 

                                                                    
 
                                                            



                                                          















                                                                             




                               




                                             

                    





                                                                          

                    
                                                                          




                                       




                                                                           
 





                                                                              

           




















                                                                             


                                      
                                                                           
 















                                                                          
 


                                                                        
 
                                          



                                               
                                                         
 

                                                                           
 
                                                           
 



                                                                            


            
                                                                
 



                                                                             
 
                                                                                                                 
 

                                                              
 











                                                                              
 







                                                                             
 


                                                                            
 
                                                                       





                                                               










                                                                             
                                                                       


                                                                         
 
                                                                           




                                                                            
            
 











                                                                         

                           
                                           






                                            


                                                                      


                   




































                                                                              


                   

                  



                                        


                                                                      


                   

                                                                            
 
                                                          



                                                          















                                                                              


                   
                  
                  

                                                       

                                                                        


                   




















                                                                              

                                                                     





















                                                                              



                                               




                                                                             
 

                                                                
 
                                              
 






                                                                                                
    


                                                                    
 

                                                                       
 



                                                                            




                                                                      







                                                                          


                   



                                                                          


                   
















                                                                            


                                                                                                                        











                                                                           





                                              






                                                                          





                            
                                     
 

                                                                             

                            
                                      
                 

                                            

                  





                                                                            

                    












                                                                         


                                                    






                                                                             

                    










                                                                           

                     

                                                                         
 
                                  





                                                             




                                                                            
 
                                                               




                                                                           
































                                                                              


                            
                                           
 







                                                                            

                                                   




























                                                                                             


                                                                                                


                                                                             

            


                                                                              

             




                                                                            

                    






                                                                            


                   




                                                                            





                        































                                                                             




                                                                             

                                                                       

















                                                                                              
                                                  

                                                     











                                                                            




                                                                                                  
                                                                        












                                                                  






                                                                           

                                                                   

























                                                                                         













                                                                                                                      




                                                


                    
                                                        
 

                                                                            


                  



                                                                            


                 


                                                                             


                   






                                                                          
 



                                                                         
 


                                                                             



                                                                         


                                                                           






                                                                  








                                                                             
                                                                      












                                                                              


                          



























                                                                            



                                         





                                                                             



                                                                   





                                                                   


                                                                                          

                                                                            

                                         







                                                                              
 

                                                                        

















                                                          




                                                                          



                        






                                              

                
                                                      
 







                                                                            


               






                                                                           

             
            





                                                                       




                                                                  



                                                                             


                                                               
                                                           


                                                                                                 








                                                                            


             

                                                                            




                                                                        







                                                                           


             

                                                                       







                                                                                               




                                                                        


             







                                                                             




                                                                                     





                                                                       


             











                                                                          


                











                                                                           







                                     
                                            


                    
                                                          




                                         












                                                                              
                                                                        

                                                                              



                             












                                                                              
                                             


                                                                             


                                                                







                                                                            






                                                                        



                                                                             












                                                                















                                                                             








                                              






                                                                              







                                                              




                                                                            

            








                                                                           





                             


                                                                     

                    




















                                                                     

                     




                                                                           
 






                                                                             


                                                                







                                                                              


                     
                                                        


                      



                                                                          


                     
                                                        


                      







                                                                              

            








                                                                             


                                                 








                                                                         


                     
                                                        


                      




                                                                             

            

                               
 

                                                                        
                              

               
                                                                            



                                                                             
                                                                         


                                                                           
                                                                       
                        

                
                                                                             
                                                      


                                                                          
 
                                                                  
 
                                               
                                                                         
                                                                          
                                                                              





                                                                           


                     
                                                        


                      








                                                                              
                                                  



                                                                            


                     
                                                        


                      



                                                                        


                     
                                                        


                      
                                                 
                                                                              



                                                                             


                     
                                                        


                      
                                                                             

                                                                  
                                                                



                                                                             
                                                                        
                                                                            
                                


                     
                                                        


                      
                                                                         

                                                                              
                                                                           
                           








                                     
                                                


                    
                                               




                                  








                                                                             


                  
                                                                 
                                                           

                                                              


                 


                                                                           


                 

                                                                          


                 

                                                                            


                   









                                                                            


                                                                                







                                                                              


                                                                                                     



                                                                          






                                                                    






                                                                            


                                                                          


                                                                







                                     
                                                


                    
                                              




                                 
















                                                                             


                                                                               




                                                                              
 

                                                                            
 


                                                                          




                                        


                                                                             




                                        


                                                                     




                          
                                                                    





                                            


                                                                             














                                            
                       






                                                            
<?xml version="1.0" encoding="ISO-8859-7" standalone="no"?>
<!--

     FreeBSD:  

  The FreeBSD Greek Documentation Project

  $FreeBSD$

  %SOURCE%	en_US.ISO8859-1/books/handbook/mail/chapter.sgml
  %SRCID%	1.142

-->

<chapter id="mail">
  <chapterinfo>
    <authorgroup>
      <author>
	<firstname>Bill</firstname>
	<surname>Lloyd</surname>
	<contrib>    </contrib>
      </author>
    </authorgroup>
    <authorgroup>
      <author>
	<firstname>Jim</firstname>
	<surname>Mock</surname>
	<contrib>    </contrib>
	<!-- 2 Dec 1999 -->
      </author>
    </authorgroup>
  </chapterinfo>

  <title> </title>

  <sect1 id="mail-synopsis">
    <title></title>
    <indexterm><primary>email</primary></indexterm>

    <para> <quote> </quote>,   
      email,          
      .         
         email  &os;,     
          email  &os;.     
          ,     
              .    
        ,      
          <xref linkend="bibliography"/>.</para>

    <para>    ,  :</para>

    <itemizedlist>
      <listitem>
	<para>       
	   .</para>
      </listitem>

      <listitem>
	<para>       <application>
	  sendmail</application>  &os;.</para>
      </listitem>

      <listitem>
	<para>      
	   (mailboxes).</para>
      </listitem>

      <listitem>
	<para>    spammers   
	       email 
	  .</para>
      </listitem>

      <listitem>
	<para>       
	     (Mail Transfer Agent) 
	   ,   
	  <application>sendmail</application>.</para>
      </listitem>

      <listitem>
	<para>     
	   .</para>
      </listitem>

      <listitem>
	<para>    SMTP   UUCP.</para>
      </listitem>

      <listitem>
	<para>         email.</para>
      </listitem>

      <listitem>
	<para>    email   (dialup)
	  .</para>
      </listitem>

      <listitem>
	<para>      SMTP 
	   .</para>
      </listitem>

      <listitem>
	<para>       
	     email  ,  
	  <application>mutt</application>.</para>
      </listitem>

      <listitem>
	<para>    email     
	  <acronym>POP</acronym>  <acronym>IMAP</acronym>.</para>
      </listitem>

      <listitem>
	<para>       
	   ,   .</para>
      </listitem>
    </itemizedlist>

    <para>    ,  :</para>

    <itemizedlist>
      <listitem>
	<para>       
	  (<xref linkend="advanced-networking"/>).</para>
      </listitem>

      <listitem>
	<para>     DNS   
	    (<xref linkend="network-servers"/>).</para>
      </listitem>

      <listitem>
	<para>       
	   (<xref linkend="ports"/>).</para></listitem>
    </itemizedlist>
  </sect1>

  <sect1 id="mail-using">
    <title>   </title>
    <indexterm><primary>POP</primary></indexterm>
    <indexterm><primary>IMAP</primary></indexterm>
    <indexterm><primary>DNS</primary></indexterm>

    <para>    ,  
       :  <link linkend="mail-mua"> </link>,
       <link linkend="mail-mta">  </link>,  <link
	linkend="mail-dns">DNS</link>,  <link
	linkend="mail-receive">    
	(mailbox)</link> 
        <link linkend="mail-host">   
      email (mailhost)</link>.</para>

    <sect2 id="mail-mua">
      <title>  </title>

      <para>      
	<application>mutt</application>,
	<application>alpine</application>, <application>elm</application>,
	 <command>mail</command>,     
	<acronym>GUI</acronym>   
	<application>balsa</application>,
	<application>xfmail</application> (   
	)   
	<quote></quote>       WWW.
	  ,     
	  <link linkend="mail-host"><quote>mailhost</quote></link>,
	     <link linkend="mail-mta"> 
	</link>   ,   
	  <acronym>TCP</acronym>.</para>
    </sect2>

    <sect2 id="mail-mta">
      <title>  Mailhost</title>
      <indexterm>
	<primary>mail server daemons</primary>
	<secondary><application>sendmail</application></secondary>
      </indexterm>
      <indexterm>
	<primary>mail server daemons</primary>
	<secondary><application>postfix</application></secondary>
      </indexterm>
      <indexterm>
	<primary>mail server daemons</primary>
	<secondary><application>qmail</application></secondary>
      </indexterm>
      <indexterm>
	<primary>mail server daemons</primary>
	<secondary><application>exim</application></secondary>
      </indexterm>

      <para> &os;    <application>sendmail</application>
	  ,     
	    , 
	 :</para>

      <itemizedlist>
	<listitem>
	  <para><application>exim</application></para>
	</listitem>

	<listitem>
	  <para><application>postfix</application></para>
	</listitem>

	<listitem>
	  <para><application>qmail</application></para>
	</listitem>
      </itemizedlist>

      <para>     &mdash;  
	   mail,      
	 mail.  , <emphasis> </emphasis>  
	   mail      
	<acronym>POP</acronym>  <acronym>IMAP</acronym>    
	 ,       
	 <filename>mbox</filename>  Maildir.    
	  <link linkend="mail-receive"></link> 
	  .</para>

      <warning>
	<para>   <application>sendmail</application>
	      ,    
	        
	     .      
	  ,      .
	  ,     
	  <acronym>MTA</acronym>   <link linkend="ports"> 
	  Ports  &os;</link>.</para>
      </warning>
    </sect2>

    <sect2 id="mail-dns">
      <title>Email  DNS</title>

      <para>    (DNS)    , 
	<command>named</command>,      
	email.      email    site   , 
	        site  DNS,
	       email  
	 .        
	    email   
	.</para>

      <indexterm>
	<primary>MX record</primary>
      </indexterm>

      <para> <acronym>DNS</acronym>     
	    IP,     
	      
	,    MX.    MX (Mail Exchanger)
	   ( )   
	       (domain).   
	  MX       ,  email 
	    ,    
	   A        
	IP  .</para>

      <para>     MX   ,
	   &man.host.1;,   
	 :</para>

      <screen>&prompt.user; <userinput>host -t mx FreeBSD.org</userinput>
FreeBSD.org mail is handled (pri=10) by mx1.FreeBSD.org</screen>
    </sect2>

    <sect2 id="mail-receive">
      <title> Mail</title>
      <indexterm>
	<primary>email</primary>
	<secondary>receiving</secondary>
      </indexterm>

      <para> mailhost      mail   
	  .      mail     ,
	     
	<filename>mbox</filename> (    
	mail)    Maildir,       .
	     mail  ,    
	 ,    
	&man.mail.1;   <application>mutt</application>,    
	  ,    
	 <acronym>POP</acronym>   <acronym>IMAP</acronym>.
	        mail   ,
	    
	<acronym>POP</acronym>  <acronym>IMAP</acronym>.</para>

      <sect3 id="pop-and-imap">
	<title>     <acronym>POP</acronym>
	   <acronym>IMAP</acronym></title>

	<indexterm><primary>POP</primary></indexterm>
	<indexterm><primary>IMAP</primary></indexterm>
	<para>       ,
	         
	  <acronym>POP</acronym>  <acronym>IMAP</acronym>.   
	  ,        
	   ,   .     
	  (<acronym>POP</acronym>  <acronym>IMAP</acronym>) 
	        ,  
	  <acronym>IMAP</acronym>   , 
	      :</para>

	<itemizedlist>
	  <listitem>
	    <para> <acronym>IMAP</acronym>    
	         ,     
	      .</para>
	  </listitem>

	  <listitem>
	    <para> <acronym>IMAP</acronym>  
	      .</para>
	  </listitem>

	  <listitem>
	    <para> <acronym>IMAP</acronym>    
	          ,   
	            ,  
	         .     
	            ,
	             
	           .</para>
	  </listitem>
	</itemizedlist>

	<para>     <acronym>POP</acronym> 
	  <acronym>IMAP</acronym>      
	  :</para>

	<procedure>
	  <step>
	    <para>   <acronym>IMAP</acronym> 
	      <acronym>POP</acronym>      .
	         <acronym>POP</acronym> 
	      <acronym>IMAP</acronym>     
	       :</para>

	    <itemizedlist>
	      <listitem>
		<para><application>qpopper</application></para>
	      </listitem>

	      <listitem>
		<para><application>teapop</application></para>
	      </listitem>

	      <listitem>
		<para><application>imap-uw</application></para>
	      </listitem>

	      <listitem>
		<para><application>courier-imap</application></para>
	      </listitem>

	      <listitem>
		<para><application>dovecot</application></para>
	      </listitem>
	    </itemizedlist>
	  </step>

	  <step>
	    <para>   <acronym>POP</acronym> 
	      <acronym>IMAP</acronym>   ,    
	      Ports.</para>
	  </step>

	  <step>
	    <para> ,   
	      <filename>/etc/inetd.conf</filename>    
	       <acronym>POP</acronym> 
	      <acronym>IMAP</acronym>.</para>
	  </step>
	</procedure>

	<warning>
	  <para>       <acronym>POP</acronym>
	       <acronym>IMAP</acronym>   
	             .  
	            
	       ,      
	       &man.ssh.1; (tunneling)   
	    SSL.    tunneling    
	    <xref linkend="security-ssh-tunneling"/>   SSL 
	    <xref linkend="openssl"/>.</para>
	</warning>
      </sect3>

      <sect3 id="local">
	<title>    </title>

	<para>       
	      /
	  (<acronym>MUA</acronym>)     .
	         .. 
	  <application>mutt</application>   &man.mail.1;.</para>
      </sect3>
    </sect2>

    <sect2 id="mail-host">
      <title>  Mail</title>
      <indexterm><primary>mail host</primary></indexterm>

      <para> mail     
	       mail   
	,      .</para>
    </sect2>
  </sect1>

  <sect1 id="sendmail">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>Christopher</firstname>
	  <surname>Shumway</surname>
	  <contrib>  </contrib>
	</author>
      </authorgroup>
    </sect1info>
    <title>  <application>sendmail</application></title>

    <indexterm>
      <primary><application>sendmail</application></primary>
    </indexterm>

    <para> &man.sendmail.8;     
       (Mail Transfer Agent, MTA)  &os;.     
        email    Email 
      (Mail User Agents, <acronym>MUA</acronym>)     
       mailer      .  
      <application>sendmail</application>     
           mail       
       .</para>

    <para> <application>sendmail</application>   
       :</para>

    <indexterm>
      <primary><filename>/etc/mail/access</filename></primary>
    </indexterm>
    <indexterm>
      <primary><filename>/etc/mail/aliases</filename></primary>
    </indexterm>
    <indexterm>
      <primary><filename>/etc/mail/local-host-names</filename></primary>
    </indexterm>
    <indexterm>
      <primary><filename>/etc/mail/mailer.conf</filename></primary>
    </indexterm>
    <indexterm>
      <primary><filename>/etc/mail/mailertable</filename></primary>
    </indexterm>
    <indexterm>
      <primary><filename>/etc/mail/sendmail.cf</filename></primary>
    </indexterm>
    <indexterm>
      <primary><filename>/etc/mail/virtusertable</filename></primary>
    </indexterm>
    <informaltable frame="none" pgwide="1">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry> </entry>
	    <entry></entry>
	  </row>
	</thead>

	<tbody>
	  <row>
	    <entry>
	      <filename>/etc/mail/access</filename>
	    </entry>

	    <entry>    
	      <application>sendmail</application>.</entry>
	  </row>

	  <row>
	    <entry>
	      <filename>/etc/mail/aliases</filename>
	    </entry>

	    <entry> (aliases)    (Mailboxes)</entry>
	  </row>

	  <row>
	    <entry>
	      <filename>/etc/mail/local-host-names</filename>
	    </entry>

	    <entry>      
	      <application>sendmail</application>  mail</entry>
	  </row>

	  <row>
	    <entry>
	      <filename>/etc/mail/mailer.conf</filename>
	    </entry>

	    <entry>   mailer</entry>
	  </row>

	  <row>
	    <entry>
	      <filename>/etc/mail/mailertable</filename>
	    </entry>

	    <entry>   mailer</entry>
	  </row>

	  <row>
	    <entry>
	      <filename>/etc/mail/sendmail.cf</filename>
	    </entry>

	    <entry>    
	      <application>sendmail</application></entry>
	  </row>

	  <row>
	    <entry>
	      <filename>/etc/mail/virtusertable</filename>
	    </entry>

	    <entry>     (domains)</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <sect2>
      <title><filename>/etc/mail/access</filename></title>

      <para>       
	 IP      mail  
	  .        
	  <option>OK</option>, <option>REJECT</option>,
	<option>RELAY</option>        
	   <application>sendmail</application>  
	 .        
	 <option>OK</option>,      ,
	   email    ,  
	       .  
	      
	<option>REJECT</option>    
	     mail.     
	    <option>RELAY</option>,  
	   mail     
	 .</para>

      <example>
	<title>     
	  <application>sendmail</application></title>

	<programlisting>cyberspammer.com                550 We do not accept mail from spammers
FREE.STEALTH.MAILER@            550 We do not accept mail from spammers
another.source.of.spam          REJECT
okay.cyberspammer.com           OK
128.32                          RELAY</programlisting>
      </example>

      <para>      .   
	      ,   
	     .     ,
	        
	<application>sendmail</application>.     
	 ,   mail    
	        .
	      mail  
	   Internet, 
	<hostid>another.source.of.spam</hostid>.     
	   mail   
	<hostid role="fqdn">okay.cyberspammer.com</hostid>,   
	       
	<hostid role="domainname">cyberspammer.com</hostid>  
	.        ,
	      .   
	    (relaying) 
	     IP   
	<hostid>128.32</hostid>.    ,   
	mail    ,     
	  .</para>

      <para>     ,    
	  <command>make</command>  
	<filename>/etc/mail/</filename>     
	.</para>
    </sect2>

    <sect2>
      <title><filename>/etc/mail/aliases</filename></title>

      <para>     (aliases),    
	       ,
	    .     
	<filename>/etc/mail/aliases</filename>  :</para>

      <example>
	<title> Mail</title>

	<programlisting>root: localuser
ftp-bugs: joe,eric,paul
bit.bucket:  /dev/null
procmail: "|/usr/local/bin/procmail"</programlisting>
      </example>

      <para>     .      
	    - ,   
	     .    ,
	       <username>root</username> 
	     <username>localuser</username>.
	   ,       
	.         ,   
	    <username>localuser</username>.  
	     .    
	   <username>ftp-bugs</username>, 
	   ,  <username>joe</username>,
	<username>eric</username>  <username>paul</username>.  
	       
	   <email>user@example.com</email>.
	  ,        mail
	  ,    
	<filename>/dev/null</filename>.    ,
	     mail   .
	  ,      
	(standard input)  
	<filename>/usr/local/bin/procmail</filename>  
	&unix; pipe.</para>

      <para>       ,   
	   <command>make</command>  
	<filename>/etc/mail/</filename>,     
	.</para>
    </sect2>

    <sect2>
      <title><filename>/etc/mail/local-host-names</filename></title>

      <para>      ,   
	&man.sendmail.8;        .
	           
	   <application>sendmail</application>  
	mail.   ,     mail 
	  mail   
	<hostid role="domainname">example.com</hostid>    
	<hostid role="fqdn">mail.example.com</hostid>,  
	<filename>local-host-names</filename>    
	:</para>

      <programlisting>example.com
mail.example.com</programlisting>

      <para>      ,    
	  &man.sendmail.8;     .</para>
    </sect2>

    <sect2>
      <title><filename>/etc/mail/sendmail.cf</filename></title>

      <para> <filename>sendmail.cf</filename>    
	  <application>sendmail</application>.    
	    
	<application>sendmail</application>,    
	        
	  mail.       
	 ,       
	          .
	,         
	 mail.</para>

      <para>     <application>sendmail</application>
	       
	&man.m4.1;        
	<application>sendmail</application>.    ,
	  
	<filename>/usr/src/contrib/sendmail/cf/README</filename>.</para>

      <para>          ,  
	   <application>sendmail</application>.</para>
    </sect2>

    <sect2>
      <title><filename>/etc/mail/virtusertable</filename></title>

      <para>  <filename>virtusertable</filename> 
	 mail      .
	      , , 
	    <filename>/etc/mail/aliases</filename>,
	 .</para>

      <example>
	<title>  Mail  </title>

	<programlisting>root@example.com                root
postmaster@example.com          postmaster@noc.example.net
@example.com                    joe</programlisting>
      </example>

      <para>  ,      
	<hostid role="domainname">example.com</hostid>.    
	       ,    
	    .      ,
	  <email>root@example.com</email>   
	<username>root</username>.      
	<email>postmaster@example.com</email>  
	<username>postmaster</username>  
	<hostid role="fqdn">noc.example.net</hostid>.  ,   
	    
	<hostid role="domainname">example.com</hostid>,   
	 ,      mail 
	   <hostid role="domainname">example.com</hostid>.
	  ,       
	<username>joe</username>.</para>
    </sect2>
  </sect1>

  <sect1 id="mail-changingmta">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>Andrew</firstname>
	  <surname>Boothman</surname>
	  <contrib>   </contrib>
	</author>
      </authorgroup>
      <authorgroup>
	<author>
	  <firstname>Gregory</firstname>
	  <surname>Neil Shapiro</surname>
	  <contrib>     e-mails  
	      </contrib>
	</author>
      </authorgroup>
    </sect1info>
    <title>     (MTA)</title>
    <indexterm>
      <primary>email</primary>
      <secondary>change mta</secondary>
    </indexterm>

    <para>   ,  &os;   
      <application>sendmail</application>   
        (Mail Transfer Agent, MTA).    
              
      .</para>

    <para>        
          MTA   .    
                MTA, 
               
          mailer.  ,  &os;    
       .</para>

    <sect2>
      <title>  MTA</title>

      <para>  MTA   .     
	  <link linkend="ports">  Ports  &os;</link> 
	     .     
	  MTA   ,   
	      &os;.</para>

      <para>     MTA.    , 
	         
	,          
	 mail    
	<application>sendmail</application>    .   
	,         
	       ,  
	<filename>/usr/bin/sendmail</filename>.  ,  
	      mail  ,  
	-   .</para>

      <para>      MTA  ,
	      .</para>
    </sect2>

    <sect2 id="mail-disable-sendmail">
      <title>  <application>sendmail</application></title>

      <warning>
	<para>     () 
	  <application>sendmail</application>,    
	        mail.  
	       ,    ,
	        &man.periodic.8;,   
	     email,    .  
	          
	       <application>sendmail</application>.
	          
	  <application>sendmail</application>   
	  email    ,  mail  
	       
	  <application>sendmail</application>    
	  .</para>
      </warning>

      <para>    
	<application>sendmail</application>,   
	  , :</para>

      <programlisting>sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"</programlisting>

      <para> <filename>/etc/rc.conf.</filename></para>

      <para>       
	 <application>sendmail</application>    :</para>

      <programlisting>sendmail_enable="NO"</programlisting>

      <para> <filename>/etc/rc.conf</filename>.   
	     <application>sendmail</application>,
	     manual,
	&man.rc.sendmail.8;.</para>
    </sect2>

    <sect2>
      <title>    MTA   </title>

      <para>   MTA     ,   
	    <filename>/etc/rc.conf</filename>.  
	    
	<application>postfix</application>:</para>

      <screen>&prompt.root; echo '<replaceable>postfix</replaceable>_enable="YES"' &gt;&gt; /etc/rc.conf</screen>

      <para> MTA      .</para>
    </sect2>

    <sect2>
      <title>  <application>sendmail</application> 
	 Mailer </title>

      <para> <application>sendmail</application>    
	    &unix;,    
	      .     ,
	  MTA      
	<application>sendmail</application>.     
	  ,       
	 <quote></quote> 
	<application>sendmail</application>.</para>

      <para>   ,     mailer, 
	        
	    
	<application>sendmail</application>  
	<filename>/usr/bin/sendmail</filename>,   
	    mailer.  ,  &os; 
	    &man.mailwrapper.8;    
	    .</para>

      <para>  <application>sendmail</application>   
	 ,       
	<filename>/etc/mail/mailer.conf</filename>:</para>

	<programlisting>sendmail	 /usr/libexec/sendmail/sendmail
send-mail	/usr/libexec/sendmail/sendmail
mailq		/usr/libexec/sendmail/sendmail
newaliases	/usr/libexec/sendmail/sendmail
hoststat	/usr/libexec/sendmail/sendmail
purgestat	/usr/libexec/sendmail/sendmail</programlisting>

      <para>        
	  (    <filename>sendmail</filename>),
	        mailwrapper
	  <filename>sendmail</filename>,     
	<filename>mailer.conf</filename>   
	<filename>/usr/libexec/sendmail/sendmail</filename>  .  
	        
	       
	  <filename>sendmail</filename>.</para>

      <para>,     
	<filename>/usr/local/supermailer/bin/sendmail-compat</filename>
	   <application>sendmail</application>,   
	  <filename>/etc/mail/mailer.conf</filename>  
	:</para>

      <programlisting>sendmail	 /usr/local/supermailer/bin/sendmail-compat
send-mail	/usr/local/supermailer/bin/sendmail-compat
mailq		/usr/local/supermailer/bin/mailq-compat
newaliases	/usr/local/supermailer/bin/newaliases-compat
hoststat	/usr/local/supermailer/bin/hoststat-compat
purgestat	/usr/local/supermailer/bin/purgestat-compat</programlisting>
    </sect2>

    <sect2>
      <title></title>

      <para>      ,  
	  kill   
	<application>sendmail</application>     
	       ,   
	 .        
	         ,
	    MTA      .</para>
    </sect2>
  </sect1>

  <sect1 id="mail-trouble">
    <title> </title>
    <indexterm>
      <primary>email</primary>
      <secondary>troubleshooting</secondary>
    </indexterm>

    <qandaset>
      <qandaentry>
	<question>
	  <para>       (FQDN) 
	         ;</para>
	</question>

	<answer>
	  <para>        
	         .  
	    ,   
	    <hostid role="fqdn">foo.bar.edu</hostid>   
	          
	    <hostid>mumble</hostid>   <hostid
	      role="domainname">bar.edu</hostid>,    
	          , <hostid
	      role="fqdn">mumble.bar.edu</hostid>,   
	    <hostid>mumble</hostid>.</para>

	  <indexterm><primary>BIND</primary></indexterm>
	  <para>,     DNS resolvers  BIND.
	    ,     <application>BIND</application> 
	      &os;,     
	    -  ,       .
	    ,    - 
	    <hostid>mumble</hostid>      <hostid
	      role="fqdn">mumble.foo.bar.edu</hostid>,    
	        .</para>

	  <para>       , 
	         <hostid
	      role="domainname">mumble.bar.edu</hostid>,   <hostid
	      role="domainname">mumble.edu</hostid>.     
	    RFC 1535         , 
	       .</para>

	  <para>         
	     :
	    <programlisting>search foo.bar.edu bar.edu</programlisting>
	       :
	    <programlisting>domain foo.bar.edu</programlisting>
	      <filename>/etc/resolv.conf</filename>.  
	             
	    <quote>     </quote>,
	        RFC 1535.</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question>
	  <indexterm>
	    <primary>MX record</primary>
	  </indexterm>

	  <para> <application>sendmail</application>   
	    <errorname>mail loops back to myself</errorname> ( mail
	       )</para>
	</question>

	<answer>
	  <para>   ,   FAQ 
	  <application>sendmail</application>   :</para>

	  <programlisting>    :

553 MX list for domain.net points back to relay.domain.net
554 &lt;user@domain.net&gt;... Local configuration error

     ;

   mail    (..  domain.net) 
     (  
 relay.domain.net)    MX,  
  (relay)      
domain.net.    domain.net  /etc/mail/local-host-names
[   /etc/sendmail.cw    8.10]
(   FEATURE(use_cw_file)),   
<quote>Cw domain.net</quote>  /etc/mail/sendmail.cf.</programlisting>

	  <para>    FAQ 
	    <application>sendmail</application>  
	    <ulink url="http://www.sendmail.org/faq/"></ulink>,  
	          <quote></quote> 
	      mail .</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question>
	  <indexterm><primary>PPP</primary></indexterm>

	  <para>     mail   
	        PPP;</para>
	</question>

	<answer>
	  <para>    &os;     
	    (LAN)  Internet.   &os;     
	      LAN.    PPP   .</para>

	  <indexterm><primary>UUCP</primary></indexterm>
	  <indexterm>
	    <primary>MX record</primary>
	  </indexterm>

	  <para>        .   
	        UUCP.</para>

	  <para>        Internet 
	       ,     
	    MX    .   ,     
	      <hostid role="domainname">example.com</hostid>  
	      Internet   
	    <hostid role="domainname">example.net</hostid>  
	      MX    :</para>

	  <programlisting>example.com.          MX        10      example.com.
                      MX        20      example.net.</programlisting>

	  <para>       
	     (  <literal>Cw example.com</literal> 
	     <filename>/etc/mail/sendmail.cf</filename> 
	    <hostid role="domainname">example.com</hostid>).</para>

	  <para>      
	    <command>sendmail</command>     mail 
	         
	    (<hostid role="domainname">example.com</hostid>)   
	    modem.          ,  
	         .  
	    <application>sendmail</application>     
	      MX, ..    Internet
	    (<hostid role="domainname">example.net</hostid>).   
	    MX          
	      mail    MX
	    (<hostid role="domainname">example.com</hostid>).</para>

	  <para>        script
	    :</para>

	  <programlisting>#!/bin/sh
# Put me in /usr/local/bin/pppmyisp
( sleep 60 ; /usr/sbin/sendmail -q ) &amp;
/usr/sbin/ppp -direct pppmyisp</programlisting>

	  <para>     script   
	     ,       
	     <command>sendmail -qRexample.com</command>  script.  
	           mail   
	     <hostid role="domainname">example.com</hostid>.</para>

	  <para>     
	    :</para>

	  <para>   &a.isp;.</para>

	  <programlisting>&gt;   MX   .     
&gt;       ,     email 
&gt;    MX (       email
&gt;    ).   sendmail     mailqueue  30 .
&gt;          30 ,
&gt;        email   
&gt;    MX.
&gt;
&gt;        sendmail  
&gt;   mails ;      
&gt; root   .

  <quote>privacy flags</quote>  sendmail.cf,  
 Opgoaway,restrictqrun

  restrictqrun     -root   
   .
       MX.    1 MX  
   ,   :

# If we are the best MX for a host, try directly instead of generating
# local config error.
OwTrue

   ,   site     ,
       .     
 .      <quote></quote>,  
           mail
<quote>customer.com</quote>  
<quote>hostname.customer.com</quote>  DNS.     
 A  DNS   <quote>customer.com</quote>.</programlisting>
	</answer>
      </qandaentry>

      <qandaentry>
	<question>
	  <para>     <errorname>Relaying
	    Denied</errorname>   mail  
	    ;</para>
	</question>

	<answer>
	  <para>    &os;, 
	    <application>sendmail</application>   
	     mail       .
	     ,    
	    <acronym>POP</acronym>,       
	    mail    ,  ,   
	    ,        
	      .  ,     
	    ,    email  
	    <application>MAILER-DAEMON</application>    
	    <errorname>5.7 Relaying Denied</errorname>.</para>

	  <para>       .
	             ISP  
	      relay-domains,
	    <filename>/etc/mail/relay-domains</filename>.   
	          :</para>

	  <screen>&prompt.root; <userinput>echo "your.isp.example.com" &gt; /etc/mail/relay-domains</userinput></screen>

	  <para>      , 
	       
	    <application>sendmail</application>.     
	           
	     mail ,      
	      point  click  
	           ISP.    
	             mail.
	          , 
	             
	    ,      ,   
	    :</para>

	  <programlisting>your.isp.example.com
other.isp.example.net
users-isp.example.org
www.example.org</programlisting>

	  <para>,   mail    
	          ( 
	            ), 
	     .        
	         mail    
	      ,      
	     SPAM    .</para>
	</answer>
      </qandaentry>
    </qandaset>
  </sect1>

  <sect1 id="mail-advanced">
    <title> </title>

    <para>      ,   
       mail      .</para>

    <sect2 id="mail-config">
      <title> </title>
      <indexterm>
	<primary>email</primary>
	<secondary>configuration</secondary>
      </indexterm>

      <para>      ,   
	 mail   ,    
	 <filename>/etc/resolv.conf</filename>     
	  DNS.      mail  
	     <application>sendmail</application> MTA,
	  :</para>

      <itemizedlist>
	<listitem>
	  <para>         
	    DNS    .   , <hostid
	      role="domainname">FreeBSD.org</hostid></para>
	</listitem>

	<listitem>
	  <para>  mail    .  
	       mail     ,
	        (    DNS).
	     ,
	    <hostid role="fqdn">example.FreeBSD.org</hostid>.</para>
	</listitem>
      </itemizedlist>

      <indexterm><primary>SMTP</primary></indexterm>
      <para>       ,    
	  mail    ,    
	   IP ( ,    
	  PPP).       firewall,
	      SMTP  .    
	 mail    ,   
	 <emphasis></emphasis>   :</para>

      <itemizedlist>
	<indexterm><primary>MX record</primary></indexterm>
	<listitem>
	  <para>     MX (   )
	     DNS ,     IP 
	     .</para>
	</listitem>

	<listitem>
	  <para>       MX  DNS 
	      .</para>
	</listitem>
      </itemizedlist>

      <para>      ,    
	mail    .</para>

      <para> :</para>

      <screen>&prompt.root; <userinput>hostname</userinput>
example.FreeBSD.org
&prompt.root; <userinput>host example.FreeBSD.org</userinput>
example.FreeBSD.org has address 204.216.27.XX</screen>

      <para>   ,  mail    
	<email role="nolink">yourlogin@example.FreeBSD.org</email>  
	    (  
	<application>sendmail</application>    
	<hostid role="fqdn">example.FreeBSD.org</hostid>).</para>

      <para>        :</para>

      <screen>&prompt.root; <userinput>host example.FreeBSD.org</userinput>
example.FreeBSD.org has address 204.216.27.XX
example.FreeBSD.org mail is handled (pri=10) by hub.FreeBSD.org</screen>

      <para>  mail       (<hostid
	  role="fqdn">example.FreeBSD.org</hostid>)   
	  <hostid>hub</hostid>     ,  
	    .</para>

      <para>  ,      
	DNS.    DNS       
	mail,   <emphasis>M</emphasis>ail e<emphasis>X</emphasis>change.
	    MX,  mail    
	   IP  .</para>

      <para>  MX   <hostid
	  role="fqdn">freefall.FreeBSD.org</hostid>    
	 :</para>

      <programlisting>freefall        MX   30   mail.crl.net
freefall        MX   40   agora.rdrop.com
freefall        MX   10   freefall.FreeBSD.org
freefall        MX   20   who.cdrom.com</programlisting>

      <para>   ,  <hostid>freefall</hostid>  
	 MX.       ,  
	    mail ,   .
	      ,   ( 
	  <quote>backup MXes</quote>)   
	        
	,   .     
	     .</para>

      <para>   MX,    
	        Internet.   
	  .         site, 
	         .</para>
    </sect2>

    <sect2 id="mail-domain">
      <title>Mail    </title>

      <para>    <quote>mailhost</quote> (. 
	 mail)    mail   
	 ,    .     
	<quote></quote>  mail   
	      (   
	<hostid role="fqdn">*.FreeBSD.org</hostid>)    
	   mail,        
	 mail     .</para>

      <indexterm><primary>DNS</primary></indexterm>
      <para> ,          
	<emphasis> </emphasis>    .
	       &man.adduser.8;.</para>

      <para> mailhost   ,     
	         
	.      DNS   
	:</para>

      <programlisting>example.FreeBSD.org        A      204.216.27.XX		; Workstation
                           MX  10 hub.FreeBSD.org	   ; Mailhost</programlisting>

      <para>   ,  mail     
	     mailhost,     
	   .   mail     MX.</para>

      <para>     ,      
	 DNS.     ,     
	,      (ISP)    
	  DNS.</para>

      <para>    ,  
	    .     , 
	         ,  
	  <hostid role="domainname">customer1.org</hostid>,  
	  mail   <hostid role="domainname">customer1.org</hostid>
	     mailhost, <hostid
	  role="fqdn">mail.myhost.com</hostid>.      DNS 
	   :</para>

      <programlisting>customer1.org		MX	10	mail.myhost.com</programlisting>

      <para>  <emphasis> </emphasis>   
	  <hostid role="domainname">customer1.org</hostid>  
	   email    .</para>

      <note>
	<para>          ping  <hostid
	    role="domainname">customer1.org</hostid>     
	    .</para>
      </note>

      <para>      ,    
	<application>sendmail</application>     
	mailhost,     /     mail.
	       .   
	    :</para>

      <itemizedlist>
	<listitem>
	  <para>    
	  <filename>/etc/mail/local-host-names</filename>  
	    <literal>FEATURE(use_cw_file)</literal>.
	      
	  <application>sendmail</application>   8.10,   
	   <filename>/etc/sendmail.cw</filename>.</para>
	</listitem>

	<listitem>
	  <para>   <literal>Cwyour.host.com</literal> 
	      <filename>/etc/sendmail.cf</filename>   
	    <filename>/etc/mail/sendmail.cf</filename>  
	      8.10  <application>sendmail</application>  
	    .</para>
	</listitem>
      </itemizedlist>
    </sect2>
  </sect1>

  <sect1 id="SMTP-UUCP">
  <title>SMTP  UUCP</title>

    <para>    <application>sendmail</application>
          &os;,      
         Internet.     
         email  UUCP,    
          
      <application>sendmail</application>.</para>

    <para>    
      <filename>/etc/mail/sendmail.cf</filename>   
      .    8  <application>sendmail</application> 
           &man.m4.1;,   
           .     
        &man.m4.1;  
      <filename>/usr/share/sendmail/cf</filename>.   
      <filename>README</filename>   <filename>cf</filename>
             &man.m4.1;.</para>

    <para>      mail   UUCP,  
          <literal>mailertable</literal>.   
                
      <application>sendmail</application>     
        .</para>

    <para>      
      <filename>.mc</filename>.       
      <filename>/usr/share/sendmail/cf/cf</filename>.
            
      <filename>foo.mc</filename>,        
            <filename>sendmail.cf</filename>
      :</para>

    <screen>&prompt.root; <userinput>cd /etc/mail</userinput>
&prompt.root; <userinput>make foo.cf</userinput>
&prompt.root; <userinput>cp foo.cf /etc/mail/sendmail.cf</userinput></screen>

    <para>   <filename>.mc</filename>    
      :</para>

    <programlisting>VERSIONID(`<replaceable>Your version number</replaceable>') OSTYPE(bsd4.4)

FEATURE(accept_unresolvable_domains)
FEATURE(nocanonify)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')

define(`UUCP_RELAY', <replaceable>your.uucp.relay</replaceable>)
define(`UUCP_MAX_SIZE', 200000)
define(`confDONT_PROBE_INTERFACES')

MAILER(local)
MAILER(smtp)
MAILER(uucp)

Cw    <replaceable>your.alias.host.name</replaceable>
Cw    <replaceable>youruucpnodename.UUCP</replaceable></programlisting>

    <para>     
      <literal>accept_unresolvable_domains</literal>,
      <literal>nocanonify</literal>, and
      <literal>confDONT_PROBE_INTERFACES</literal>    
       DNS     mail.   
      <literal>UUCP_RELAY</literal>     
        UUCP.        
      Internet       - .UUCP.
               (relay)  mail
         ISP .</para>

    <para>   ,    
      <filename>/etc/mail/mailertable</filename>.      
                mail,  
        :</para>

    <programlisting>#
# makemap hash /etc/mail/mailertable.db &lt; /etc/mail/mailertable
.                             uucp-dom:<replaceable>your.uucp.relay</replaceable></programlisting>

    <para>        :</para>

    <programlisting>#
# makemap hash /etc/mail/mailertable.db &lt; /etc/mail/mailertable
#
horus.interface-business.de   uucp-dom:horus
.interface-business.de        uucp-dom:if-bus
interface-business.de         uucp-dom:if-bus
.heep.sax.de                  smtp8:%1
horus.UUCP                    uucp-dom:horus
if-bus.UUCP                   uucp-dom:if-bus
.                             uucp-dom:</programlisting>


    <para>      ,  
      mail           
       ,      UUCP
        <quote></quote>   .
           mail     Ethernet,
            SMTP.  ,   UUCP
         - UUCP     
      <literal><replaceable>uucp-neighbor
      </replaceable>!<replaceable>recipient</replaceable></literal>
          .     
         ,      , 
       UUCP    UUCP      
      mail    .      
         <literal>uucp-dom:</literal>    
       UUCP ,     
       <literal>uuname</literal>.</para>

    <para>          
        DBM  .      
                
        <filename>mailertable</filename>.    
               
      <filename>mailertable</filename>.</para>

    <para>  :        
          mail,   
      <option>-bt</option>  <application>sendmail</application>.  
        <application>sendmail</application> 
      <emphasis>  </emphasis>.   
      <literal>3,0</literal>,       
         mail.        
        mail  ,   
         ,    ( ) .
            , 
      <keycombo action="simul"><keycap>Ctrl</keycap><keycap>D</keycap></keycombo>.</para>

    <screen>&prompt.user; <userinput>sendmail -bt</userinput>
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter &lt;ruleset&gt; &lt;address&gt;
<prompt>&gt;</prompt> <userinput>3,0 foo@example.com</userinput>
canonify           input: foo @ example . com
...
parse            returns: $# uucp-dom $@ <replaceable>your.uucp.relay</replaceable> $: foo &lt; @ example . com . &gt;
<prompt>&gt;</prompt> <userinput>^D</userinput></screen>
  </sect1>

  <sect1 id="outgoing-only">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>Bill</firstname>
	  <surname>Moran</surname>
	  <contrib>   </contrib>
	</author>
      </authorgroup>
    </sect1info>

    <title>    </title>

    <para>  ,       
      mail   .   :</para>

    <itemizedlist>
      <listitem>
	<para>     desktop,   
	      &man.send-pr.1;.    
	         mail  
	   ISP .</para>
      </listitem>

      <listitem>
	<para>         
	  mail ,      '   
	    .</para>
      </listitem>
    </itemizedlist>

    <para>  <acronym>MTA</acronym>    
        .  ,      
          <acronym>MTA</acronym>   
        mail  .    
      <application>sendmail</application>  
      <application>postfix</application>     
       .</para>

    <para>,     
        Internet,        
            
      <quote> mail</quote>.</para>

    <para>         
         port <filename role="package">mail/ssmtp</filename>
           <username>root</username>:</para>

    <screen>&prompt.root; <userinput>cd /usr/ports/mail/ssmtp</userinput>
&prompt.root; <userinput>make install replace clean</userinput></screen>

    <para>  , 
      <filename role="package">mail/ssmtp</filename>    
          ,    
      <filename>/usr/local/etc/ssmtp/ssmtp.conf</filename>:</para>

    <programlisting>root=yourrealemail@example.com
mailhub=mail.example.com
rewriteDomain=example.com
hostname=_HOSTNAME_</programlisting>

    <para>      email 
       <username>root</username>.     mail  ISP 
        <hostid role="fqdn">mail.example.com</hostid> ( ISP 
       <quote>  </quote> 
      <quote> SMTP</quote>).</para>

    <para>     
      <application>sendmail</application>,     
      .   
      <xref linkend="mail-disable-sendmail"/>  .</para>

    <para>     
      <filename role="package">mail/ssmtp</filename>.     
         <filename>/usr/local/etc/ssmtp</filename>  
       manual  <application>ssmtp</application>  
        .</para>

    <para>  <application>ssmtp</application>    ,
              
            mail.    
              ISP     
               
        (spam).</para>
  </sect1>

  <sect1 id="SMTP-dialup">
    <title>  Mail   (Dialup) </title>

    <para>    IP,      
        .         
               Internet,  
      <application>sendmail</application>    .</para>

    <para>   IP    PPP 
        Internet,      (mailbox)
        mail   .       
      ISP   <hostid role="domainname">example.net</hostid>,  
           <username>user</username>,   
       <hostid role="fqdn">bsd.home</hostid>,   ISP ,  
           
      <hostid role="fqdn">relay.example.net</hostid>   
       mail.</para>

    <para>     mail    ,  
         (retrieval agent).    
      <application>fetchmail</application>    , 
         .     
              Ports
      (<filename role="package">mail/fetchmail</filename>).  , 
      <acronym>ISP</acronym>     
      <acronym>POP</acronym>.    <acronym>PPP</acronym>
      ,      mail   
         ,    
       <filename>/etc/ppp/ppp.linkup</filename>:</para>

    <programlisting>MYADDR:
!bg su user -c fetchmail</programlisting>

    <para>   <application>sendmail</application> (
       )    mail  - ,
          <application>sendmail</application> 
          mail     
      .      ,      
        <command>fetchmail</command>  
      <filename>/etc/ppp/ppp.linkup</filename>:</para>

    <programlisting>  !bg su user -c "sendmail -q"</programlisting>

    <para>       
      <username>user</username>  <hostid
	role="fqdn">bsd.home</hostid>.     
      <username>user</username>  <hostid
	role="fqdn">bsd.home</hostid>,   
      <filename>.fetchmailrc</filename>:</para>

    <programlisting>poll example.net protocol pop3 fetchall pass MySecret</programlisting>

    <para>          , 
        <username>user</username>,    
      <literal>MySecret</literal>.</para>

    <para>     mail    
      <literal>from:</literal>,     
      <application>sendmail</application>   
      <email>user@example.net</email>   
      <email role="nolink">user@bsd.home</email>.      
        <application>sendmail</application>     mail
        <hostid role="fqdn">relay.example.net</hostid>,   
       mail   .</para>

    <para>   <filename>.mc</filename>    
      :</para>

    <programlisting>VERSIONID(`bsd.home.mc version 1.0')
OSTYPE(bsd4.4)dnl
FEATURE(nouucp)dnl
MAILER(local)dnl
MAILER(smtp)dnl
Cwlocalhost
Cwbsd.home
MASQUERADE_AS(`example.net')dnl
FEATURE(allmasquerade)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(nocanonify)dnl
FEATURE(nodns)dnl
define(`SMART_HOST', `relay.example.net')
Dmbsd.home
define(`confDOMAIN_NAME',`bsd.home')dnl
define(`confDELIVERY_MODE',`deferred')dnl</programlisting>

    <para>        
          <filename>.mc</filename>   
      <filename>sendmail.cf</filename>.  ,   
        <application>sendmail</application>  
        <filename>sendmail.cf</filename>.</para>
  </sect1>

  <sect1 id="SMTP-Auth">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>James</firstname>
	  <surname>Gorham</surname>
	  <contrib>   </contrib>
	</author>
      </authorgroup>
    </sect1info>

    <title>   SMTP</title>

    <para>  <acronym>SMTP</acronym>    
        ,       
      .         
      <application>sendmail</application>,      
             ( 
         )    
              
        /  .</para>

    <procedure>
      <step>
	<para> 
	  <filename role="package">security/cyrus-sasl2</filename>
	      Ports.   port 
	           
	   .       
	     SMTP   , 
	       <option>LOGIN</option>.</para>
      </step>

      <step>
	<para>   
	  <filename role="package">security/cyrus-sasl2</filename>,
	    
	  <filename>/usr/local/lib/sasl2/Sendmail.conf</filename>
	  (     )    
	  :</para>

	<programlisting>pwcheck_method: saslauthd</programlisting>
      </step>

      <step>
	<para>  
	  <filename role="package">security/cyrus-sasl2-saslauthd</filename>,
	     <filename>/etc/rc.conf</filename>  
	  :</para>

	<programlisting>saslauthd_enable="YES"</programlisting>

	<para>,    saslauthd:</para>

	<screen>&prompt.root; <userinput>/usr/local/etc/rc.d/saslauthd start</userinput></screen>

	<para>       
	  <application>sendmail</application>    
	       
	  <filename>passwd</filename>  &os;  .    
	           
	          
	     <acronym>SMTP</acronym>.
	       ,    
	  ,     mail.</para>
      </step>

      <step>
	<para>   <filename>/etc/make.conf</filename> 
	     :</para>

	<programlisting>SENDMAIL_CFLAGS=-I/usr/local/include/sasl -DSASL
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=-lsasl2</programlisting>

	<para>  ,  
	  <application>sendmail</application>    
	      
	  <filename role="package">cyrus-sasl2</filename>   
	   .       
	  <filename role="package">cyrus-sasl2</filename>  
	    
	  <application>sendmail</application>.</para>
      </step>

      <step>
	<para>  <application>sendmail</application>
	     :</para>

	<screen>&prompt.root; <userinput>cd /usr/src/lib/libsmutil</userinput>
&prompt.root; <userinput>make cleandir && make obj && make</userinput>
&prompt.root; <userinput>cd /usr/src/lib/libsm</userinput>
&prompt.root; <userinput>make cleandir && make obj && make</userinput>
&prompt.root; <userinput>cd /usr/src/usr.sbin/sendmail</userinput>
&prompt.root; <userinput>make cleandir && make obj && make && make install</userinput></screen>

	<para>   <application>sendmail</application> 
	     ,  
	  <filename>/usr/src</filename>      
	        
	  .</para>
      </step>

      <step>
	<para>     
	  <application>sendmail</application>,   
	  <filename>/etc/mail/freebsd.mc</filename> (  
	    <filename>.mc</filename>.   
	         &man.hostname.1;
	       <filename>.mc</filename>   
	    ).      
	  :</para>

	<programlisting>dnl set SASL options
TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl</programlisting>

	<para>       
	       <application>sendmail</application>,
	      .    
	       
	  <application>pwcheck</application>,    
	  .</para>
      </step>

      <step>
	<para>,  &man.make.1;    
	  <filename>/etc/mail</filename>.     , 
	      <filename>.mc</filename>  
	      <filename>.cf</filename>  
	  <filename>freebsd.cf</filename> (    
	    <filename>.mc</filename>).    
	   <command>make install restart</command>,   
	      <filename>sendmail.cf</filename>, 
	      <application>sendmail</application>.
	         , 
	      
	  <filename>/etc/mail/Makefile</filename>.</para>
      </step>
    </procedure>

    <para>   ,        
               
      mail,      .    
        ,   
      <option>LogLevel</option>  <application>sendmail</application> 
      13    <filename>/var/log/maillog</filename>
        .</para>

    <para>  ,      
      <application>sendmail</application>   
      <ulink url="http://www.sendmail.org/~ca/email/auth.html">
        <acronym>SMTP</acronym></ulink>.</para>
  </sect1>

  <sect1 id="mail-agents">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>Marc</firstname>
	  <surname>Silver</surname>
	  <contrib>  </contrib>
	</author>
      </authorgroup>
    </sect1info>
    <title>    </title>

    <indexterm>
      <primary>Mail User Agents</primary>
    </indexterm>

    <para>     (Mail User Agent,
      <acronym>MUA</acronym>),       
         email.  ,   email
      <quote></quote>    , 
      <acronym>MUA</acronym>        
          email.      
        .  To &os;     
        ,      
         <link
	linkend="ports">  Ports  &os;</link>.   
           ,  
      <application>evolution</application>  
      <application>balsa</application>,     
      <application>mutt</application>, <application>alpine</application>
       <command>mail</command>,      web  
         .</para>

    <sect2 id="mail-command">
      <title>mail</title>

      <para> &man.mail.1;     
	(<acronym>MUA</acronym>) in &os;.    
	<acronym>MUA</acronym> ,      
	        email
	  ,       
	      .</para>

      <para>   <command>mail</command>    
	 email   <acronym>POP</acronym> 
	<acronym>IMAP</acronym>,      
	email     (<filename>mbox</filename>) 
	    <application>fetchmail</application>, 
	        (<xref
	  linkend="mail-fetchmail"/>).</para>

      <para>     email,    
	<command>mail</command>     :</para>

      <screen>&prompt.user; <userinput>mail</userinput></screen>

      <para>       
	<filename class="directory">/var/mail</filename>  
	    <command>mail</command>.
	     ,    
	     .     
	,          
	.     ,   
	 :</para>

      <screen>Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/marcs": 3 messages 3 new
>N  1 root@localhost        Mon Mar  8 14:05  14/510   "test"
 N  2 root@localhost        Mon Mar  8 14:05  14/509   "user account"
 N  3 root@localhost        Mon Mar  8 14:05  14/509   "sample"</screen>

      <para>        
	<keycap>t</keycap>   <command>mail</command>, 
	    mail    .    
	    :</para>

      <screen>&amp; <userinput>t 1</userinput>
Message 1:
From root@localhost  Mon Mar  8 14:05:52 2004
X-Original-To: marcs@localhost
Delivered-To: marcs@localhost
To: marcs@localhost
Subject: test
Date: Mon,  8 Mar 2004 14:05:52 +0200 (SAST)
From: root@localhost (Charlie Root)

This is a test message, please reply if you receive it.</screen>

      <para>    ,    
	<keycap>t</keycap>       
	 .          ,
	   <keycap>h</keycap>.</para>

      <para>  mail  ,    
	 <command>mail</command>   
	 <keycap>R</keycap>  <keycap>r</keycap>.   
	<keycap>R</keycap>   <command>mail</command>  
	    ,   <keycap>r</keycap> 
	   ,       .
	        ,  
	      .     ,
	            
	   <keycap>.</keycap>    .   
	   :</para>

      <screen>&amp; <userinput>R 1</userinput>
To: root@localhost
Subject: Re: test

<userinput>Thank you, I did get your email.
.</userinput>
EOT</screen>

      <para>    mail,      
	<keycap>m</keycap>,      .
	    ,   
	   <keycap>,</keycap>.      
	        .    
	     <keycap>.</keycap>  
	 .</para>

      <screen>&amp; <userinput>mail root@localhost</userinput>
Subject: <userinput>I mastered mail

Now I can send and receive email using mail ... :)
.</userinput>
EOT</screen>

      <para>     <command>mail</command>, 
	    <keycap>?</keycap>   
	  .      
	 manual  &man.mail.1;    
	   <command>mail</command>.</para>

      <note>
	<para>  ,   &man.mail.1; 
	       ,    
	          .
	   <acronym>MUA</acronym>,  
	  <application>mutt</application>,     
	    .    '    
	     <command>mail</command>,  
	      port
	  <filename role="package">converters/mpack</filename>.</para>
      </note>
    </sect2>

    <sect2 id="mutt-command">
      <title>mutt</title>

      <para> <application>mutt</application>   , 
	      mail,  
	   :</para>

      <itemizedlist>
	<listitem>
	  <para>       
	    </para>
	</listitem>

	<listitem>
	  <para> PGP     
	    email</para>
	</listitem>

	<listitem>
	  <para> MIME</para>
	</listitem>

	<listitem>
	  <para> Maildir</para>
	</listitem>

	<listitem>
	  <para>  </para>
	</listitem>
      </itemizedlist>

      <para>   ,  
	<application>mutt</application>      
	 .     <ulink
	  url="http://www.mutt.org"></ulink>   
	   <application>mutt</application>.</para>

      <para>      
	<application>mutt</application>   port <filename
	  role="package">mail/mutt</filename>,      
	     port <filename
	  role="package">mail/mutt-devel</filename>.    
	 port,     <application>mutt</application>,
	   :</para>

      <screen>&prompt.user; <userinput>mutt</userinput></screen>

      <para> <application>mutt</application>    
	       <filename
	  class="directory">/var/mail</filename>,     
	    .     mails   
	,  <application>mutt</application>    
	 .    ,  
	<application>mutt</application>    
	:</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/mutt1" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>   email,     
	,   <keycap>Enter</keycap>.     
	  mail   <application>mutt</application>
	:</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/mutt2" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>   &man.mail.1;,  <application>mutt</application>,
	        ,  
	   .        
	email,   
	<keycap>r</keycap>.         
	    ,    
	  ,   
	<keycap>g</keycap>.</para>

      <note>
	<para> <application>mutt</application>  
	  &man.vi.1;        
	  email.          
	      
	  <filename>.muttrc</filename>    , 
	     <literal>editor</literal>,   
	    <envar>EDITOR</envar>.    
	  <ulink url="http://www.mutt.org/"></ulink>  
	       
	  <application>mutt</application>.</para>
      </note>

      <para>     ,   
	<keycap>m</keycap>.      , 
	<application>mutt</application>    &man.vi.1;
	     mail.   ,
	    <command>vi</command>  
	<application>mutt</application>  ,   
	   mail     .   
	  mail,    <keycap>y</keycap>.  
	       :</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/mutt3" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para> <application>mutt</application>   
	,          
	 ,    <keycap>?</keycap>.    
	       ,
	 .</para>
    </sect2>

    <sect2 id="alpine-command">
      <title>alpine</title>

      <para> <application>alpine</application>   
	 ,     
	.</para>

      <warning>
	<para> <application>alpine</application>   
	  .   ,     
	          
	   ,      email.
	     <emphasis></emphasis>   
	  ,     <application>alpine</application>
	       ,   
	    &os;,       
	          .
	    <application>alpine</application>   
	  .</para>
      </warning>

      <para>    <application>alpine</application>  
	   port <filename
	  role="package">mail/alpine</filename>.     
	port  <application>alpine</application>   
	   :</para>

      <screen>&prompt.user; <userinput>alpine</userinput></screen>

      <para>      
	<application>alpine</application>      
	,    ,      
	   <application>alpine</application>   
	  mail           
	    .      
	 ,  <keycap>Enter</keycap>,   
	<keycap>E</keycap>        
	   .      
	 :</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/pine1" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>     ,    
	    .     
	      mail, 
	   mail,     
	  .      , 
	        
	 .</para>

      <para>     
	<application>alpine</application>  
	<filename class="directory">inbox</filename>.     
	  ,   <keycap>I</keycap>,   
	<guimenuitem>MESSAGE INDEX</guimenuitem>  
	:</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/pine2" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>       
	,         .
	     ,   
	<keycap>Enter</keycap>.</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/pine3" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>    , 
	<application>alpine</application>    .
	       
	.     ,   
	<keycap>r</keycap>     <acronym>MUA</acronym> 
	       .</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/pine4" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>    mail   <application>alpine</application>
	      
	<application>pico</application>,    
	    <application>alpine</application>.
	 <application>pico</application>     
	,          
	   &man.vi.1;   &man.mail.1;.    
	,        
	<keycombo action="simul"><keycap>Ctrl</keycap><keycap>X</keycap>
	</keycombo>.   <application>alpine</application>    
	 .</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="mail/pine5" format="PNG"/>
	</imageobject>
      </mediaobject>

      <para>    <application>alpine</application>
	     <guimenuitem>SETUP</guimenuitem>   
	.     <ulink
	  url="http://www.washington.edu/alpine/"></ulink>  
	.</para>
    </sect2>
  </sect1>

  <sect1 id="mail-fetchmail">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>Marc</firstname>
	  <surname>Silver</surname>
	  <contrib>   </contrib>
	</author>
      </authorgroup>
    </sect1info>
    <title>  fetchmail</title>

    <indexterm>
      <primary>fetchmail</primary>
    </indexterm>

    <para> <application>fetchmail</application>    
       <acronym>IMAP</acronym>  <acronym>POP</acronym>,  
            mail  
       <acronym>IMAP</acronym>  <acronym>POP</acronym> 
           ,      
        .   <application>fetchmail</application>  
         port <filename
	role="package">mail/fetchmail</filename>   
      ,     :</para>

    <itemizedlist>
      <listitem>
	<para>   <acronym>POP3</acronym>,
	  <acronym>APOP</acronym>, <acronym>KPOP</acronym>,
	  <acronym>IMAP</acronym>, <acronym>ETRN</acronym> 
	  <acronym>ODMR</acronym>.</para>
      </listitem>

      <listitem>
	<para>  email  <acronym>SMTP</acronym>, 
	        , 
	  ,    (aliases).</para>
      </listitem>

      <listitem>
	<para>     ,   
	     .</para>
      </listitem>

      <listitem>
	<para>        , 
	     ,    .</para>
      </listitem>
    </itemizedlist>

    <para>           
          <application>fetchmail</application>, 
          .
       <application>fetchmail</application>   
         <filename>.fetchmailrc</filename>,  
       .        
             .   
          ,   
               
          :</para>

    <screen>&prompt.user; <userinput>chmod 600 .fetchmailrc</userinput></screen>

    <para> <filename>.fetchmailrc</filename>     
                
         <acronym>POP</acronym>.   
      <application>fetchmail</application>    <hostid
	role="fqdn">example.com</hostid>   
      <username>joesoap</username>   <literal>XXX</literal>.
            <username>joesoap</username> 
           .</para>

    <programlisting>poll example.com protocol pop3 username "joesoap" password "XXX"</programlisting>

    <para>  ,    
      <acronym>POP</acronym>  <acronym>IMAP</acronym> , 
            
      :</para>

    <programlisting>poll example.com proto pop3:
user "joesoap", with password "XXX", is "jsoap" here;
user "andrea", with password "XXXX";
poll example2.net proto imap:
user "john", with password "XXXXX", is "myth" here;</programlisting>

    <para>   <application>fetchmail</application> 
          ,      
      <option>-d</option>,     ( )
               
          <filename>.fetchmailrc</filename>.
           <application>fetchmail</application>
          mail  600 :</para>

    <screen>&prompt.user; <userinput>fetchmail -d 600</userinput></screen>

    <para>      
      <application>fetchmail</application>   <ulink
	url="http://fetchmail.berlios.de/"></ulink>.</para>
  </sect1>

  <sect1 id="mail-procmail">
    <sect1info>
      <authorgroup>
	<author>
	  <firstname>Marc</firstname>
	  <surname>Silver</surname>
	  <contrib>   </contrib>
	</author>
      </authorgroup>
    </sect1info>
    <title>  procmail</title>

    <indexterm>
      <primary>procmail</primary>
    </indexterm>

    <para>   <application>procmail</application> 
               
         mail.     
       <quote></quote>      
       mail     ,  
        mail     /  
      .   <application>procmail</application>  
         port <filename
	role="package">mail/procmail</filename>.     ,
           
      <acronym>MTA</acronym>.     
      <acronym>MTA</acronym>     .
      ,    
      <application>procmail</application>    
         <filename>.forward</filename>    ,
         
      <application>procmail</application>:</para>

    <programlisting>"|exec /usr/local/bin/procmail || exit 75"</programlisting>

    <para>  ,      
        <application>procmail</application>,   
         .      (
      )     <filename>.procmailrc</filename>,  
              :</para>

    <para>        , 
       manual  &man.procmailex.5;.</para>

    <para>   email  
      <email>user@example.com</email>   
       <email role="nolink">goodmail@example2.com</email>:</para>

    <programlisting>:0
* ^From.*user@example.com
! goodmail@example2.com</programlisting>

    <para>   email     1000 bytes  
        email <email
	role="nolink">goodmail@example2.com</email>:</para>

    <programlisting>:0
* &lt; 1000
! goodmail@example2.com</programlisting>

    <para>   mail    
      <email>alternate@example.com</email>     
      <filename>alternate</filename>:</para>

    <programlisting>:0
* ^TOalternate@example.com
alternate</programlisting>

    <para>   mail   <quote>Spam</quote>  
      <filename>/dev/null</filename>:</para>

    <programlisting>:0
^Subject:.*Spam
/dev/null</programlisting>

    <para>      email    
      <hostid role="domainname">&os;.org</hostid>    
         :</para>

    <programlisting>:0
* ^Sender:.owner-freebsd-\/[^@]+@FreeBSD.ORG
{
	LISTNAME=${MATCH}
	:0
	* LISTNAME??^\/[^@]+
	FreeBSD-${MATCH}
}</programlisting>
  </sect1>
</chapter>

<!--
     Local Variables:
     mode: sgml
     coding: iso-8859-7
     sgml-declaration: "../chapter.decl"
     sgml-indent-data: t
     sgml-omittag: nil
     sgml-always-quote-attributes: t
     sgml-parent-document: ("../book.sgml" "part" "chapter")
     End:
-->