Add support to inc for incorporting email from Maildir dropboxes.
[mmh] / man / inc.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH INC %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 inc \- incorporate new mail
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B inc
11 .RI [ +folder ]
12 .RB [ \-audit
13 .IR audit\-file ]
14 .RB [ \-noaudit ]
15 .RB [ \-changecur " | " \-nochangecur ]
16 .RB [ \-form
17 .IR formfile ]
18 .RB [ \-format
19 .IR string ]
20 .RB [ \-file
21 .IR name ]
22 .RB [ \-silent " | " \-nosilent ]
23 .RB [ \-truncate " | " \-notruncate ]
24 .RB [ \-width
25 .IR columns ]
26 %nmhbeginpop%
27 .RB [ \-host
28 .IR hostname ]
29 .RB [ \-user
30 .IR username ]
31 .RB [ \-pack
32 .IR file ]
33 .RB [ \-nopack ]
34 .RB [ \-proxy
35 .IR command ]
36 .RB [ \-sasl ]
37 .RB [ \-saslmech
38 .IR mechanism ]
39 .RB [ \-snoop ]
40 %nmhendpop%
41 .RB [ \-version ]
42 .RB [ \-help ]
43 .ad
44 .SH DESCRIPTION
45 .B Inc
46 incorporates mail from the user's incoming mail drop into
47 an
48 .B nmh
49 folder.
50 If the mail drop is a file, it can be in
51 .B mbox
52 or
53 .B MMDF
54 format.
55 If the mail drop is a directory it will considered to be a
56 .B Maildir
57 format mail drop.
58 .PP
59 You may specify which folder to use with
60 .IR +folder .
61 If no folder is specified, then
62 .B inc
63 will use either the folder given by a (non\-empty)
64 .RI \*(lq Inbox \*(rq
65 entry in the user's profile, or the folder named
66 .RI \*(lq inbox \*(rq.
67 If the specified (or default) folder doesn't
68 exist, the user will be queried prior to its creation.
69 .PP
70 When the new messages are incorporated into the folder, they are assigned
71 numbers starting with the next highest number for the folder.  As the
72 messages are processed, a
73 .B scan
74 listing of the new mail is produced.
75 .PP
76 If the user's profile contains a
77 .RI \*(lq "Msg\-Protect: nnn" \*(rq
78 entry, it
79 will be used as the protection on the newly created messages, otherwise
80 the
81 .B nmh
82 default of 0644 will be used.  For all subsequent operations
83 on these messages, this initially assigned protection will be preserved.
84 .PP
85 If the switch
86 .B \-audit
87 .I audit\-file
88 is specified (usually as a default
89 switch in the profile), then
90 .B inc
91 will append a header line and a
92 line per message to the end of the specified audit\-file with the format:
93 .PP
94 .RS 5
95 .nf
96 <<inc>> date
97 <scan line for first message>
98 <scan line for second message>
99 <etc.>
100 .fi
101 .RE
102 .PP
103 This is useful for keeping track of volume and source of incoming mail.
104 Eventually,
105 .BR repl ,
106 .BR forw ,
107 .BR comp ,
108 and
109 .B dist
110 may also produce audits to this (or another) file, perhaps with
111 .RI \*(lq Message\-Id \*(rq
112 information to keep an exact correspondence
113 history.
114 .RI \*(lq Audit\-file \*(rq
115 will be in the user's nmh directory unless a full path is specified.
116 .PP
117 .B Inc
118 will incorporate even improperly formatted messages into the
119 user's nmh folder, inserting a blank line prior to the offending component
120 and printing a comment identifying the bad message.
121 .PP
122 In all cases, the user's mail drop will be zeroed, unless the
123 .B \-notruncate
124 switch is given.
125 .PP
126 If the profile entry
127 .RI \*(lq Unseen\-Sequence \*(rq
128 is present and non\-empty, then
129 .B inc
130 will add each of the newly incorporated messages to
131 each sequence named by the profile entry.
132 .B Inc
133 will not zero each sequence prior to adding messages.
134 .PP
135 The interpretation of the
136 .B \-form
137 .IR formatfile ,
138 .B \-format
139 .IR string ,
140 and
141 .B \-width
142 .I columns
143 switches is the same as in
144 .BR scan .
145 .PP
146 By using the
147 .B \-file
148 .I name
149 switch, one can direct
150 .B inc
151 to incorporate messages from a file other than the user's maildrop.
152 Note that the name file will NOT be zeroed, unless the
153 .B \-truncate
154 switch is given.
155 .PP
156 If the environment variable
157 .B $MAILDROP
158 is set, then
159 .B inc
160 uses it as the location of the user's maildrop instead of the default
161 (the
162 .B -file
163 .I name
164 switch still overrides this, however).  If this
165 environment variable is not set, then
166 .B inc
167 will consult the profile entry
168 .RI \*(lq MailDrop \*(rq
169 for this information.  If the value found is
170 not absolute, then it is interpreted relative to the user's
171 .B nmh
172 directory.  If the value is not found, then
173 .B inc
174 will look in the standard system location for the user's maildrop.
175 .PP
176 The
177 .B \-silent
178 switch directs
179 .B inc
180 to be quiet and not ask any questions at all.  This is useful for putting
181 .B inc
182 in the background and going on to other things.
183 %nmhbeginpop%
184 .PP
185 .SS "Using POP"
186 .B inc
187 will normally check local mail drops for mail, as covered above.  But
188 if the option
189 .RI \*(lq pophost \*(rq
190 is set in
191 .RI \*(lq mts.conf \*(rq,
192 or if the
193 .B \-host
194 .I hostname
195 switch is given, or if the
196 .B $MAILHOST
197 environment variable is set, then
198 .B inc
199 will query this POP service host for mail to incorporate.  If
200 .B $MAILHOST
201 is set and
202 .B \-host
203 is specified as well, the commandline switch will override
204 the environment variable.
205 .PP
206 The default is for
207 .B inc
208 to assume that your account name on
209 the POP server is the same as your current username.  To specify
210 a different username, use the
211 .B \-user
212 .I username
213 switch.
214 .PP
215 When using POP, you will normally need to type the password for
216 your account on the POP server, in order to retrieve your messages.
217 It is possible to automate this process by creating a
218 .RI \*(lq .netrc \*(rq
219 file containing your login account information for this POP server.
220 For each POP server, this file should have a line of the following
221 form.  Replace the words
222 .IR mypopserver ,
223 .IR mylogin ,
224 and
225 .I mypassword
226 with your own account information.
227 .PP
228 .RS 5
229 .B machine
230 .I mypopserver
231 .B login
232 .I mylogin
233 .B password
234 .I mypassword
235 .RE
236 .PP
237 This
238 .RI \*(lq .netrc \*(rq
239 file should be owned and readable only by you.
240 .PP
241 If passed the
242 .B \-proxy
243 .I command
244 switch,
245 .B inc
246 will use the specified command to establish the connection to the POP
247 server. The string
248 .IR %h
249 in the command will be substituted by the hostname to connect to.
250 .PP
251 If
252 .B inc
253 uses POP, then the
254 .B \-pack
255 .I file
256 switch is considered. If given, then
257 .B inc
258 simply uses the POP to
259 .B packf
260 the user's maildrop from the POP service host to the named file.  This switch
261 is provided for those users who prefer to use
262 .B msh
263 to read their maildrops.
264 .PP
265 For debugging purposes, you may give the switch
266 .BR \-snoop ,
267 which will allow you to watch the POP transaction take place
268 between you and the POP server.
269 .PP
270 If
271 .B nmh
272 has been compiled with SASL support, the
273 .B \-sasl
274 switch will enable
275 the use of SASL authentication.  Depending on the SASL mechanism used, this
276 may require an additional password prompt from the user (but the
277 .RI \*(lq .netrc \*(rq
278 file can be used to store this password).  The
279 .B \-saslmech
280 switch can be used to select a particular SASL mechanism.
281 .PP
282 If SASL authentication is successful,
283 .B inc
284 will attempt to negotiate a security layer for session encryption.
285 Encrypted traffic is labelled with `(encrypted)' and `(decrypted)'
286 when viewing the POP transaction with the
287 .B \-snoop
288 switch.
289 %nmhendpop%
290
291 .SH FILES
292 .fc ^ ~
293 .nf
294 .ta \w'%etcdir%/ExtraBigFileName  'u
295 ^$HOME/\&.mh\(ruprofile~^The user profile
296 ^%etcdir%/mts.conf~^nmh mts configuration file
297 ^%mailspool%/$USER~^Location of mail drop
298 .fi
299
300 .SH "PROFILE COMPONENTS"
301 .fc ^ ~
302 .nf
303 .ta 2.4i
304 .ta \w'ExtraBigProfileName  'u
305 ^Path:~^To determine the user's nmh directory
306 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
307 ^Inbox:~^To determine the inbox, default \*(lqinbox\*(rq
308 ^Folder\-Protect:~^To set mode when creating a new folder
309 ^Msg\-Protect:~^To set mode when creating a new message and audit\-file
310 ^Unseen\-Sequence:~^To name sequences denoting unseen messages
311 .fi
312
313 .SH "SEE ALSO"
314 mhmail(1), scan(1), mh\-mail(5), post(8)
315
316 .SH DEFAULTS
317 .nf
318 .RB ` +folder "' defaulted by \*(lqInbox\*(rq above"
319 .RB ` \-noaudit '
320 .RB ` \-changecur '
321 .RB ` \-format "' defaulted as described above"
322 .RB ` \-nosilent '
323 .RB ` \-truncate "' if `" \-file " name' not given, `" \-notruncate "' otherwise"
324 .RB ` \-width "' defaulted to the width of the terminal"
325 %nmhbeginpop%
326 .RB ` \-nopack '
327 %nmhendpop%
328 .fi
329
330 .SH CONTEXT
331 The folder into which messages are being incorporated will become the
332 current folder.  The first message incorporated will become the current
333 message, unless the
334 .B \-nochangecur
335 option is specified.  This leaves the context ready for a
336 .B show
337 of the first new message.
338
339 .SH BUGS
340 The argument to the
341 .B \-format
342 switch must be interpreted as a single
343 token by the shell that invokes
344 .BR inc .
345 Therefore, one must usually place the argument to this switch inside
346 double\-quotes.