nedmail 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. An interrupt stops the printing.
  189. .TP
  190. .BI r " args
  191. Reply to the sender of the message.
  192. .I Marshal
  193. is used to format the reply.
  194. If and optional
  195. .I Args
  196. are specified, they are added to the command line to
  197. .I marshal
  198. before the recipient's address.
  199. .TP
  200. .B R " args
  201. Like
  202. .B r
  203. but with the original message included as an attachment.
  204. .TP
  205. .B rf
  206. Like
  207. .B r
  208. but append the message and the reply to the file
  209. .BI /mail/box/ username / sendername
  210. where
  211. .I sendername
  212. is the account name of the sender.
  213. .TP
  214. .B Rf
  215. Like
  216. .B R
  217. but append the message and the reply to the file
  218. .BI /mail/box/ username / sendername
  219. where
  220. .I sendername
  221. is the account name of the sender.
  222. .TP
  223. .BI s " mfile"
  224. Append the message to the specified mailbox.
  225. If
  226. .I mfile
  227. doesn't start with a `/', it is interpreted relative to the directory in which the mailbox resides.
  228. If
  229. .I mfile
  230. is a directory then the destination is a file in that directry.
  231. If the MIME header specifies a file name, that one is used.
  232. Otherwise, one is generated using
  233. .IR mktemp (2)
  234. and the string
  235. .BR att.XXXXXXXXXXX .
  236. .TP
  237. .B q
  238. Put undeleted mail back in the mailbox and stop.
  239. .TP
  240. EOT (control-D)
  241. Same as
  242. .BR q .
  243. .TP
  244. .BI w " file
  245. Same as
  246. .B s
  247. with the mail header line(s) stripped. This can be used to
  248. save binary mail bodies.
  249. .TP
  250. .B u
  251. Remove mark for deletion.
  252. .TP
  253. .B x
  254. Exit, without changing the mailbox file.
  255. .TP
  256. .B y
  257. Synchronize with the mail box. Any deleted
  258. messages are purged and any new messages read.
  259. This is equivalent to quiting nedmail and restarting.
  260. .TP
  261. .BI | command
  262. Run the
  263. .I command
  264. with the message body as standard input.
  265. .TP
  266. .BI || command
  267. Run the
  268. .I command
  269. with the whole 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. .SH FILES
  309. .TF /mail/box/*/dead.letter
  310. .TP
  311. .B /mail/box/*
  312. mail directories
  313. .TP
  314. .B /mail/box/*/mbox
  315. mailbox files
  316. .TP
  317. .B /mail/box/*/forward
  318. forwarding address(es)
  319. .TP
  320. .B /mail/box/*/pipeto
  321. mail filter
  322. .TP
  323. .B /mail/box/*/L.reading
  324. mutual exclusion lock for multiple mbox readers
  325. .TP
  326. .B /mail/box/*/L.mbox
  327. mutual exclusion lock for altering mbox
  328. .SH SOURCE
  329. .B /sys/src/cmd/upas/ned
  330. .SH "SEE ALSO"
  331. .IR mail (1),
  332. .IR aliasmail (8),
  333. .IR filter (1),
  334. .IR marshal (1),
  335. .IR mlmgr (1),
  336. .IR nedmail (1),
  337. .IR upasfs(4),
  338. .IR smtp (8),
  339. .IR faces (1),
  340. .IR rewrite (6)