smtp 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. .TH SMTP 8
  2. .SH NAME
  3. smtp, smtpd \- mail transport
  4. .SH SYNOPSIS
  5. .in +0.5i
  6. .ti -0.5i
  7. .B upas/smtp
  8. [
  9. .B -aAdfips
  10. ] [
  11. .B -b
  12. .I busted-mx
  13. ] ... [
  14. .B -g
  15. .I gateway
  16. ] [
  17. .B -h
  18. .I host
  19. ] [
  20. .B -u
  21. .I user
  22. ] [
  23. .BI . domain
  24. ]
  25. .I destaddr
  26. .I sender
  27. .I rcpt-list
  28. .in -0.5i
  29. .PP
  30. .in +0.5i
  31. .ti -0.5i
  32. .B upas/smtpd
  33. [
  34. .B -adDfrg
  35. ] [
  36. .B -c
  37. .I certfile
  38. ] [
  39. .B -h
  40. .I mydom
  41. ] [
  42. .B -k
  43. .I evilipaddr
  44. ] [
  45. .B -m
  46. .I mailer
  47. ] [
  48. .B -n
  49. .I netdir
  50. ]
  51. .in -0.5i
  52. .SH DESCRIPTION
  53. .I Smtp
  54. sends the mail message from standard input
  55. to the users
  56. .I rcpt-list
  57. on the host at network address
  58. .I address
  59. using the Simple Mail Transfer Protocol.
  60. The options are:
  61. .TF -
  62. .PD
  63. .TP
  64. .B -a
  65. if the server supports PLAIN or LOGIN authentication,
  66. authenticate to the server using a password from
  67. .IR factotum (4).
  68. See RFCs 3207 and 2554.
  69. This option implies
  70. .BR -s .
  71. .TP
  72. .B -A
  73. autistic server: don't wait for an SMTP greeting banner
  74. but immediately send a
  75. .L NOOP
  76. command to provoke the server into responding.
  77. .TP
  78. .B -b
  79. ignore
  80. .I busted-mx
  81. when trying MX hosts.
  82. May be repeated.
  83. .TP
  84. .B -d
  85. turn on debugging to standard error.
  86. .TP
  87. .B -f
  88. just filter the converted message to standard
  89. output rather than sending it.
  90. .TP
  91. .B -g
  92. makes
  93. .I gateway
  94. the system to pass the message to if smtp can't
  95. find an address or MX entry for the destination system.
  96. .TP
  97. .B -h
  98. use
  99. .I host
  100. as the local system name;
  101. it may be fully-qualified or not. If not
  102. specified, it will default to the contents of
  103. .BR /dev/sysname .
  104. .TP
  105. .B -i
  106. under
  107. .BR -a ,
  108. authenticate even if we can't start TLS.
  109. .TP
  110. .B -p
  111. ping: just verify that the users named in the
  112. .I rcpt-list
  113. are valid users at
  114. .IR destaddr ;
  115. don't send any mail.
  116. .TP
  117. .B -s
  118. if the server supports the ESMTP extension to use TLS encryption, turn it on for
  119. this session. See RFC3207 for details.
  120. .TP
  121. .B -u
  122. specify a user name to be used in authentication. The default name is
  123. the current login id.
  124. .PD
  125. .PP
  126. Finally if
  127. .I .domain
  128. is given, it is appended to the end of any unqualified system names
  129. in the envelope or header.
  130. .
  131. .PP
  132. .I Smtpd
  133. receives a message using the Simple Mail Transfer Protocol.
  134. Standard input and output are the protocol connection.
  135. SMTP authentication by
  136. .I login
  137. and
  138. .I cram-md5
  139. protocols is supported; authenticated connections are permitted to relay.
  140. .PP
  141. The options are:
  142. .TF -
  143. .PD
  144. .TP
  145. .B -a
  146. requires that all clients authenticate to be able to send mail.
  147. .TP
  148. .B -c
  149. specifies a certificate to use for TLS. Without this
  150. option, the capability to start TLS will not be advertised.
  151. .TP
  152. .B -d
  153. turns on debugging output to standard error.
  154. .TP
  155. .B -D
  156. sleeps for 15 seconds at the start of the SMTP dialogue;
  157. this deters some spammers.
  158. .TP
  159. .B -f
  160. prevents relaying from non-trusted networks.
  161. It also tags messages from non-trusted sites when they deliver mail
  162. from an address in a domain we believe we represent.
  163. .TP
  164. .B -g
  165. turns on grey/white list processing. All mail is rejected (with a
  166. retry code) unless the sender's IP address is on the whitelist,
  167. .BR /mail/grey/whitelist ,
  168. an append only file.
  169. Addresses can be added to the whitelist by the administrator. However,
  170. the usual way for addresses to be added is by
  171. .I smtpd
  172. itself.
  173. Whenever a message is received and the sender's address isn't on the whitelist,
  174. .I smtpd
  175. first looks for the file
  176. .BI /mail\%/grey\%/tmp\%/\| local\% /\| remote\% /\| recipient\fP,
  177. where
  178. .I local
  179. and
  180. .I remote
  181. are IP addresses of the local and remote systems, respectively.
  182. If it exists, the remote address is added to the whitelist. If
  183. not, the file is created and the mail is rejected with a `try again'
  184. code. The expectation is that spammers will not retry and that others will.
  185. .TP
  186. .B -h
  187. specifies the receiving domain. If this flag is not specified, the
  188. receiving domain is inferred from the host name.
  189. .TP
  190. .B -k
  191. causes connections from the host at
  192. the IP address,
  193. .IR evilipaddr ,
  194. to be dropped at program startup. Multiple addresses
  195. can be specified with several
  196. .B -k
  197. options. This option should be used carefully;
  198. it is intended to lessen the effects of denial of
  199. service attacks or broken mailers which continually
  200. connect. The connections are not logged and the
  201. remote system is not notified via the protocol.
  202. .TP
  203. .B -m
  204. set the
  205. .I mailer
  206. to which
  207. .I smtpd
  208. passes a received message.
  209. The default is
  210. .BR /bin/upas/send .
  211. .TP
  212. .B -n
  213. specifies the name of the network directory assigned to the incoming connection.
  214. This is used to determine the peer IP address. If this flag is not
  215. specified, the peer address is determined using standard input.
  216. .TP
  217. .B -p
  218. permits clients to authenticate using protocols which transfer
  219. the password in the clear, e.g.
  220. .I login
  221. protocol. This should only be used if the connection has
  222. previously encrypted using e.g.
  223. .IR tlssrv (8).
  224. .TP
  225. .B -r
  226. turns on forward DNS validation of non-trusted sender address.
  227. .TP
  228. .B -s
  229. causes copies of blocked messages to be saved in a sub-directory of
  230. .BR /mail/queue.dump .
  231. .PP
  232. .I Smtpd
  233. is normally run by a network listener such as
  234. .IR listen (8).
  235. Most of the command line options are more conveniently
  236. specified in the smtpd configuration file stored in
  237. .BR /mail/lib/smtpd.conf .
  238. .SH SOURCE
  239. .TP
  240. .B /sys/src/cmd/upas/smtp
  241. .SH "SEE ALSO"
  242. .IR aliasmail (8),
  243. .IR faces (1),
  244. .IR filter (1),
  245. .IR mail (1),
  246. .IR marshal (1),
  247. .IR mlmgr (1),
  248. .IR nedmail (1),
  249. .IR qer (8),
  250. .IR rewrite (6),
  251. .IR send (8),
  252. .IR tlssrv (8),
  253. .IR upasfs (4)