smtp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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
  95. .I smtp
  96. can't find an address nor MX entry for the destination system.
  97. .TP
  98. .B -h
  99. use
  100. .I host
  101. as the local system name;
  102. it may be fully-qualified or not. If not
  103. specified, it will default to the contents of
  104. .BR /dev/sysname .
  105. .TP
  106. .B -i
  107. under
  108. .BR -a ,
  109. authenticate even if we can't start TLS.
  110. .TP
  111. .B -p
  112. ping: just verify that the users named in the
  113. .I rcpt-list
  114. are valid users at
  115. .IR destaddr ;
  116. don't send any mail.
  117. .TP
  118. .B -s
  119. if the server supports the ESMTP extension to use TLS encryption, turn it on for
  120. this session. See RFC3207 for details.
  121. .TP
  122. .B -u
  123. specify a user name to be used in authentication. The default name is
  124. the current login id.
  125. .PD
  126. .PP
  127. Finally if
  128. .I .domain
  129. is given, it is appended to the end of any unqualified system names
  130. in the envelope or header.
  131. .
  132. .PP
  133. .I Smtpd
  134. receives a message using the Simple Mail Transfer Protocol.
  135. Standard input and output are the protocol connection.
  136. SMTP authentication by
  137. .I login
  138. and
  139. .I cram-md5
  140. protocols is supported; authenticated connections are permitted to relay.
  141. .PP
  142. The options are:
  143. .TF -
  144. .PD
  145. .TP
  146. .B -a
  147. requires that all clients authenticate to be able to send mail.
  148. .TP
  149. .B -c
  150. specifies a certificate to use for TLS. Without this
  151. option, the capability to start TLS will not be advertised.
  152. .TP
  153. .B -d
  154. turns on debugging output to standard error.
  155. .TP
  156. .B -D
  157. sleeps for 15 seconds usually at the start of the SMTP dialogue;
  158. this deters some spammers.
  159. Connections from Class A networks frequented by spammers will incur
  160. a longer delay.
  161. .TP
  162. .B -f
  163. prevents relaying from non-trusted networks.
  164. It also tags messages from non-trusted sites when they deliver mail
  165. from an address in a domain we believe we represent.
  166. .TP
  167. .B -g
  168. turns on grey/white list processing. All mail is rejected (with a
  169. retry code) unless the sender's IP address is on the whitelist,
  170. .BR /mail/grey/whitelist ,
  171. an append only file.
  172. Addresses can be added to the whitelist by the administrator. However,
  173. the usual way for addresses to be added is by
  174. .I smtpd
  175. itself.
  176. Whenever a message is received and the sender's address isn't on the whitelist,
  177. .I smtpd
  178. first looks for the file
  179. .BI /mail\%/grey\%/tmp\%/\| local\% /\| remote\% /\| recipient\fP,
  180. where
  181. .I local
  182. and
  183. .I remote
  184. are IP addresses of the local and remote systems, respectively.
  185. If it exists and was created more than a few minutes go,
  186. the remote address is added to the whitelist.
  187. If not, the file is created and the mail is rejected with a `try again' code.
  188. The expectation is that spammers will not retry for more than a few minutes
  189. and that others will.
  190. .TP
  191. .B -h
  192. specifies the receiving domain. If this flag is not specified, the
  193. receiving domain is inferred from the host name.
  194. .TP
  195. .B -k
  196. causes connections from the host at
  197. the IP address,
  198. .IR evilipaddr ,
  199. to be dropped at program startup. Multiple addresses
  200. can be specified with several
  201. .B -k
  202. options. This option should be used carefully;
  203. it is intended to lessen the effects of denial of
  204. service attacks or broken mailers which continually
  205. connect. The connections are not logged and the
  206. remote system is not notified via the protocol.
  207. .TP
  208. .B -m
  209. set the
  210. .I mailer
  211. to which
  212. .I smtpd
  213. passes a received message.
  214. The default is
  215. .BR /bin/upas/send .
  216. .TP
  217. .B -n
  218. specifies the name of the network directory assigned to the incoming connection.
  219. This is used to determine the peer IP address. If this flag is not
  220. specified, the peer address is determined using standard input.
  221. .TP
  222. .B -p
  223. permits clients to authenticate using protocols which transfer
  224. the password in the clear, e.g.
  225. .I login
  226. protocol. This should only be used if the connection has
  227. previously encrypted using e.g.
  228. .IR tlssrv (8).
  229. .TP
  230. .B -r
  231. turns on forward DNS validation of non-trusted sender address.
  232. .TP
  233. .B -s
  234. causes copies of blocked messages to be saved in a sub-directory of
  235. .BR /mail/queue.dump .
  236. .PP
  237. .I Smtpd
  238. is normally run by a network listener such as
  239. .IR listen (8).
  240. Most of the command line options are more conveniently
  241. specified in the smtpd configuration file stored in
  242. .BR /mail/lib/smtpd.conf .
  243. .SH SOURCE
  244. .TP
  245. .B /sys/src/cmd/upas/smtp
  246. .SH "SEE ALSO"
  247. .IR aliasmail (8),
  248. .IR faces (1),
  249. .IR filter (1),
  250. .IR mail (1),
  251. .IR marshal (1),
  252. .IR mlmgr (1),
  253. .IR nedmail (1),
  254. .IR qer (8),
  255. .IR rewrite (6),
  256. .IR send (8),
  257. .IR tlssrv (8),
  258. .IR upasfs (4)