nedmail 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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. If
  247. .I mfile
  248. is a directory then the destination is a file in that directry.
  249. If the MIME header specifies a file name, that one is used.
  250. Otherwise, one is generated using
  251. .IR mktemp (2)
  252. and the string
  253. .BR att.XXXXXXXXXXX .
  254. .TP
  255. .B q
  256. Put undeleted mail back in the mailbox and stop.
  257. .TP
  258. EOT (control-D)
  259. Same as
  260. .BR q .
  261. .TP
  262. .BI w " file
  263. Same as
  264. .B s
  265. with the mail header line(s) stripped. This can be used to
  266. save binary mail bodies.
  267. .TP
  268. .B u
  269. Remove mark for deletion.
  270. .TP
  271. .B x
  272. Exit, without changing the mailbox file.
  273. .TP
  274. .B y
  275. Synchronize with the mail box. Any deleted
  276. messages are purged and any new messages read.
  277. This is equivalent to quiting nedmail and restarting.
  278. .TP
  279. .BI | command
  280. Run the
  281. .I command
  282. with the message body as standard input.
  283. .TP
  284. .BI || command
  285. Run the
  286. .I command
  287. with the whole message as standard input.
  288. .TP
  289. .BI ! command
  290. Escape to the shell to do
  291. .IR command .
  292. .TP
  293. .B \&=
  294. Print the number of the current message.
  295. .PD
  296. .PP
  297. Here's an example of a mail session that looks at a summary
  298. of the mail messages, saves away an html file added as an
  299. attachment to a message and then deletes the message:
  300. .LP
  301. .EX
  302. % mail
  303. 7 messages
  304. : ,h
  305. 1 H 2129 07/22 12:30 noone@madeup.net "Add Up To 2000 free miles"
  306. 2 504 07/22 11:43 jmk
  307. 3 H 784 07/20 09:05 presotto
  308. 4 822 07/11 09:23 xxx@yyy.net "You don't call, you don't write..."
  309. 5 193 07/06 16:55 presotto
  310. 6 529 06/01 19:42 jmk
  311. 7 798 09/02 2000 howard
  312. : 1H
  313. 1 multipart/mixed 2129 from=noone@madeup.net
  314. 1.1 text/plain 115
  315. 1.2 text/html 1705 filename=northwest.htm
  316. : 1.2w /tmp/northwest.html
  317. !saved in /tmp/northwest.html
  318. 1.2: d
  319. 1: q
  320. !1 message deleted
  321. %
  322. .EE
  323. .PP
  324. Notice that the delete of message 1.2 deleted the entire message and
  325. not just the attachment.
  326. .SS "Mime File system
  327. .PP
  328. .I Fs
  329. is a user level file system that reads mailboxes and presents them as a file
  330. system.
  331. A user normally starts
  332. .I fs
  333. in his/her profile after starting
  334. .IR plumber (4)
  335. and before starting
  336. a window system, such as
  337. .IR rio (1)
  338. or
  339. .IR acme (1).
  340. The file system is used by
  341. .I nedmail
  342. and
  343. .IR acme (1)'s
  344. mail reader to parse messages.
  345. .I Fs
  346. also generates plumbing messages used by
  347. .IR biff
  348. and
  349. .IR faces (1)
  350. to provide mail announcements.
  351. .PP
  352. The mailbox itself becomes a directory under
  353. .BR /mail/fs .
  354. Each message in the mailbox becomes a numbered directory in the
  355. mailbox directory, and each attachment becomes a numbered directory
  356. in the message directory. Since an attachment may itself be a mail message,
  357. this structure can recurse ad nauseam.
  358. .PP
  359. Each message and attachment directory contains the files:
  360. .TP 1.4i
  361. .B body
  362. .PD 0
  363. the message minus the RFC822 style headers
  364. .TP
  365. .B cc
  366. the address(es) from the CC: header
  367. .TP
  368. .B date
  369. the date in the message, or if none, the time of delivery
  370. .TP
  371. .B digest
  372. an SHA1 digest of the message contents
  373. .TP
  374. .B disposition
  375. .B inline
  376. or
  377. .B file
  378. .TP
  379. .B filename
  380. a name to use to file an attachment
  381. .TP
  382. .B from
  383. the from address in the From: header, or if none,
  384. the address on the envelope.
  385. .TP
  386. .B header
  387. the RFC822 headers
  388. .TP
  389. .B info
  390. described below, essentially a summary of the header info
  391. .TP
  392. .B inreplyto
  393. contents of the
  394. .B in-reply-to:
  395. header
  396. .TP
  397. .B mimeheader
  398. the mime headers
  399. .TP
  400. .B raw
  401. the undecoded MIME message
  402. .TP
  403. .B rawbody
  404. the undecoded message body
  405. .TP
  406. .B rawheader
  407. the undecoded message header
  408. .TP
  409. .B replyto
  410. the address to send any replies to.
  411. .TP
  412. .B subject
  413. the contents of the subject line
  414. .TP
  415. .B to
  416. the address(es) from the To: line.
  417. .TP
  418. .B type
  419. the MIME content type
  420. .TP
  421. .B unixheader
  422. the envelope header from the mailbox
  423. .PD
  424. .PP
  425. The
  426. .B info
  427. file contains the following information, one item per line. Lists
  428. of addresses are single space separated.
  429. .IP
  430. .TP 2i
  431. .I "sender address
  432. .PD 0
  433. .TP
  434. .I "recipient addresses
  435. .TP
  436. .I "cc addresses
  437. .TP
  438. .I "reply address
  439. .TP
  440. .I "envelope date
  441. .TP
  442. .I "subject
  443. .TP
  444. .I "MIME content type
  445. .TP
  446. .I "MIME disposition
  447. .TP
  448. .I filename
  449. .TP
  450. .I "SHA1 digest
  451. .TP
  452. .I "bcc addresses
  453. .TP
  454. .I "in-reply-to: contents
  455. .TP
  456. .I "RFC822 date
  457. .TP
  458. .I "message senders
  459. .TP
  460. .I "message id
  461. .TP
  462. .I "number of lines in body
  463. .PD
  464. .PP
  465. Deleting message directories causes the message to be removed from
  466. the mailbox.
  467. .PP
  468. The mailbox is reread and the structure updated
  469. whenever the mailbox changes. Message directories are
  470. not renumbered.
  471. .PP
  472. The file
  473. .B /mail/fs/ctl
  474. is used to direct
  475. .I fs
  476. to open/close new mailboxes or to delete groups of messages atomically.
  477. The messages that can be written to this file are:
  478. .TP 2i
  479. .PD 0
  480. .B "open \fIpath mboxname\fP
  481. opens a new mailbox.
  482. .I path
  483. is the file to open, and
  484. .I mboxname
  485. is the name that appears under
  486. .BR /mail/fs .
  487. .TP
  488. .B "close \fImboxname\fP
  489. close
  490. .IR mboxname .
  491. The close takes affect only after all files open under
  492. .BI /mail/fs/ mboxname
  493. have been closed.
  494. .TP
  495. .B "delete \fImboxname number ...\fP
  496. Delete the messages with the given numbers from
  497. .IR mboxname.
  498. .PD
  499. .PP
  500. The options are:
  501. .TF "-f file
  502. .TP
  503. .BI -f file
  504. use
  505. .I file
  506. as the mailbox instead of the default,
  507. .BI /mail/box/ username /mbox.
  508. .PD 0
  509. .TP
  510. .B -b
  511. stands for biffing. Each time new mail
  512. is received, a message is printed to standard
  513. output containing the sender address, subject,
  514. and number of bytes. It is intended for
  515. people telnetting in who want mail announcements.
  516. .TP
  517. .B -n
  518. Don't open a mailbox initially. Overridden by -f.
  519. .TP
  520. .B -p
  521. turn off plumbing. Unless this is specified,
  522. .I fs
  523. sends a message to the plumb port,
  524. .BR seemail ,
  525. from source
  526. .B mailfs
  527. for each message received or deleted.
  528. The message contains the attributes
  529. .IR sender = "<contents of from file>" ,
  530. .IR filetype =mail,
  531. .IR mailtype = "deleted or new" ,
  532. and
  533. .IR length = "<message length in bytes>" .
  534. The contents of the message is the full path
  535. name of the directory representing the message.
  536. .TP
  537. .B -s
  538. causes
  539. .I fs
  540. to put itself in
  541. .B /srv
  542. with a name of the form
  543. .BR /srv/upasfs.\fIuser\fP .
  544. .TP
  545. .B -m
  546. specifies a mount point other than
  547. .BR /mail/fs .
  548. .PD
  549. .PP
  550. .I Fs
  551. will exit once all references to its directory
  552. have disappeared.
  553. .SH FILES
  554. .TF /mail/box/*/dead.letter
  555. .TP
  556. .B /sys/log/mail
  557. mail log file
  558. .TP
  559. .B /mail/box/*
  560. mail directories
  561. .TP
  562. .B /mail/box/*/mbox
  563. mailbox files
  564. .TP
  565. .B /mail/box/*/forward
  566. forwarding address(es)
  567. .TP
  568. .B /mail/box/*/pipeto
  569. mail filter
  570. .TP
  571. .B /mail/box/*/L.reading
  572. mutual exclusion lock for multiple mbox readers
  573. .TP
  574. .B /mail/box/*/L.mbox
  575. mutual exclusion lock for altering mbox
  576. .TP
  577. .B /lib/face/48x48x?
  578. directories of icons for
  579. .I seemail
  580. .SH SOURCE
  581. .TF /sys/src/cmd/upas
  582. .TP
  583. .B /rc/bin/mail
  584. .TP
  585. .B /sys/src/cmd/upas
  586. source for commands in
  587. .B /bin/upas
  588. .TP
  589. .B /sys/src/cmd/faces
  590. .TP
  591. .B /rc/bin/vwhois
  592. .SH "SEE ALSO"
  593. .IR mail (1),
  594. .IR aliasmail (8),
  595. .IR filter (1),
  596. .IR marshal (1),
  597. .IR mlmgr (1),
  598. .IR nedmail (1),
  599. .IR smtp (8),
  600. .IR faces (1),
  601. .IR rewrite (6)