smtp 5.1 KB

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