]> diplodocus.org Git - nmh/blob - man/post.man
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / man / post.man
1 .TH POST %manext8% "October 17, 2016" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 post \- deliver a message
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B %nmhlibexecdir%/post
11 .RB [ \-help ]
12 .RB [ \-version ]
13 .RB [ \-alias
14 .IR aliasfile ]
15 .RB [ \-filter
16 .IR filterfile ]
17 .RB [ \-nofilter ]
18 .RB [ \-format " | " \-noformat ]
19 .RB [ \-mime " | " \-nomime ]
20 .RB [ \-msgid " | " \-nomsgid ]
21 .RB [ \-messageid
22 .IR localname " | " random ]
23 .RB [ \-verbose " | " \-noverbose ]
24 .RB [ \-watch " | " \-nowatch ]
25 .RB [ \-width
26 .IR columns ]
27 .RB [ \-mts
28 .IR smtp " | " sendmail/smtp " | " sendmail/pipe ]
29 .RB [ \-sendmail
30 .IR program ]
31 .RB [ \-server
32 .IR servername ]
33 .RB [ \-port
34 .IR portname/number ]
35 .RB [ \-sasl ]
36 .RB [ \-nosasl ]
37 .RB [ \-saslmech
38 .IR mechanism ]
39 .RB [ \-user
40 .IR username ]
41 .RB [ \-tls ]
42 .RB [ \-initialtls ]
43 .RB [ \-notls ]
44 .I file
45 .ad
46 .SH DESCRIPTION
47 .B Post
48 is the default program called by
49 .B send
50 to deliver
51 the message in
52 .I file
53 to local and remote users. In fact, most of
54 the features attributed to
55 .B send
56 in its manual page are performed by
57 .BR post ,
58 with
59 .B send
60 acting as a relatively simple preprocessor.
61 Thus, it is
62 .B post
63 which parses the various header fields, appends a
64 \*(lqDate:\*(rq line, and interacts with the mail transport system.
65 .B post
66 will not normally be called directly by the user,
67 but can be replaced by the user with a
68 .I postproc
69 profile component that will have
70 .I file
71 as its final argument.
72 See the mh-profile(5) man page for more information on postproc.
73 .PP
74 .B Post
75 searches the \*(lqTo:\*(rq, \*(lqcc:\*(rq, \*(lqBcc:\*(rq,
76 \*(lqFcc:\*(rq, and \*(lqResent\-xxx:\*(rq header lines of the specified
77 message for destination addresses, checks these addresses for validity,
78 and formats them so as to conform to ARPAnet Internet Message Format
79 protocol, unless the
80 .B \-noformat
81 flag is set. This will normally cause
82 \*(lq@\fIlocal\-site\fR\*(rq to be appended to each local destination
83 address, as well as any local return addresses. The
84 .B \-width
85 .I columns
86 switch can be used to indicate the preferred length of the header
87 components that contain addresses.
88 .PP
89 If a \*(lqBcc:\*(rq field is encountered, its addresses will be used for
90 delivery, and the \*(lqBcc:\*(rq field will be removed from the message
91 sent to sighted recipients. The blind recipients will receive an entirely
92 new message with a minimal set of headers. Included in the body of the
93 message will be a copy of the message sent to the sighted recipients.
94 If
95 .B \-filter
96 .I filterfile
97 is specified, then this copy is filtered
98 (re\-formatted) by
99 .B mhl
100 prior to being sent to the blind recipients.
101 Alternately, if the
102 .B \-mime
103 switch is given, then
104 .B post
105 will use
106 the MIME rules for encapsulation.
107 .PP
108 The
109 .B \-alias
110 .I aliasfile
111 switch can be used to specify a file that post
112 should take aliases from. More than one file can be specified, each
113 being preceded with
114 .BR \-alias .
115 In any event, the primary alias file is
116 read first.
117 .PP
118 The
119 .B \-msgid
120 switch indicates that a \*(lqMessage\-ID:\*(rq or
121 \*(lqResent\-Message\-ID:\*(rq field should be added to the header.
122 .PP
123 The
124 .B \-messageid
125 switch selects the style used for the part appearing after the @
126 in \*(lqMessage\-ID:\*(rq, \*(lqResent\-Message\-ID:\*(rq, and
127 \*(lqContent\-ID:\*(rq header fields. The two acceptable options are
128 .B localname
129 (which is the default),
130 and
131 .BR random .
132 With
133 .BR localname ,
134 the local hostname is used. With
135 .BR random ,
136 a random sequence of characters is used instead. Note that the
137 .B \-msgid
138 switch must be enabled for this switch to have any effect.
139 .PP
140 The
141 .B \-verbose
142 switch indicates that the user should be informed of
143 each step of the posting/filing process.
144 .PP
145 The
146 .B \-watch
147 switch indicates that the user would like to watch the
148 transport system's handling of the message (e.g., local and \*(lqfast\*(rq
149 delivery).
150 .PP
151 Under normal circumstances,
152 .B post
153 uses the \*(lqFrom:\*(rq line in the message draft as the identity of
154 the originating mailbox. A \*(lqFrom:\*(rq line is required in
155 all message draft. By default the message composition utilities such
156 as
157 .BR comp ,
158 .B repl
159 and
160 .B mhmail
161 will automatically place a \*(lqFrom:\*(rq line in the message draft.
162 There are two ways to override this behavior, however.
163 Note that they apply equally to \*(lqResent\-From:\*(rq lines in messages sent
164 with
165 .BR dist .
166 .PP
167 The first way is to supply a \*(lqSender:\*(rq line. The value of this
168 field will be used as the originating mailbox identity when submitting the
169 message to the mail transport system. If multiple addresses are
170 given in the \*(lqFrom:\*(rq line, a \*(lqSender:\*(rq line is
171 .BR required .
172 If an \*(lqEnvelope-From:\*(rq line is supplied when multiple addresses
173 are given in the \*(lqFrom:\*(rq line, a \*(lqSender:\*(rq header will
174 be generated using the value of the \*(lqEnvelope-From:\*(rq line,
175 .B if
176 the \*(lqEnvelope-From:\*(rq line is not blank.
177 .PP
178 The second way is to supply a \*(lqEnvelope-From:\*(rq line. The value
179 of this field will be used as the originating mailbox identity when
180 submitting the message to the mail transport system. This will override
181 both the value of the \*(lqFrom:\*(rq line and a \*(lqSender:\*(rq line
182 (if one is supplied). The \*(lqEnvelope-From:\*(rq line is allowed to
183 have a blank value; if the value is blank, then the mail transport system
184 will be instructed to not send any bounces in response to the message.
185 Not all mail transport systems support this feature.
186 .PP
187 The mail transport system default is provided in
188 .I %nmhetcdir%/mts.conf
189 but can be overriiden here with the
190 .B \-mts
191 switch.
192 .PP
193 If nmh is using as its mail transport system
194 .BR sendmail/pipe ,
195 the
196 .B \-sendmail
197 switch can be used to override the default
198 .B sendmail
199 program.
200 .PP
201 If nmh is using the SMTP MTA, the
202 .B \-server
203 and the
204 .B \-port
205 switches can be used to override the default mail server (defined by the
206 .RI servers
207 entry in
208 .I %nmhetcdir%/mts.conf
209 ).
210 .PP
211 If
212 .B nmh
213 has been compiled with SASL support, the
214 .B \-sasl
215 and
216 .B \-nosasl
217 switches will enable and disable
218 the use of SASL authentication with the SMTP MTA. Depending on the
219 SASL mechanism used, this may require an additional password prompt from the
220 user (but the
221 .I netrc
222 file can be used to store this password, as described in the
223 mh-profile(5) man page). The
224 .B \-saslmech
225 switch can be used to select a particular SASL mechanism,
226 and the
227 .B \-user
228 switch can be used to select a authorization userid to provide to SASL
229 other than the default. The credentials profile entry in the
230 mh\-profile(5) man page describes the ways to supply a username and
231 password.
232 .PP
233 If SASL authentication is successful,
234 .BR nmh
235 will attempt to negotiate a security layer for session encryption.
236 Encrypted data is labelled with `(sasl-encrypted)' and `(sasl-decrypted)' when
237 viewing the SMTP transaction with the
238 .B \-snoop
239 switch.
240 Base64-encoded data is wrapped with `b64<>'.
241 (Beware that the SMTP transaction may contain authentication information either
242 in plaintext or easily decoded base64.)
243 .PP
244 If
245 .B nmh
246 has been compiled with TLS support, the
247 .B \-tls
248 and
249 .B \-initialtls
250 switches will require the negotiation of TLS when
251 connecting to the SMTP MTA. The
252 .B \-tls
253 switch will negotiate TLS as part of the normal SMTP protocol
254 using the STARTTLS command. The
255 .B \-initialtls
256 will negotiate TLS immediately after the connection has
257 taken place, before any SMTP commands are sent or received. Encrypted data
258 is labelled with `(tls-encrypted)' and
259 `(tls-decrypted)' when viewing the SMTP transction with the
260 .B \-snoop
261 switch.
262 Base64-encoded data is wrapped with `b64<>'.
263 (Beware that the SMTP transaction may contain authentication information either
264 in plaintext or easily decoded base64.)
265 The
266 .B \-notls
267 switch will disable all attempts to negotiate TLS.
268 .PP
269 If port 465 is specified and none of the TLS switches were enabled,
270 .B \-initialtls
271 will be implied if TLS support was compiled in. Though port 465 for
272 SMTPS (SMTP over SSL) was deregistered by IANA in 1998, it is still
273 used for that service.
274 .PP
275 .B post
276 filters out header lines with names beginning with \*(lqNmh-\*(rq
277 (case insensitive) from the message draft.
278 Those lines are reserved for internal
279 .B nmh
280 use.
281 .SH FILES
282 .fc ^ ~
283 .nf
284 .ta \w'%nmhetcdir%/ExtraBigFileName 'u
285 ^%nmhetcdir%/mts.conf~^nmh mts configuration file
286 ^%nmhetcdir%/MailAliases~^global nmh alias file
287 ^%bindir%/refile~^Program to process Fcc:s
288 ^%nmhlibexecdir%/mhl~^Program to process Bcc:s
289 .fi
290 .SH "PROFILE COMPONENTS"
291 .B post
292 does
293 .B NOT
294 consult the user's
295 .I \&.mh\(ruprofile
296 .SH "SEE ALSO"
297 .IR mhmail (1),
298 .IR send (1),
299 .IR mh\-mail (5),
300 .IR mh\-alias (5),
301 .IR mh\-profile (5),
302 .IR mh\-tailor (5)
303 .PP
304 .I "Standard for the Format of ARPA Internet Text Messages"
305 (RFC 822)
306 .SH DEFAULTS
307 .nf
308 .RB ` \-alias "' defaults to %nmhetcdir%/MailAliases"
309 .RB ` \-format '
310 .RB ` \-nomime '
311 .RB ` \-nomsgid '
312 .RB ` "\-messageid\ localname" '
313 .RB ` \-noverbose '
314 .RB ` \-nowatch '
315 .RB ` "\-width\ 72" '
316 .RB ` \-nofilter '
317 .fi
318 .SH CONTEXT
319 None
320 .SH BUGS
321 \*(lqReply\-To:\*(rq fields are allowed to have groups in them according
322 to the RFC 822 specification, but
323 .B post
324 won't let you use them.