1.\"	$OpenBSD: mailwrapper.8,v 1.13 2015/12/14 02:56:07 sunil Exp $
2.\"	$NetBSD: mailwrapper.8,v 1.5 1999/03/22 18:44:01 garbled Exp $
3.\"
4.\" Copyright (c) 1998
5.\" 	Perry E. Metzger.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgment:
17.\"	This product includes software developed for the NetBSD Project
18.\"	by Perry E. Metzger.
19.\" 4. The name of the author may not be used to endorse or promote products
20.\"    derived from this software without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32.\"
33.Dd $Mdocdate: December 14 2015 $
34.Dt MAILWRAPPER 8
35.Os
36.Sh NAME
37.Nm mailwrapper
38.Nd invoke appropriate MTA software based on configuration file
39.Sh SYNOPSIS
40Special.
41See below.
42.Sh DESCRIPTION
43At one time, the only Mail Transfer Agent (MTA) software easily available
44was
45.Xr sendmail 8 .
46As a result of this, most Mail User Agents (MUAs) such as
47.Xr mail 1
48had the path and calling conventions expected by
49.Xr sendmail 8
50compiled in.
51.Pp
52Times have changed, however.
53On a modern system, the administrator may wish to use one of several
54available MTAs.
55.Pp
56It would be difficult to modify all MUA software typically available
57on a system, so most of the authors of alternative MTAs have written
58their front end message submission programs so that they use the same
59calling conventions as
60.Xr sendmail 8
61and may be put into place instead of
62.Xr sendmail 8
63in
64.Pa /usr/sbin/sendmail .
65.Pp
66.Xr sendmail 8
67also typically has aliases named
68.Xr mailq 8
69and
70.Xr newaliases 8
71linked to it.
72The program knows to behave differently when its
73.Va argv[0]
74is
75.Dq mailq
76or
77.Dq newaliases
78and behaves appropriately.
79Typically, replacement MTAs provide similar
80functionality, either through a program that also switches behavior
81based on calling name, or through a set of programs that provide
82similar functionality.
83.Pp
84Although having drop-in replacements for
85.Xr sendmail 8
86helps in installing alternative MTAs, it essentially makes the
87configuration of the system depend on hard installing new programs in
88.Pa /usr .
89This leads to configuration problems for many administrators, since
90they may wish to install a new MTA without altering the system
91provided
92.Pa /usr .
93(This may be, for example, to avoid having upgrade problems when a new
94version of the system is installed over the old.)
95They may also have a shared
96.Pa /usr
97among several
98machines, and may wish to avoid placing implicit configuration
99information in a read-only
100.Pa /usr .
101.Pp
102The
103.Nm
104program is designed to replace
105.Pa /usr/sbin/sendmail
106and to invoke an appropriate MTA instead of
107.Xr sendmail 8
108based on configuration information placed in
109.Pa /etc/mailer.conf .
110This permits the administrator to configure which MTA is to be invoked on
111the system at run time.
112.Sh FILES
113Configuration for
114.Nm
115is kept in
116.Pa /etc/mailer.conf .
117.Pa /usr/sbin/sendmail
118is typically set up as a symlink to
119.Nm
120which is not usually invoked on its own.
121.Sh DIAGNOSTICS
122.Nm
123will invoke
124.Xr smtpd 8
125if its configuration file is missing.
126It will return an error value and print a diagnostic if its configuration
127file is malformed, or does not contain a mapping for the name under which
128.Nm
129was invoked.
130.Sh SEE ALSO
131.Xr mail 1 ,
132.Xr mailer.conf 5 ,
133.Xr mailq 8 ,
134.Xr newaliases 8 ,
135.Xr sendmail 8 ,
136.Xr smtpd 8
137.Sh AUTHORS
138.An Perry E. Metzger Aq Mt perry@piermont.com
139.Sh BUGS
140The entire reason this program exists is a crock.
141Instead, a command
142for how to submit mail should be standardized, and all the "behave
143differently if invoked with a different name" behavior of things like
144.Xr mailq 8
145should go away.
146