xref: /freebsd/usr.sbin/mailwrapper/mailwrapper.8 (revision 397e83df75e0fcd0d3fcb95ae4d794cb7600fc89)
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.\"
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 October 29, 2014
34.Dt MAILWRAPPER 8
35.Os
36.Sh NAME
37.Nm mailwrapper
38.Nd invoke appropriate
39.Tn MTA
40software based on configuration file
41.Sh SYNOPSIS
42Special.
43See below.
44.Sh DESCRIPTION
45Once upon time, the only Mail Transfer Agent
46.Pq Tn MTA
47software easily available was
48.Dq sendmail .
49This famous
50.Tn MTA
51was written by
52.An Eric Allman
53and first appeared in
54.Bx 4.1 .
55The legacy of this
56.Tn MTA
57affected most Mail User Agents
58.Pq Tn MUAs
59such as
60.Xr mail 1 ;
61the path and calling conventions expected by
62.Dq sendmail
63were compiled in.
64.Pp
65But times changed.
66On a modern
67.Fx
68system, the administrator may wish to use one of several available
69.Tn MTAs .
70.Pp
71It would be difficult to modify all
72.Tn MUA
73software typically available on a system,
74so most of the authors of alternative
75.Tn MTAs
76have written their front end message submission programs
77that may appear in the place of
78.Pa /usr/sbin/sendmail ,
79but still follow the same calling conventions as
80.Dq sendmail .
81.Pp
82The
83.Dq sendmail
84.Tn MTA
85also typically has aliases named
86.Xr mailq 1
87and
88.Xr newaliases 1
89linked to it.
90The program knows to behave differently when its
91.Va argv[0]
92is
93.Dq mailq
94or
95.Dq newaliases
96and behaves appropriately.
97Typically, replacement
98.Tn MTAs
99provide similar functionality, either through a program that also
100switches behavior based on calling name, or through a set of programs
101that provide similar functionality.
102.Pp
103Although having replacement programs that plug replace
104.Dq sendmail
105helps in installing alternative
106.Tn MTAs ,
107it essentially makes the configuration of the system depend
108on hand installing new programs in
109.Pa /usr .
110This leads to configuration problems for many administrators, since
111they may wish to install a new
112.Tn MTA
113without altering the system provided
114.Pa /usr .
115(This may be, for example, to avoid having upgrade problems when a new
116version of the system is installed over the old.)
117They may also have a shared
118.Pa /usr
119among several machines, and may wish to avoid placing
120implicit configuration information in a read-only
121.Pa /usr .
122.Pp
123The
124.Nm
125program is designed to replace
126.Pa /usr/sbin/sendmail
127and to invoke an appropriate
128.Tn MTA
129based on configuration information placed in
130.Pa ${LOCALBASE}/etc/mail/mailer.conf
131falling back on
132.Pa /etc/mail/mailer.conf .
133This permits the administrator to configure which
134.Tn MTA
135is to be invoked on
136the system at run time.
137.Pp
138Other configuration files may need to be altered when replacing
139.Xr sendmail 8 .
140For example, if the replacement
141.Tn MTA
142does not support the
143.Fl A
144option with
145.Xr mailq 1 ,
146.Va daily_status_include_submit_mailq
147should be turned off in
148.Pa /etc/periodic.conf .
149.Sh FILES
150Configuration for
151.Nm
152is kept in
153.Pa ${LOCALBASE}/etc/mail/mailer.conf
154or
155.Pa /etc/mail/mailer.conf .
156.Pa /usr/sbin/sendmail
157is typically set up as a symbolic link to
158.Nm
159which is not usually invoked on its own.
160.Sh EXIT STATUS
161.Ex -std
162.Sh DIAGNOSTICS
163The
164.Nm
165will print a diagnostic if its configuration file is missing or malformed,
166or does not contain a mapping for the name under which it was invoked.
167.Sh SEE ALSO
168.Xr dma 8 ,
169.Xr mail 1 ,
170.Xr mailq 1 ,
171.Xr newaliases 1 ,
172.Xr mailer.conf 5 ,
173.Xr periodic.conf 5 ,
174.Xr sendmail 8
175.Sh HISTORY
176The
177.Nm
178utility first appeared in
179.Nx 1.4
180and then
181.Fx 4.0 .
182.Sh AUTHORS
183.An Perry E. Metzger Aq Mt perry@piermont.com
184.Sh BUGS
185The entire reason this program exists is a crock.
186Instead, a command
187for how to submit mail should be standardized, and all the
188.Dq behave differently if invoked with a different name
189behavior of things like
190.Xr mailq 1
191should go away.
192