Removed extra [ from synopsis.
[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 [ \-body
14 .IR text ]
15 .RB [ \-cc
16 .I addrs
17 \&...]
18 .RB [ \-from
19 .IR addr ]
20 .RB [ \-subject
21 .IR subject ]
22 [switches\ for
23 .I post
24 \&... |
25 .R \-profile
26 [switches\ for
27 .I send
28 \&...]]
29 .RB [ \-version ]
30 .RB [ \-help ]
31 .RB [ \-debug ]
32 .ad
33 .SH DESCRIPTION
34 .B mhmail
35 is intended as a replacement for the standard Berkeley
36 mail program
37 .RB ( mail
38 or
39 .BR mailx ),
40 which is compatible with
41 .BR nmh .
42 This program is intended for the use of programs such as
43 .BR cron ,
44 which expect to send mail automatically to various
45 users.  It is also used by various
46 .B nmh
47 commands to mail various
48 error notifications.  Although
49 .B mhmail
50 can be used interactively,
51 it is recommended that
52 .B comp
53 and
54 .B send
55 be used instead to send messages.
56 .PP
57 When invoked without arguments, it simply invokes
58 .B inc
59 to incorporate new messages from the user's maildrop.  When one or more users
60 is specified, a message is read from the standard input and spooled to
61 a temporary file.
62 .B mhmail
63 then invokes
64 .B post
65 with the
66 name of the temporary file as its argument to deliver the message to
67 the specified user.
68 .PP
69 The
70 .B \-profile
71 switch instructs
72 .B mhmail
73 to use
74 .B send
75 instead of
76 .B post
77 to send the message.  This allows use of the user's context and aliases.
78 .PP
79 The
80 .B \-subject
81 .I subject
82 switch can be used to specify the
83 \*(lqSubject:\*(rq field of the message.
84 .PP
85 By default,
86 .B mhmail
87 will read the message to be sent from the
88 standard input.  You can specify the text of the message at the command
89 line with the
90 .B \-body
91 .I text
92 switch.  If the standard input has zero
93 length,
94 .B mhmail
95 will not send the message and return with status 1.  You can use the switch
96 .B \-body
97 \*(lq\*(rq to force an empty message.
98 .PP
99 Normally, addresses appearing as arguments are put in the \*(lqTo:\*(rq
100 field.  If the
101 .B \-cc
102 switch is used, all addresses following it, even if there are
103 intervening switches, are placed in the \*(lqcc:\*(rq field.
104 .PP
105 By using
106 .B \-from
107 .IR addr ,
108 you can specify the \*(lqFrom:\*(rq header of
109 the draft.  If no
110 .B \-from
111 switch is used when sending,
112 .B mhmail
113 will supply a \*(lqFrom:\*(rq header field using the sender's local mailbox.
114 Naturally,
115 .B post
116 will fill\-in the \*(lqSender:\*(rq
117 header correctly.
118 .PP
119 The
120 .B \-debug
121 option shows the draft file that would be posted/sent and the command
122 that would be used to post/send the draft, but does not post or send
123 it.
124 .PP
125 All other switches are passed on to
126 .B post
127 if
128 .B \-profile
129 is not used, or
130 .B send
131 if
132 .B \-profile
133 is used.
134
135 .SH FILES
136 .fc ^ ~
137 .nf
138 .ta \w'%etcdir%/ExtraBigFileName  'u
139 ^%bindir%/inc~^Program to incorporate maildrop into folder
140 ^%libdir%/post~^Program to deliver a message
141 ^/tmp/mhmail*~^Temporary copy of message
142 .fi
143
144 .SH "SEE ALSO"
145 inc(1), post(8), send(1)
146
147 .SH DEFAULTS
148 None
149
150 .SH CONTEXT
151 If
152 .B inc
153 is invoked, then
154 .BR inc 's
155 context changes occur.  With the
156 .B \-profile
157 switch, the context of
158 .B send
159 is used.