]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/nedmail
ssh(1): initial documentation, needs examples for authentication
[plan9front.git] / sys / man / 1 / nedmail
1 .TH NEDMAIL 1
2 .SH NAME
3 nedmail \-  reading mail
4 .SH SYNOPSIS
5 .B upas/nedmail
6 [
7 .B -nr
8 ]
9 [
10 .B -f
11 .I mailfile
12 ]
13 [
14 .B -s
15 .I mailfile
16 ]
17 .PP
18 .B upas/nedmail
19 .B -c
20 .I dir
21 .SH DESCRIPTION
22 .I Nedmail
23 edits a mailbox.
24 The default mailbox is
25 .BI /mail/box/ username /mbox\f1.
26 The
27 .B -f
28 command line option specifies an alternate mailbox.
29 Unrooted path names are interpreted relative to
30 .BI /mail/box/ username.
31 If the
32 .I mailfile
33 argument is omitted, the name defaults to
34 .BR stored .
35 .PP
36 The options are:
37 .TF "-f mailfile"
38 .TP
39 .BI -c " dir
40 Create a mailbox.  If
41 .I dir
42 is specified, the new mailbox is created in
43 .BI /mail/box/ username / dir /mbox\f1.
44 Otherwise, the default mailbox is created.
45 .TP
46 .B -r
47 Reverse: show messages in first-in, first-out order; the default is last-in, first-out.
48 .TP
49 .B -n
50 Make the message numbers the same as the file names in the mail
51 box directory.  This implies the
52 .B -r
53 option.
54 .TP
55 .BI -f " mailfile"
56 Read messages from the specified file (see above) instead of the default mailbox.
57 .TP
58 .BI -s " mailfile"
59 Read a single message file
60 .IR mailfile ,
61 as produced by
62 .IR fs ,
63 and treat it as an entire mailbox.
64 This is provided for
65 use in plumbing rules; see
66 .IR faces (1).
67 .PD
68 .PP
69 .I Nedmail
70 starts by reading the mail box, printing out the number
71 of messages, and then prompting for commands from standard input.
72 Commands, as in
73 .IR ed (1),
74 are of the form
75 .RI `[ range ]
76 .I command
77 .RI [ arguments ]'.
78 The command is applied to each message in the (optional) range.
79 .PP
80 The address range can be:
81 .TP 1.4i
82 .I address
83 to indicate a single message header
84 .PD 0
85 .TP
86 .IB address , address
87 to indicate a range of contiguous message headers
88 .TP
89 .BI g/ expression /
90 to indicate all messages whose headers match the regular
91 .IR expression .
92 .TP
93 .BI g% expression %
94 to indicate all messages whose contents match the regular
95 .IR expression .
96 .PD
97 .PP
98 The addresses can be:
99 .TP 1.4i
100 .I number
101 to indicate a particular message
102 .PD 0
103 .TP
104 .IB address . number
105 to indicate a subpart of a particular message
106 .TP
107 .BI / expression /
108 to indicate the next message whose header matches
109 .I expression
110 .TP
111 .BI % expression %
112 to indicate the next message whose contents match
113 expression
114 .TP
115 .I "empty or .
116 to indicate the current message
117 .TP
118 .BI - address
119 to indicate backwards search or movement
120 .PD
121 .PP
122 Since messages in MIME are hierarchical
123 structures, in
124 .I nedmail
125 all the subparts are individually addressable.
126 For example if message 2 contains 3 attachments,
127 the attachments are numbered 2.1, 2.2, and 2.3.
128 .PP
129 The commands are:
130 .TP 1.1i
131 .BI a " args
132 Reply to all addresses in the
133 .BR To: ,
134 .BR From: ,
135 and
136 .BR Cc:
137 header lines.
138 .I Marshal
139 is used to format the reply and any arguments the
140 user specifies are added to the command line to
141 .I marshal
142 before the recipient.
143 The possibility of making a fool of yourself is very
144 high with this command.
145 .PD 0
146 .TP
147 .BI A " args
148 Like 
149 .B a
150 but with the message
151 appended to the reply.
152 .TP
153 .B b
154 Print the headers for the next ten messages.
155 .TP
156 .B d
157 Mark message to be deleted upon exiting
158 .IR nedmail .
159 .TP
160 .B f
161 Append the message to the file 
162 .BI /mail/box/ username / sendername
163 where
164 .I sendername
165 is the account name of the sender.
166 .TP
167 .B h
168 Print the disposition, size in characters, reception time, sender,
169 and subject of the message.
170 .TP
171 .B H
172 Print the MIME structure of the message.
173 .TP
174 .B help
175 Print a summary of the commands.
176 .TP
177 .BI m " person ...
178 Forward the message as a mime attachment to the named
179 .IR persons .
180 .TP
181 .BI M " person ...
182 Like
183 .B m
184 but allow the user to type in text to be included
185 with the forwarded message.
186 .TP
187 .B p
188 Print message.
189 An interrupt stops the printing.
190 .TP
191 .BI r " args
192 Reply to the sender of the message.
193 .I Marshal
194 is used to format the reply.
195 If any optional
196 .I args
197 are specified, they are added to the command line to
198 .I marshal
199 before the recipient's address.
200 .TP
201 .BI R " args 
202 Like
203 .B r
204 but with the original message included as an attachment.
205 .TP
206 .B rf
207 Like
208 .B r
209 but append the message and the reply to the file 
210 .BI /mail/box/ username / sendername
211 where
212 .I sendername
213 is the account name of the sender.
214 .TP
215 .B Rf
216 Like 
217 .B R
218 but append the message and the reply to the file 
219 .BI /mail/box/ username / sendername
220 where
221 .I sendername
222 is the account name of the sender.
223 .TP
224 .BI s " mfile"
225 Append the message to the specified mailbox.
226 If
227 .I mfile
228 doesn't start with a `/', it is interpreted relative to the directory in which the mailbox resides.
229 If
230 .I mfile
231 is a directory then the destination is a file in that directry.
232 If the MIME header specifies a file name, that one is used.
233 Otherwise, one is generated using
234 .IR mktemp (2)
235 and the string
236 .BR att.XXXXXXXXXXX .
237 .TP
238 .B q
239 Put undeleted mail back in the mailbox and stop.
240 .TP
241 EOT (control-D)
242 Same as 
243 .BR q .
244 .TP
245 .BI w " file
246 Same as
247 .B s
248 with the mail header line(s) stripped.  This can be used to
249 save binary mail bodies.
250 .TP
251 .B u
252 Remove mark for deletion.
253 .TP
254 .B x
255 Exit, without changing the mailbox file.
256 .TP
257 .B y
258 Synchronize with the mail box.  Any deleted
259 messages are purged and any new messages read.
260 This is equivalent to quiting nedmail and restarting.
261 .TP
262 .BI | command
263 Run the
264 .I command
265 with the message body as standard input.
266 .TP
267 .BI || command
268 Run the
269 .I command
270 with the whole message as standard input.
271 .TP
272 .BI ! command
273 Escape to the shell to do
274 .IR command .
275 .TP
276 .B \&=
277 Print the number of the current message.
278 .PD
279 .PP
280 Here's an example of a mail session that looks at a summary
281 of the mail messages, saves away an html file added as an
282 attachment to a message and then deletes the message:
283 .LP
284 .EX
285 % mail
286 7 messages
287 : ,h
288 1   H  2129     07/22 12:30  noone@madeup.net  "Add Up To 2000 free miles"
289 2       504     07/22 11:43  jmk
290 3   H   784     07/20 09:05  presotto
291 4       822     07/11 09:23  xxx@yyy.net  "You don't call, you don't write..."
292 5       193     07/06 16:55  presotto
293 6       529     06/01 19:42  jmk
294 7       798     09/02  2000  howard
295 : 1H
296 1       multipart/mixed             2129   from=noone@madeup.net
297  1.1      text/plain                115    
298  1.2      text/html                 1705   filename=northwest.htm
299 : 1.2w /tmp/northwest.html
300 !saved in /tmp/northwest.html
301 1.2: d
302 1: q
303 !1 message deleted
304
305 .EE
306 .PP
307 Notice that the delete of message 1.2 deleted the entire message and
308 not just the attachment.
309 .SH FILES
310 .TF /mail/box/*/dead.letter
311 .TP
312 .B /mail/box/*
313 mail directories
314 .TP
315 .B /mail/box/*/mbox
316 mailbox files
317 .TP
318 .B /mail/box/*/forward
319 forwarding address(es)
320 .TP
321 .B /mail/box/*/pipeto
322 mail filter
323 .TP
324 .B /mail/box/*/L.reading
325 mutual exclusion lock for multiple mbox readers
326 .TP
327 .B /mail/box/*/L.mbox
328 mutual exclusion lock for altering mbox
329 .SH SOURCE
330 .B /sys/src/cmd/upas/ned
331 .SH "SEE ALSO"
332 .IR mail (1),
333 .IR aliasmail (8),
334 .IR filter (1),
335 .IR marshal (1),
336 .IR mlmgr (1),
337 .IR nedmail (1),
338 .IR upasfs (4),
339 .IR smtp (8),
340 .IR faces (1),
341 .IR rewrite (6)