mhmail now supports -profile -resend.
[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 .RB [ \-resent ]
23 [switches\ for
24 .I post
25 \&... |
26 .RB \-profile
27 [switches\ for
28 .I send
29 \&...]]
30 .RB [ \-send " | " \-nosend ]
31 .RB [ \-version ]
32 .RB [ \-help ]
33 .ad
34 .SH DESCRIPTION
35 .B mhmail
36 is intended as a replacement for the standard Berkeley
37 mail program
38 .RB ( mail
39 or
40 .BR mailx ),
41 which is compatible with
42 .BR nmh .
43 This program is intended for the use of programs such as
44 .BR cron ,
45 which expect to send mail automatically to various
46 users.  It is also used by various
47 .B nmh
48 commands to mail various
49 error notifications.  Although
50 .B mhmail
51 can be used interactively,
52 it is recommended that
53 .B comp
54 and
55 .B send
56 be used instead to send messages.
57 .PP
58 When invoked without arguments, it simply invokes
59 .B inc
60 to incorporate new messages from the user's maildrop.  When one or more users
61 is specified, a message is read from the standard input and spooled to
62 a temporary file.
63 .B mhmail
64 then invokes
65 .B post
66 with the
67 name of the temporary file as its argument to deliver the message to
68 the specified user.
69 .PP
70 The
71 .B \-subject
72 .I subject
73 switch can be used to specify the
74 \*(lqSubject:\*(rq field of the message.
75 .PP
76 The
77 .B \-resent
78 switch indicates that the message body is a fully formed message that
79 will be resent, as
80 .B dist
81 would do.  For example:
82 .PP
83     mhmail u2@example.com -resent < `mhpath cur`
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 \-profile
121 switch instructs
122 .B mhmail
123 to use
124 .B send
125 instead of
126 .B post
127 to send the message.  This allows use of the user's context and aliases.
128 .PP
129 The
130 .B \-nosend
131 option shows the draft file that would be posted/sent on the command's
132 standard output but does not post or send it.
133 .B \-send
134 provides the default behavior of posting or sending the message.  It
135 can be used to disable
136 .BR \-nosend ,
137 for example, when using a shell alias.
138 .PP
139 All other switches are passed on to
140 .B post
141 if
142 .B \-profile
143 is not used, or
144 .B send
145 if
146 .B \-profile
147 is used.
148
149 .SH FILES
150 .fc ^ ~
151 .nf
152 .ta \w'%etcdir%/ExtraBigFileName  'u
153 ^%bindir%/inc~^Program to incorporate maildrop into folder
154 ^%libdir%/post~^Program to deliver a message
155 ^/tmp/mhmail*~^Temporary copy of message
156 .fi
157
158 .SH "SEE ALSO"
159 dist(1), inc(1), post(8), send(1)
160
161 .SH DEFAULTS
162 .RB ` \-send '
163
164 .SH CONTEXT
165 If
166 .B inc
167 is invoked, then
168 .BR inc 's
169 context changes occur.  With the
170 .B \-profile
171 switch, the context of
172 .B send
173 is used.