Bogdan Popa <bogdan@defn.io>
This module module provides a minimal implementation of RFC 5321 [RFC5321] that can receive e-mail messages.
The example above starts an SMTP server on localhost port 25 that prints all incoming e-mail to standard out. Calling the stop function terminates any connections in flight and stops the server.
See "example/" in the source code repository for an example with STARTTLS support.
value
parameter
hostname:non-empty-string?
procedure
[ #:hosthost#:portport#:limitslim
Successfully-received e-mails are passed to handler. When the handler raises an exception, the server notifies the client that the message has been rejected.
The #:limits arguments can be used to customize various security limits.
If the optional #:tls-encode argument supplies a tls-encode-proc/c value, the server advertises STARTTLS support and clients may opt in to TLS encryption.
procedure
( smtp-limits? v)→boolean?
v:any/cprocedure
#:max-line-lengthmax-line-length#:max-envelope-lengthmax-envelope-length#:session-timeoutsession-timeout])max-envelope-length : exact-nonnegative-integer?
The #:max-connections argument controls the maximum number of concurrent client connections that the server will accept at a time.
The #:max-line-length argument controls the maximum length in bytes of each line received from a client may be. The server will reject lines longer than this amount.
The #:max-envelope-length argument controls the maximum length of incoming e-mails from clients. The total length of an envlope includes the length in bytes of the sender and the recipients list as well as the message data.
The #:session-timeout argument controls the maximum amount of time, in seconds, that a client session may be open for.