1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
'\" te
.\" Copyright (c) 1983 Eric P. Allman
.\" Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved.
.\" Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display
.\" the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. 4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific
.\" prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
.\" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" Copyright (c) 1998-2006, 2008 Sendmail, Inc. and its suppliers. All rights reserved.
.\" The following license terms and conditions apply, unless a different license is obtained from Sendmail, Inc., 6425 Christie Ave, Fourth Floor, Emeryville, CA 94608, USA, or by electronic mail at license@sendmail.com. License Terms: Use, Modification and Redistribution
.\" (including distribution of any modified or derived work) in source and binary forms is permitted only if each of the following conditions is met: 1. Redistributions qualify as "freeware" or "Open Source Software" under one of the following terms: (a) Redistributions are made at no charge
.\" beyond the reasonable cost of materials and delivery. (b) Redistributions are accompanied by a copy of the Source Code or by an irrevocable offer to provide a copy of the Source Code for up to three years at the cost of materials and delivery. Such redistributions
.\" must allow further use, modification, and redistribution of the Source Code under substantially the same terms as this license. For the purposes of redistribution "Source Code" means the complete compilable and linkable source code of sendmail including all modifications.
.\" 2. Redistributions of source code must retain the copyright notices as they appear in each source code file, these license terms, and the disclaimer/limitation of liability set forth as paragraph 6 below. 3. Redistributions in binary form must reproduce the Copyright Notice, these license
.\" terms, and the disclaimer/limitation of liability set forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: "Copyright (c) 1998-2004 Sendmail,
.\" Inc. All rights reserved." 4. Neither the name of Sendmail, Inc. nor the University of California nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. The name "sendmail" is a trademark
.\" of Sendmail, Inc. 5. All redistributions must comply with the conditions imposed by the University of California on certain embedded code, whose copyright notice and conditions for redistribution are as follows: (a) Copyright (c) 1988, 1993 The Regents of the University of California.
.\" All rights reserved. (b) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: (i) Redistributions of source code must retain the above copyright notice, this list of
.\" conditions and the following disclaimer. (ii) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
.\" (iii) Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 6. Disclaimer/Limitation of Liability: THIS SOFTWARE IS PROVIDED BY SENDMAIL,
.\" INC. AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SENDMAIL, INC., THE REGENTS OF THE UNIVERSITY OF CALIFORNIA OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
.\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.TH MAIL.LOCAL 8 "Apr 11, 1997"
.SH NAME
mail.local \- store mail in a mailbox
.SH SYNOPSIS
.LP
.nf
\fB/usr/lib/mail.local\fR [\fB-f\fR \fIsender\fR] [\fB-d\fR] \fIrecipient\fR
.fi
.SH DESCRIPTION
.sp
.LP
\fBmail.local\fR reads the standard input up to an end-of-file and appends it
to each user's mail file (mailbox). This program is intended to be used by
\fBsendmail\fR(8) as a mail delivery agent for local mail. It is not a user
interface agent.
.sp
.LP
Messages are appended to the user's mail file in the \fB/var/mail\fR directory.
The user must be a valid user name.
.sp
.LP
Each delivered mail message in the mailbox is preceded by a "Unix From line"
with the following format:
.sp
.LP
\fBFrom\fR \fIsender_address\fR \fItime_stamp\fR
.sp
.LP
The \fIsender_address\fR is extracted from the \fBSMTP\fR envelope address (the
envelope address is specified with the \fB-f\fR option).
.sp
.LP
A trailing blank line is also added to the end of each message.
.sp
.LP
The mail files are locked with a \fB\&.lock\fR file while mail is appended.
.sp
.LP
The mail files are created with mode \fB660\fR, owner is set to
\fIrecipient\fR, and group is set to \fBmail\fR. If the ``biff'' service is
returned by \fBgetservbyname\fR(3SOCKET), the biff server is notified of
delivered mail. This program also computes the \fBContent-Length:\fR header
which will be used by the mailbox reader to mark the message boundary.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-f\fR \fIsender\fR\fR
.ad
.RS 13n
Specifies the "envelope from address" of the message. This flag is technically
optional, but should be used.
.RE
.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 13n
Specifies the recipient of the message. This flag is also optional and is
supported here for backward compatibility. That is, \fBmail.local\fR\fI
recipient\fR is the same as \fBmail.local\fR \fB-d\fR \fIrecipient\fR.
.RE
.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 13n
Turn on \fBLMTP\fR mode.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR \fIfrom\fR\fR
.ad
.RS 13n
Specify the sender's name (for backward compatibility).
.RE
.sp
.ne 2
.na
\fB\fB-7\fR\fR
.ad
.RS 13n
Do not advertise 8BITMIME support in \fBLMTP\fR mode.
.RE
.sp
.ne 2
.na
\fB\fB-b\fR\fR
.ad
.RS 13n
Return a permanent error instead of a temporary error if a mailbox exceeds
quota.
.RE
.SH OPERANDS
.sp
.LP
The following operand is supported:
.sp
.ne 2
.na
\fB\fIrecipient\fR\fR
.ad
.RS 13n
The recipient of the mail message.
.RE
.SH ENVIRONMENT VARIABLES
.sp
.ne 2
.na
\fB\fBTZ\fR\fR
.ad
.RS 6n
Used to set the appropriate time zone on the timestamp.
.RE
.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful operation.
.RE
.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE
.SH FILES
.sp
.ne 2
.na
\fB\fB/tmp/local.\fR\fIXXXXXX\fR\fR
.ad
.RS 23n
temporary files
.RE
.sp
.ne 2
.na
\fB\fB/tmp/lochd.\fR\fIXXXXXX\fR\fR
.ad
.RS 23n
temporary files
.RE
.sp
.ne 2
.na
\fB\fB/var/mail/\fR\fIuser_name\fR\fR
.ad
.RS 23n
user's mail file
.RE
.SH SEE ALSO
.sp
.LP
.BR mail (1),
.BR getservbyname (3SOCKET),
.BR attributes (7),
.BR comsat (8),
.BR sendmail (8)
|