Added a few clarifications and more DEFAULTS to mhmail(1) man page.
[mmh] / man / mhmail.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MHMAIL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 mhmail \- send or read mail
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B mhmail
11 .RI [ addrs
12 \&...]
13 .RB [ \-attach
14 .IR file ]
15 .RB [ \-body
16 .IR text ]
17 .RB [ \-cc
18 .I addrs
19 \&...]
20 .RB [ \-from
21 .IR addr ]
22 .RB [ \-header\-field
23 .IR name:body ]
24 .RB [ \-subject
25 .IR subject ]
26 .RB [ \-resent ]
27 [switches\ for
28 .I post
29 \&... |
30 .RB \-profile
31 [switches\ for
32 .I send
33 \&...]]
34 .RB [ \-send " | " \-nosend ]
35 .RB [ \-version ]
36 .RB [ \-help ]
37 .ad
38 .SH DESCRIPTION
39 .B mhmail
40 is intended as a replacement for the standard Berkeley
41 mail program
42 .RB ( mail
43 or
44 .BR mailx ),
45 which is compatible with
46 .BR nmh .
47 This program is intended for the use of programs such as
48 .BR cron ,
49 which expect to send mail automatically to various
50 users.  It is also used by various
51 .B nmh
52 commands to mail various
53 error notifications.  Although
54 .B mhmail
55 can be used interactively,
56 it is recommended that
57 .B comp
58 and
59 .B send
60 be used instead to send messages.
61 .PP
62 When invoked without arguments, it simply invokes
63 .B inc
64 to incorporate new messages from the user's maildrop.  When one or more users
65 is specified, a message is read from the standard input and spooled to
66 a temporary file.
67 .B mhmail
68 then invokes
69 .B post
70 with the
71 name of the temporary file as its argument to deliver the message to
72 the specified user.
73 .PP
74 The
75 .B \-subject
76 .I subject
77 switch can be used to specify the
78 \*(lqSubject:\*(rq field of the message.
79 .PP
80 The
81 .B \-resent
82 switch indicates that the message body is a fully formed message that
83 will be resent, as
84 .B dist
85 would do.  For example:
86 .PP
87 .RS 5
88 .nf
89 mhmail u2@example.com -resent < `mhpath cur`
90 .fi
91 .RE
92 .PP
93 By default,
94 .B mhmail
95 will read the message to be sent from the
96 standard input.  You can specify the text of the message at the command
97 line with the
98 .B \-body
99 .I text
100 switch.  If the standard input has zero
101 length,
102 .B mhmail
103 will not send the message and return with status 1.  You can use the switch
104 .B \-body
105 \*(lq\*(rq to force an empty message.
106 .PP
107 Normally, addresses appearing as arguments are put in the \*(lqTo:\*(rq
108 field.  At least one such address is required when sending a message,
109 i.e., if any other switches are supplied. If the
110 .B \-cc
111 switch is used, all addresses following it, even if there are
112 intervening switches, are placed in the \*(lqcc:\*(rq field.
113 .PP
114 By using
115 .B \-from
116 .IR addr ,
117 you can specify the \*(lqFrom:\*(rq header of
118 the draft.  If no
119 .B \-from
120 switch is used when sending,
121 .B mhmail
122 will supply a \*(lqFrom:\*(rq header field using the sender's local mailbox,
123 see
124 .I localmbox
125 in
126 .BR mh-format (5).
127 Naturally,
128 .B post
129 will fill\-in the \*(lqSender:\*(rq
130 header correctly.
131 .PP
132 The
133 .B \-header\-field
134 .I name:body
135 switch adds a header field with the specified name and body to the
136 message.  There need not be a space after the colon that separates the
137 name and body in the argument to this switch.  It is usually best to
138 enclose the argument in quotes to protect it from the shell.  The
139 .B \-header\-field
140 switch may be given multiple times to add multiple header fields,
141 for example,
142 .PP
143 .RS 5
144 .nf
145 mhmail -from sender@example.com \\
146 -header\-field 'MIME-Version:1.0' \\
147 -header\-field 'Content-Type:text/plain; charset=utf-8' \\
148 -header\-field 'Content-Transfer-Encoding:8bit' \\
149 recipient@example.com
150 .fi
151 .RE
152 .PP
153 Note about this example:  the
154 .B \-attach
155 switch causes
156 .I MIME-Version
157 and
158 .I Content-Type
159 headers to be added to the message.
160 .PP
161 The
162 .B \-profile
163 switch instructs
164 .B mhmail
165 to use
166 .B send
167 instead of
168 .B post
169 to send the message.  This allows use of the user's context and aliases.
170 .PP
171 The
172 .B \-attach
173 .I file
174 switch attaches the specified file to the message.  Use of
175 .B \-attach
176 enables
177 .B \-profile
178 because
179 .B mhmail
180 uses
181 .B send
182 to handle the attachment.  It is usually best to enclose the argument
183 in quotes to protect it from the shell.  The
184 .B \-attach
185 switch may be given multiple times to add multiple attachments.
186 .PP
187 The
188 .B \-nosend
189 option shows the draft file that would be posted/sent on the command's
190 standard output but does not post or send it.
191 .B \-send
192 provides the default behavior of posting or sending the message.  It
193 can be used to disable
194 .BR \-nosend ,
195 for example, when using a shell alias.
196 .PP
197 All other switches are passed on to
198 .B post
199 if
200 .B \-profile
201 is not used, or
202 .B send
203 if
204 .B \-profile
205 is used.
206
207 .SH FILES
208 .fc ^ ~
209 .nf
210 .ta \w'%etcdir%/ExtraBigFileName  'u
211 ^%bindir%/inc~^Program to incorporate maildrop into folder
212 ^%libdir%/post~^Program to deliver a message
213 ^/tmp/mhmail*~^Temporary copy of message
214 .fi
215
216 .SH "SEE ALSO"
217 dist(1), inc(1), mh-format(5), post(8), send(1)
218
219 .SH DEFAULTS
220 .nf
221 .RB ` \-from "' defaults to sender's local mailbox (localmbox)"
222 .RB ` \-profile "' is enabled by default only with " \-attach
223 .RB ` \-send '
224 .fi
225
226 .SH CONTEXT
227 If
228 .B inc
229 is invoked, then
230 .BR inc 's
231 context changes occur.  With the
232 .B \-profile
233 switch, the context of
234 .B send
235 is used.