1.\" $NetBSD: mailwrapper.8,v 1.18 2017/07/04 07:10:35 wiz Exp $ 2.\" 3.\" Copyright (c) 1998 4.\" Perry E. Metzger. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgment: 16.\" This product includes software developed for the NetBSD Project 17.\" by Perry E. Metzger. 18.\" 4. The name of the author may not be used to endorse or promote products 19.\" derived from this software without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31.\" 32.\" The following requests are required for all man pages. 33.Dd April 10, 2010 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.Nx 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 /etc/mailer.conf . 131This permits the administrator to configure which 132.Tn MTA 133is to be invoked on the system at run time. 134.Sh FILES 135Configuration for 136.Nm 137is kept in 138.Pa /etc/mailer.conf . 139.Pa /usr/sbin/sendmail 140is typically set up as a symlink to 141.Nm 142which is not usually invoked on its own. 143.Sh EXIT STATUS 144.Ex -std 145.Sh DIAGNOSTICS 146.Nm 147will print a diagnostic if its configuration file is missing or malformed, 148or does not contain a mapping for the name under which it was invoked. 149.Sh SEE ALSO 150.Xr mail 1 , 151.Xr mailq 1 , 152.Xr newaliases 1 , 153.Xr postfix 1 , 154.Xr mailer.conf 5 155.Sh HISTORY 156The 157.Nm 158program appeared in 159.Nx 1.4 . 160.Sh AUTHORS 161.An Perry E. Metzger Aq Mt perry@piermont.com 162.Sh BUGS 163The entire reason this program exists is a crock. 164Instead, a command 165for how to submit mail should be standardized, and all the 166.Dq behave differently if invoked with a different name 167behavior of things like 168.Xr mailq 1 169should go away. 170