Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 2002 02:45:50 +0100 (BST)
From:      Andrew Boothman <andrew@cream.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   docs/37121: [PATCH] New section and small changes to handbook mail chapter
Message-ID:  <200204160145.g3G1jo820518@dogma.freebsd-uk.eu.org>

next in thread | raw e-mail | index | archive | help

>Number:         37121
>Category:       docs
>Synopsis:       [PATCH] New section and small changes to handbook mail chapter
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 15 18:50:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Boothman
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD dogma 4.5-STABLE FreeBSD 4.5-STABLE #4: Thu Feb 7 16:13:48 GMT 2002 ip@karma:/usr/src/sys/compile/DOGMA i386


	
>Description:
Further to e-mails from Gregory Neil Shapiro, and sort of related to
PR docs/36727 here is a new section for the Electronic Mail chapter of
the Handbook. The patch also adds a new entry to the list on the first
page of the chapter and removes the section about mailer.conf from
the sendmail configuration page, which is more correctly covered in
the new section.

Please read over to make sure there aren't any stupid mistakes! I think
it's the first time I've made such a large submission. Also, there seems
to be a problem with the second-to-last programlisting where the
second column of first line of the second column of text doesn't seem to
line up. I'd appricate it if someone would look at that before commiting.

Thanks.

(An earlier version of this patch has been checked by Gregory)
>How-To-Repeat:
	
View handbook's mail chapter.
>Fix:

	

--- chapter.sgml.diff begins here ---
--- chapter.sgml.orig	Thu Feb 14 22:30:59 2002
+++ chapter.sgml	Tue Apr 16 02:29:56 2002
@@ -49,6 +49,9 @@
       <listitem><para>How to block spammers from illegally using your
       mail server as a relay.</para>
       </listitem>
+      <listitem><para>How to replace <application>sendmail</application>
+      as your system's default mailer.</para>
+      </listitem>
       <listitem><para>How to troubleshoot common mail server
       problems.</para></listitem>
     </itemizedlist>
@@ -406,22 +409,7 @@
     restarted for it to read the changes.</para>
     
   </sect2>
-  <sect2>
-    <title><filename>/etc/mail/mailer.conf</filename></title>
 
-    <para>The <filename>mailer.conf</filename> configuration file
-      holds a table containing the real mailer that is used for the
-      given action.  Very old software programs would hard-code in the
-      name and path to the mailer,
-      <filename>/usr/sbin/sendmail</filename>, which meant they where
-      incompatible with other mailers such as postfix.  Today,
-      <filename>/usr/sbin/sendmail</filename> is a wrapper that looks
-      at <filename>/etc/mail/mailer.conf</filename> and executes the
-      correct binary.  When another mail transfer agent is installed
-      on the system, <filename>mailer.conf</filename> should be
-      updated to reflect the correct programs to execute.</para>
-
-  </sect2>
   <sect2>
     <title><filename>/etc/mail/sendmail.cf</filename></title>
 
@@ -475,6 +463,225 @@
 
   </sect2>
   </sect1>
+
+  <sect1 id="mail-changingmta">
+    <sect1info>
+      <authorgroup>
+        <author>
+          <firstname>Andrew</firstname>
+          <surname>Boothman</surname>
+          <contrib>Written by </contrib>
+        </author>
+      </authorgroup>
+      <authorgroup>
+        <author>
+          <firstname>Gregory</firstname>
+          <surname>Neil Shapiro</surname>
+          <contrib>Information taken from e-mails written by </contrib>
+        </author>
+      </authorgroup>
+    </sect1info>
+    <title>Changing your MTA</title>
+    <indexterm>
+      <primary>email</primary>
+      <secondary>change mta</secondary>
+    </indexterm>
+    
+    <para>As already mentioned, FreeBSD comes with 
+     <application>sendmail</application> already installed as your 
+     MTA (Mail Transfer Agent).  Therefore by default it is 
+     in charge of your outgoing and incoming mail.</para>
+
+    <para>However, for a variety of reasons, some system 
+     administrators want to change their system's MTA.  These 
+     reasons range from simply wanting to try out another MTA to 
+     needing a specific feature or package which relies on another
+     mailer.  Fortunately, whatever the reason, FreeBSD makes it 
+     easy to make the change.</para>
+
+    <sect2>
+      <title>Install new MTA</title>
+
+      <para>You have a wide choice of MTAs available to you.  A good 
+       starting point is the 
+       <link linkend="ports">FreeBSD Ports Collection</link> where
+       you will be able to find many.  Of course you are free to use 
+       any MTA you want from any location, as long as you can make 
+       it run under FreeBSD.</para>
+
+      <para>Start by installing your new MTA.  Once it is installed 
+       it gives you a chance to decide if it really fulfills your 
+       needs, and also gives you the opportunity to configure your 
+       new software before getting it to take over from 
+       <application>sendmail</application>.  When doing this, you 
+       should insure that installing the new software won't attempt 
+       to overwrite system binaries such as
+       <filename>/usr/bin/sendmail</filename>.  Otherwise, your new 
+       mail software has essentially been put into service before 
+       you have configured it.</para>
+
+      <para>Please refer to your chosen MTA's documentation for 
+       information on how to configure the software you have 
+       chosen.</para>
+    </sect2>
+
+    <sect2>
+      <title>Disable <application>sendmail</application></title>
+
+      <para>The procedure used to start 
+       <application>sendmail</application> changed significantly 
+       between 4.5-RELEASE and 4.6-RELEASE.  Therefore, the procedure 
+       used to disable it is subtly different.</para>
+      <sect3>
+        <title>FreeBSD 4.5-STABLE before 2002/4/4 and earlier 
+         (including 4.5-RELEASE and earlier)</title>
+
+        <para>Enter 
+         <programlisting>sendmail_enable="NO"</programlisting> into
+         <filename>/etc/rc.conf</filename>.  This will disable 
+         <application>sendmail</application>'s incoming mail service, 
+         but if <filename>/etc/mail/mailer.conf</filename> (see below)
+         is not changed, <application>sendmail</application> will 
+         still be used to send e-mail.</para>
+      </sect3>
+
+      <sect3>
+        <title>FreeBSD 4.5-STABLE after 2002/4/4 
+         (including 4.6-RELEASE and later)</title>
+
+        <para>In order to completely disable 
+         <application>sendmail</application> you must use 
+         <programlisting>sendmail_enable="NONE"</programlisting> in 
+         <filename>/etc/rc.conf</filename></para>
+        
+        <warning>
+          <para>If you disable <application>sendmail</application>'s 
+           outgoing mail service in this way, it is important that you 
+           replace it with a fully working alternative mail delivery 
+           system.  If you choose not to, system functions such as 
+           &man.periodic.8 will be unable to deliver their results by 
+           e-mail as they would normally expect to.  Many parts of your 
+           system may expect to have a functional 
+           <application>sendmail</application>-compatible system.  If 
+           applications continue to use 
+           <application>sendmail</application>'s binaries to try and send 
+           e-mail after you have disabled it, the mail may transparently 
+           queue forever.</para>
+        </warning>
+
+        <para>If you only want to disable 
+         <application>sendmail</application>'s incoming mail service, 
+         you should set 
+         <programlisting>sendmail_enable="NO"</programlisting> in 
+         <filename>/etc/rc.conf</filename>.  More information on 
+         <application>sendmail</application>'s startup options is 
+         available from the &man.rc.sendmail.8 manual page.</para>
+      </sect3>
+    
+    <sect2>
+      <title>Running your new MTA on boot</title>
+      
+      <para>You may have a choice of two methods for running your 
+       new MTA on boot, again depending on what version of FreeBSD 
+       you are running.</para>
+
+      <sect3>
+        <title>FreeBSD 4.5-STABLE before 2002/4/11 
+         (including 4.5-RELEASE and earlier)</title>
+
+        <para>Add a script into 
+         <filename>/usr/local/etc/rc.d/</filename> that
+         ends in <filename>.sh</filename> and is executable by 
+         root.  The script should also accept the parameters 'start' 
+         or 'stop'.  So that you could, for example, execute 
+         <filename>/usr/local/etc/rc.d/supermailer.sh start</filename>
+         or <filename>/usr/local/etc/rc.d/supermailer.sh stop</filename>.  
+         The system will call your script using 'start' when the it 
+         boots and using 'stop' when the it shuts down.</para>
+         
+      </sect3>
+
+      <sect3>
+        <title>FreeBSD 4.5-STABLE after 2002/4/11 
+         (including 4.6-RELEASE and later)</title>
+
+        <para>With later versions of FreeBSD, you can use the 
+         above method or you can also set 
+         <programlisting>mta_start_script="<replaceable>filename</replaceable>"</programlisting>
+         in <filename>/etc/rc.conf</filename>, where 
+         <replaceable>filename</replaceable> is the name of some 
+         script that you want executed on boot to start your 
+         MTA.</para>
+      </sect3>
+
+    </sect2>
+
+    <sect2>
+      <title>Replacing <application>sendmail</application> as 
+       the system's default mailer</title>
+
+      <para><application>Sendmail</application> is so ubiquitous 
+       as standard software on Unix systems, that some software 
+       just presumes that it is already installed and configured.  
+       For this reason, many alternative MTA's provide utilities 
+       that implement exactly the same command-line interface 
+       that <application>sendmail</application> provides.</para>
+
+      <para>Therefore, if you are using an alternative mailer, 
+       you will need to make sure that software trying to execute 
+       standard <application>sendmail</application> binaries such as 
+       <filename>/usr/bin/sendmail</filename> actually executes 
+       your chosen mailer instead.  Fortunately, FreeBSD provides 
+       a system called &man.mailwrapper.8 that does this job for 
+       you.</para>
+
+      <para>When <application>sendmail</application> is operating as installed, you will 
+       find something like the following
+       in <filename>/etc/mail/mailer.conf</filename> : <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>
+
+      <para>This means that when any of these common command 
+       are run, such as <filename>/usr/bin/sendmail</filename> 
+       the program that is actually sitting in that location 
+       checks <filename>mailer.conf</filename> and actually 
+       executes <filename>/usr/libexec/sendmail/sendmail</filename> 
+       instead.  This system makes it easy to change what binaries 
+       are actually executed when these default system utilites 
+       are run.</para>
+
+      <para>Therefore if you wanted 
+       <filename>/usr/local/supermailer/bin/sendmail-compat</filename>
+       to be run instead of sendmail, you would change
+       <filename>/etc/mail/mailer.conf</filename> to read : <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>
+       </para>
+
+     </sect2>
+
+     <sect2>
+       <title>Finishing</title>
+        
+       <para>Once you have everything configured how you want it, you should
+        either kill the <application>sendmail</application> processes that 
+        you no longer need and start the processes belonging to your new 
+        software.  Or you should reboot your machine.  Rebooting will also 
+        give you the opportunity to ensure that you have correctly 
+        configured your machine to start your new MTA on boot.</para>
+
+     </sect2> 
+
+  </sect1>
+
   <sect1 id="mail-trouble">
     <title>Troubleshooting</title>
     <indexterm>
--- chapter.sgml.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204160145.g3G1jo820518>