nedmail 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. .TH NEDMAIL 1
  2. .SH NAME
  3. nedmail, fs \- reading mail
  4. .PP
  5. .B upas/nedmail
  6. [
  7. .B -c [dir]
  8. ]
  9. [
  10. .B -r
  11. ]
  12. [
  13. .B -n
  14. ]
  15. [
  16. .B -f
  17. .I mailfile
  18. ]
  19. [
  20. .B -s
  21. .I mailfile
  22. ]
  23. .PP
  24. .B upas/fs
  25. [
  26. .B -f
  27. .I mailbox
  28. ]
  29. [
  30. .B -b
  31. ]
  32. [
  33. .B -n
  34. ]
  35. [
  36. .B -p
  37. ]
  38. .SH DESCRIPTION
  39. .SS "Reading Mail
  40. .I Nedmail
  41. edits a mailbox.
  42. The default mailbox is
  43. .BI /mail/box/ username /mbox\f1.
  44. The
  45. .B -f
  46. command line option specifies an alternate mailbox.
  47. Unrooted path names are interpreted relative to
  48. .BI /mail/box/ username.
  49. If the
  50. .I mailfile
  51. argument is omitted, the name defaults to
  52. .BR stored .
  53. .PP
  54. The options are:
  55. .TF "-f mailfile"
  56. .TP
  57. .BI -c " dir
  58. Create a mailbox. If
  59. .I dir
  60. is specified, the new mailbox is created in
  61. .BI /mail/box/ username / dir /mbox\f1.
  62. Otherwise, the default mailbox is created.
  63. .TP
  64. .B -r
  65. Reverse: show messages in first-in, first-out order; the default is last-in, first-out.
  66. .TP
  67. .B -n
  68. Make the message numbers the same as the file names in the mail
  69. box directory. This implies the
  70. .B -r
  71. option.
  72. .TP
  73. .BI -f " mailfile"
  74. Read messages from the specified file (see above) instead of the default mailbox.
  75. .TP
  76. .BI -s " mailfile"
  77. Read a single message file
  78. .IR mailfile ,
  79. as produced by
  80. .IR fs ,
  81. and treat it as an entire mailbox.
  82. This is provided for
  83. use in plumbing rules; see
  84. .IR faces (1).
  85. .PD
  86. .PP
  87. .I Nedmail
  88. starts by reading the mail box, printing out the number
  89. of messages, and then prompting for commands from standard input.
  90. Commands, as in
  91. .IR ed (1),
  92. are of the form
  93. .RI `[ range ]
  94. .I command
  95. .RI [ arguments ]'.
  96. The command is applied to each message in the (optional) range.
  97. .PP
  98. The address range can be:
  99. .TP 1.4i
  100. .I address
  101. to indicate a single message header
  102. .PD 0
  103. .TP
  104. .IB address , address
  105. to indicate a range of contiguous message headers
  106. .TP
  107. .BI g/ expression /
  108. to indicate all messages whose headers match the regular
  109. .IR expression .
  110. .TP
  111. .BI g% expression %
  112. to indicate all messages whose contents match the regular
  113. .IR expression .
  114. .PD
  115. .PP
  116. The addresses can be:
  117. .TP 1.4i
  118. .I number
  119. to indicate a particular message
  120. .PD 0
  121. .TP
  122. .IB address . number
  123. to indicate a subpart of a particular message
  124. .TP
  125. .BI / expression /
  126. to indicate the next message whose header matches
  127. .I expression
  128. .TP
  129. .BI % expression %
  130. to indicate the next message whose contents match
  131. expression
  132. .TP
  133. .I "empty or .
  134. to indicate the current message
  135. .TP
  136. .BI - address
  137. to indicate backwards search or movement
  138. .PD
  139. .PP
  140. Since messages in MIME are hierarchical
  141. structures, in
  142. .I nedmail
  143. all the subparts are individually addressable.
  144. For example if message 2 contains 3 attachments,
  145. the attachments are numbered 2.1, 2.2, and 2.3.
  146. .PP
  147. The commands are:
  148. .TP 1.1i
  149. .BI a " args
  150. Reply to all addresses in the
  151. .BR To: ,
  152. .BR From: ,
  153. and
  154. .BR Cc:
  155. header lines.
  156. .I Marshal
  157. is used to format the reply and any arguments the
  158. user specifies are added to the command line to
  159. .I marshal
  160. before the recipient.
  161. The possibility of making a fool of yourself is very
  162. high with this command.
  163. .PD 0
  164. .TP
  165. .BI A " args
  166. Like
  167. .B a
  168. but with the message
  169. appended to the reply.
  170. .TP
  171. .B b
  172. Print the headers for the next ten messages.
  173. .TP
  174. .B d
  175. Mark message to be deleted upon exiting
  176. .IR nedmail .
  177. .TP
  178. .B f
  179. Append the message to the file
  180. .BI /mail/box/ username / sendername
  181. where
  182. .I sendername
  183. is the account name of the sender.
  184. .TP
  185. .B h
  186. Print the disposition, size in characters, reception time, sender,
  187. and subject of the message.
  188. .TP
  189. .B H
  190. Print the MIME structure of the message.
  191. .TP
  192. .B help
  193. Print a summary of the commands.
  194. .TP
  195. .BI m " person ...
  196. Forward the message as a mime attachment to the named
  197. .IR persons .
  198. .TP
  199. .BI M " person ...
  200. Like
  201. .B m
  202. but allow the user to type in text to be included
  203. with the forwarded message.
  204. .TP
  205. .B p
  206. Print message. An interrupt stops the printing.
  207. .TP
  208. .BI r " args
  209. Reply to the sender of the message.
  210. .I Marshal
  211. is used to format the reply.
  212. If and optional
  213. .I Args
  214. are specified, they are added to the command line to
  215. .I marshal
  216. before the recipient's address.
  217. .TP
  218. .B R " args
  219. Like
  220. .B r
  221. but with the original message included as an attachment.
  222. .TP
  223. .B rf
  224. Like
  225. .B r
  226. but append the message and the reply to the file
  227. .BI /mail/box/ username / sendername
  228. where
  229. .I sendername
  230. is the account name of the sender.
  231. .TP
  232. .B Rf
  233. Like
  234. .B R
  235. but append the message and the reply to the file
  236. .BI /mail/box/ username / sendername
  237. where
  238. .I sendername
  239. is the account name of the sender.
  240. .TP
  241. .BI s " mfile"
  242. Append the message to the specified mailbox.
  243. If
  244. .I mfile
  245. doesn't start with a `/', it is interpreted relative to the directory in which the mailbox resides.
  246. .TP
  247. .B q
  248. Put undeleted mail back in the mailbox and stop.
  249. .TP
  250. EOT (control-D)
  251. Same as
  252. .BR q .
  253. .TP
  254. .BI w " file
  255. Same as
  256. .B s
  257. with the mail header line(s) stripped. This can be used to
  258. save binary mail bodies.
  259. .TP
  260. .B u
  261. Remove mark for deletion.
  262. .TP
  263. .B x
  264. Exit, without changing the mailbox file.
  265. .TP
  266. .BI | command
  267. Run the
  268. .I command
  269. with the message as standard input.
  270. .TP
  271. .BI ! command
  272. Escape to the shell to do
  273. .IR command .
  274. .TP
  275. .B \&=
  276. Print the number of the current message.
  277. .PD
  278. .PP
  279. Here's an example of a mail session that looks at a summary
  280. of the mail messages, saves away an html file added as an
  281. attachment to a message and then deletes the message:
  282. .LP
  283. .EX
  284. % mail
  285. 7 messages
  286. : ,h
  287. 1 H 2129 07/22 12:30 noone@madeup.net "Add Up To 2000 free miles"
  288. 2 504 07/22 11:43 jmk
  289. 3 H 784 07/20 09:05 presotto
  290. 4 822 07/11 09:23 xxx@yyy.net "You don't call, you don't write..."
  291. 5 193 07/06 16:55 presotto
  292. 6 529 06/01 19:42 jmk
  293. 7 798 09/02 2000 howard
  294. : 1H
  295. 1 multipart/mixed 2129 from=noone@madeup.net
  296. 1.1 text/plain 115
  297. 1.2 text/html 1705 filename=northwest.htm
  298. : 1.2w /tmp/northwest.html
  299. !saved in /tmp/northwest.html
  300. 1.2: d
  301. 1: q
  302. !1 message deleted
  303. %
  304. .EE
  305. .PP
  306. Notice that the delete of message 1.2 deleted the entire message and
  307. not just the attachment.
  308. .SS "Mime File system
  309. .PP
  310. .I Fs
  311. is a user level file system that reads mailboxes and presents them as a file
  312. system.
  313. A user normally starts
  314. .I fs
  315. in his/her profile after starting
  316. .IR plumber (4)
  317. and before starting
  318. a window system, such as
  319. .IR rio (1)
  320. or
  321. .IR acme (1).
  322. The file system is used by
  323. .I nedmail
  324. and
  325. .IR acme (1)'s
  326. mail reader to parse messages.
  327. .I Fs
  328. also generates plumbing messages used by
  329. .IR biff
  330. and
  331. .IR faces (1)
  332. to provide mail announcements.
  333. .PP
  334. The mailbox itself becomes a directory under
  335. .BR /mail/fs .
  336. Each message in the mailbox becomes a numbered directory in the
  337. mailbox directory, and each attachment becomes a numbered directory
  338. in the message directory. Since an attachment may itself be a mail message,
  339. this structure can recurse ad nauseam.
  340. .PP
  341. Each message and attachment directory contains the files:
  342. .TP 1.4i
  343. .B body
  344. .PD 0
  345. the message minus the RFC822 style headers
  346. .TP
  347. .B cc
  348. the address(es) from the CC: header
  349. .TP
  350. .B date
  351. the date in the message, or if none, the time of delivery
  352. .TP
  353. .B digest
  354. an SHA1 digest of the message contents
  355. .TP
  356. .B disposition
  357. .B inline
  358. or
  359. .B file
  360. .TP
  361. .B filename
  362. a name to use to file an attachment
  363. .TP
  364. .B from
  365. the from address in the From: header, or if none,
  366. the address on the envelope.
  367. .TP
  368. .B header
  369. the RFC822 headers
  370. .TP
  371. .B info
  372. described below, essentially a summary of the header info
  373. .TP
  374. .B inreplyto
  375. contents of the
  376. .B in-reply-to:
  377. header
  378. .TP
  379. .B mimeheader
  380. the mime headers
  381. .TP
  382. .B raw
  383. the undecoded MIME message
  384. .TP
  385. .B rawbody
  386. the undecoded message body
  387. .TP
  388. .B rawheader
  389. the undecoded message header
  390. .TP
  391. .B replyto
  392. the address to send any replies to.
  393. .TP
  394. .B subject
  395. the contents of the subject line
  396. .TP
  397. .B to
  398. the address(es) from the To: line.
  399. .TP
  400. .B type
  401. the MIME content type
  402. .TP
  403. .B unixheader
  404. the envelope header from the mailbox
  405. .PD
  406. .PP
  407. The
  408. .B info
  409. file contains the following information, one item per line. Lists
  410. of addresses are single space separated.
  411. .IP
  412. .TP 2i
  413. .I "sender address
  414. .PD 0
  415. .TP
  416. .I "recipient addresses
  417. .TP
  418. .I "cc addresses
  419. .TP
  420. .I "reply address
  421. .TP
  422. .I "envelope date
  423. .TP
  424. .I "subject
  425. .TP
  426. .I "MIME content type
  427. .TP
  428. .I "MIME disposition
  429. .TP
  430. .I filename
  431. .TP
  432. .I "SHA1 digest
  433. .TP
  434. .I "bcc addresses
  435. .TP
  436. .I "in-reply-to: contents
  437. .TP
  438. .I "RFC822 date
  439. .TP
  440. .I "message senders
  441. .TP
  442. .I "message id
  443. .TP
  444. .I "number of lines in body
  445. .PD
  446. .PP
  447. Deleting message directories causes the message to be removed from
  448. the mailbox.
  449. .PP
  450. The mailbox is reread and the structure updated
  451. whenever the mailbox changes. Message directories are
  452. not renumbered.
  453. .PP
  454. The file
  455. .B /mail/fs/ctl
  456. is used to direct
  457. .I fs
  458. to open/close new mailboxes or to delete groups of messages atomically.
  459. The messages that can be written to this file are:
  460. .TP 2i
  461. .PD 0
  462. .B "open \fIpath mboxname\fP
  463. opens a new mailbox.
  464. .I path
  465. is the file to open, and
  466. .I mboxname
  467. is the name that appears under
  468. .BR /mail/fs .
  469. .TP
  470. .B "close \fImboxname\fP
  471. close
  472. .IR mboxname .
  473. The close takes affect only after all files open under
  474. .BI /mail/fs/ mboxname
  475. have been closed.
  476. .TP
  477. .B "delete \fImboxname number ...\fP
  478. Delete the messages with the given numbers from
  479. .IR mboxname.
  480. .PD
  481. .PP
  482. The options are:
  483. .TF "-f file
  484. .TP
  485. .BI -f file
  486. use
  487. .I file
  488. as the mailbox instead of the default,
  489. .BI /mail/box/ username /mbox.
  490. .PD 0
  491. .TP
  492. .B -b
  493. stands for biffing. Each time new mail
  494. is received, a message is printed to standard
  495. output containing the sender address, subject,
  496. and number of bytes. It is intended for
  497. people telnetting in who want mail announcements.
  498. .TP
  499. .B -n
  500. Don't open a mailbox initially. Overridden by -f.
  501. .TP
  502. .B -p
  503. turn off plumbing. Unless this is specified,
  504. .I fs
  505. sends a message to the plumb port,
  506. .BR seemail ,
  507. from source
  508. .B mailfs
  509. for each message received or deleted.
  510. The message contains the attributes
  511. .IR sender = "<contents of from file>" ,
  512. .IR filetype =mail,
  513. .IR mailtype = "deleted or new" ,
  514. and
  515. .IR length = "<message length in bytes>" .
  516. The contents of the message is the full path
  517. name of the directory representing the message.
  518. .TP
  519. .B -s
  520. causes
  521. .I fs
  522. to put itself in
  523. .B /srv
  524. with a name of the form
  525. .BR /srv/upasfs.\fIuser\fP .
  526. .TP
  527. .B -m
  528. specifies a mount point other than
  529. .BR /mail/fs .
  530. .PD
  531. .PP
  532. .I Fs
  533. will exit once all references to its directory
  534. have disappeared.
  535. .SH FILES
  536. .TF /mail/box/*/dead.letter
  537. .TP
  538. .B /sys/log/mail
  539. mail log file
  540. .TP
  541. .B /mail/box/*
  542. mail directories
  543. .TP
  544. .B /mail/box/*/mbox
  545. mailbox files
  546. .TP
  547. .B /mail/box/*/forward
  548. forwarding address(es)
  549. .TP
  550. .B /mail/box/*/pipeto
  551. mail filter
  552. .TP
  553. .B /mail/box/*/L.reading
  554. mutual exclusion lock for multiple mbox readers
  555. .TP
  556. .B /mail/box/*/L.mbox
  557. mutual exclusion lock for altering mbox
  558. .TP
  559. .B /lib/face/48x48x?
  560. directories of icons for
  561. .I seemail
  562. .SH SOURCE
  563. .TF /sys/src/cmd/upas
  564. .TP
  565. .B /rc/bin/mail
  566. .TP
  567. .B /sys/src/cmd/upas
  568. source for commands in
  569. .B /bin/upas
  570. .TP
  571. .B /sys/src/cmd/faces
  572. .TP
  573. .B /rc/bin/vwhois
  574. .SH "SEE ALSO"
  575. .IR mail (1),
  576. .IR aliasmail (8),
  577. .IR filter (1),
  578. .IR marshal (1),
  579. .IR mlmgr (1),
  580. .IR nedmail (1),
  581. .IR smtp (8),
  582. .IR faces (1),
  583. .IR rewrite (6)