1.\" $NetBSD: mailwrapper.8,v 1.12 2010/04/10 08:29:54 jruoho 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. See below. 43.Sh DESCRIPTION 44Once upon time, the only Mail Transfer Agent 45.Pq Tn MTA 46software easily available was 47.Dq sendmail . 48This famous 49.Tn MTA 50was written by 51.An Eric Allman 52and first appeared in 53.Bx 4.1 . 54The legacy of this 55.Tn MTA 56affected most Mail User Agents 57.Pq Tn MUAs 58such as 59.Xr mail 1 ; 60the path and calling conventions expected by 61.Dq sendmail 62were compiled in. 63.Pp 64But times changed. 65On a modern 66.Nx 67system, the administrator may wish to use one of several available 68.Tn MTAs . 69.Pp 70It would be difficult to modify all 71.Tn MUA 72software typically available on a system, 73so most of the authors of alternative 74.Tn MTAs 75have written their front end message submission programs 76that may appear in the place of 77.Pa /usr/sbin/sendmail , 78but still follow the same calling conventions as 79.Dq sendmail . 80.Pp 81The 82.Dq sendmail 83.Tn MTA 84also typically has aliases named 85.Xr mailq 1 86and 87.Xr newaliases 1 88linked to it. 89The program knows to behave differently when its 90.Va argv[0] 91is 92.Dq mailq 93or 94.Dq newaliases 95and behaves appropriately. 96Typically, replacement 97.Tn MTAs 98provide similar functionality, either through a program that also 99switches behavior based on calling name, or through a set of programs 100that provide similar functionality. 101.Pp 102Although having replacement programs that plug replace 103.Dq sendmail 104helps in installing alternative 105.Tn MTAs , 106it essentially makes the configuration of the system depend 107on hand installing new programs in 108.Pa /usr . 109This leads to configuration problems for many administrators, since 110they may wish to install a new 111.Tn MTA 112without altering the system provided 113.Pa /usr . 114(This may be, for example, to avoid having upgrade problems when a new 115version of the system is installed over the old.) 116They may also have a shared 117.Pa /usr 118among several machines, and may wish to avoid placing 119implicit configuration information in a read-only 120.Pa /usr . 121.Pp 122The 123.Nm 124program is designed to replace 125.Pa /usr/sbin/sendmail 126and to invoke an appropriate 127.Tn MTA 128based on configuration information placed in 129.Pa /etc/mailer.conf . 130This permits the administrator to configure which 131.Tn MTA 132is to be invoked on the system at run time. 133.Sh EXIT STATUS 134.Nm 135exits 0 on success, and \*[Gt]0 if an error occurs. 136.Sh FILES 137Configuration for 138.Nm 139is kept in 140.Pa /etc/mailer.conf . 141.Pa /usr/sbin/sendmail 142is typically set up as a symlink to 143.Nm 144which is not usually invoked on its own. 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 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