1.\"	$OpenBSD: mailwrapper.8,v 1.12 2014/03/27 22:34:42 jmc Exp $
2.\"	$NetBSD: mailwrapper.8,v 1.16 2014/09/19 16:05:55 wiz Exp $
3.\" $FreeBSD$
4.\"
5.\" Copyright (c) 1998
6.\" 	Perry E. Metzger.  All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgment:
18.\"	This product includes software developed for the NetBSD Project
19.\"	by Perry E. Metzger.
20.\" 4. The name of the author may not be used to endorse or promote products
21.\"    derived from this software without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33.\"
34.Dd October 29, 2014
35.Dt MAILWRAPPER 8
36.Os
37.Sh NAME
38.Nm mailwrapper
39.Nd invoke appropriate
40.Tn MTA
41software based on configuration file
42.Sh SYNOPSIS
43Special.
44See below.
45.Sh DESCRIPTION
46Once upon time, the only Mail Transfer Agent
47.Pq Tn MTA
48software easily available was
49.Dq sendmail .
50This famous
51.Tn MTA
52was written by
53.An Eric Allman
54and first appeared in
55.Bx 4.1 .
56The legacy of this
57.Tn MTA
58affected most Mail User Agents
59.Pq Tn MUAs
60such as
61.Xr mail 1 ;
62the path and calling conventions expected by
63.Dq sendmail
64were compiled in.
65.Pp
66But times changed.
67On a modern
68.Fx
69system, the administrator may wish to use one of several available
70.Tn MTAs .
71.Pp
72It would be difficult to modify all
73.Tn MUA
74software typically available on a system,
75so most of the authors of alternative
76.Tn MTAs
77have written their front end message submission programs
78that may appear in the place of
79.Pa /usr/sbin/sendmail ,
80but still follow the same calling conventions as
81.Dq sendmail .
82.Pp
83The
84.Dq sendmail
85.Tn MTA
86also typically has aliases named
87.Xr mailq 1
88and
89.Xr newaliases 1
90linked to it.
91The program knows to behave differently when its
92.Va argv[0]
93is
94.Dq mailq
95or
96.Dq newaliases
97and behaves appropriately.
98Typically, replacement
99.Tn MTAs
100provide similar functionality, either through a program that also
101switches behavior based on calling name, or through a set of programs
102that provide similar functionality.
103.Pp
104Although having replacement programs that plug replace
105.Dq sendmail
106helps in installing alternative
107.Tn MTAs ,
108it essentially makes the configuration of the system depend
109on hand installing new programs in
110.Pa /usr .
111This leads to configuration problems for many administrators, since
112they may wish to install a new
113.Tn MTA
114without altering the system provided
115.Pa /usr .
116(This may be, for example, to avoid having upgrade problems when a new
117version of the system is installed over the old.)
118They may also have a shared
119.Pa /usr
120among several machines, and may wish to avoid placing
121implicit configuration information in a read-only
122.Pa /usr .
123.Pp
124The
125.Nm
126program is designed to replace
127.Pa /usr/sbin/sendmail
128and to invoke an appropriate
129.Tn MTA
130based on configuration information placed in
131.Pa ${LOCALBASE}/etc/mail/mailer.conf
132falling back on
133.Pa /etc/mail/mailer.conf .
134This permits the administrator to configure which
135.Tn MTA
136is to be invoked on
137the system at run time.
138.Pp
139Other configuration files may need to be altered when replacing
140.Xr sendmail 8 .
141For example, if the replacement
142.Tn MTA
143does not support the
144.Fl A
145option with
146.Xr mailq 1 ,
147.Va daily_status_include_submit_mailq
148should be turned off in
149.Pa /etc/periodic.conf .
150.Sh FILES
151Configuration for
152.Nm
153is kept in
154.Pa ${LOCALBASE}/etc/mail/mailer.conf
155or
156.Pa /etc/mail/mailer.conf .
157.Pa /usr/sbin/sendmail
158is typically set up as a symbolic link to
159.Nm
160which is not usually invoked on its own.
161.Sh EXIT STATUS
162.Ex -std
163.Sh DIAGNOSTICS
164The
165.Nm
166will print a diagnostic if its configuration file is missing or malformed,
167or does not contain a mapping for the name under which it was invoked.
168.Sh SEE ALSO
169.Xr dma 8 ,
170.Xr mail 1 ,
171.Xr mailq 1 ,
172.Xr newaliases 1 ,
173.Xr mailer.conf 5 ,
174.Xr periodic.conf 5 ,
175.Xr sendmail 8
176.Sh HISTORY
177The
178.Nm
179utility first appeared in
180.Nx 1.4
181and then
182.Fx 4.0 .
183.Sh AUTHORS
184.An Perry E. Metzger Aq Mt perry@piermont.com
185.Sh BUGS
186The entire reason this program exists is a crock.
187Instead, a command
188for how to submit mail should be standardized, and all the
189.Dq behave differently if invoked with a different name
190behavior of things like
191.Xr mailq 1
192should go away.
193