status-update-may-2022.html 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <!DOCTYPE html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /><meta name="keywords" content="GNU, Emacs, Libre Software, Hurd, Guile, Guix" /><meta name="description" content="GNUcode.me is a website focusing on libre software projects, especially the GNU project." /><link type="application/atom+xml" rel="alternate" title="GNUcode.me -- Feed" href="/feed.xml" /><a rel="me" href="https://fosstodon.org/@thegnuguy"></a><link type="text/css" href="css/footer.min.css" rel="stylesheet"></link><link type="text/css" href="css/header.min.css" rel="stylesheet"></link><link type="text/css" href="css/main.min.css" rel="stylesheet"></link><title>Status Update May 2022 — GNUcode.me</title></head><body><header><nav><ul><li><a href="index.html">GNUcode.me</a></li><li><a href="services.html">Services</a></li><li><a href="about.html">About</a></li><li><a href="business-ideas.html">Business-ideas</a></li></ul></nav></header><h1>Status Update May 2022</h1><main><section class="basic-section-padding"><article><h3>by Joshua Branson — May 03, 2022</h3><div><p>I have worked more this month on polishing/cleaning up my currect records for
  2. opensmtpd. I am still finding more things to do, but I am satisified with
  3. current code base. It is starting to feel like I have less and less things to do.</p><p>I have also written some preleminary documentation. The OpenBSD folks’ <code>man smtpd.conf</code>’ is a work of art. Seriously go read it. I have shamelessly copied
  4. numerous portions of that documentation to create my own monstrosity.</p><p>Whoever ends up committing my code for OpenBSD’s configuration for guix, will
  5. probably have to revise my rough draft of a document. But at least there is
  6. visible forward movement in the project. Here is that documentation that I was
  7. telling you about:</p><p>Apologies for the weird exported documentation...</p><h1>OpenSMTPD Service documentation</h1><p>OpenSMTPD is an easy-to-use mail transfer agent (MTA). Its configuration file is
  8. throughly documented in man 5 <code>smtpd.conf</code>. OpenSMTPD <strong>listens</strong> for incoming
  9. mail and <strong>matches</strong> the mail to <strong>actions</strong>. The following records represent those
  10. stages: <code>&lt;opensmtpd-listen-on-configuration&gt;</code>,
  11. <code>&lt;opensmtpd-listen-on-socket-configuration&gt;=, =&lt;opensmtpd-match-configuration&gt;</code>,
  12. <code>&lt;opensmtpd-action-local-delivery-configuration&gt;</code>, and
  13. <code>&lt;opensmtpd-action-relay-configuration&gt;</code>.</p><p>Additionally, each <code>&lt;opensmtpd-listen-on-configuration&gt;</code> and
  14. <code>&lt;opensmtpd-listen-on-socket-configuration&gt;</code> may use a list of
  15. <code>&lt;opensmtpd-filter-configuration&gt;</code>, and/or
  16. <code>&lt;opensmtpd-filter-phase-configuration&gt;</code> records to filter email/spam. Also
  17. numerous records’ fieldnames use <code>&lt;opensmtpd-table-configuration&gt;</code> to hold lists
  18. or key value pairs of data.</p><p>A simple example configuration is below:</p><pre><code>(let ((smtp.gnu.org (opensmtpd-pki-configuration
  19. (domain &quot;smtp.gnu.org&quot;)
  20. (cert &quot;file.cert&quot;)
  21. (key &quot;file.key&quot;))))
  22. (service opensmtpd-service-type
  23. (opensmtpd-configuration
  24. (listen-ons (list
  25. (opensmtpd-listen-on-configuration
  26. (pki smtp.gnu.org))
  27. (opensmtpd-listen-on-configuration
  28. (pki smtp.gnu.org)
  29. (secure-connection &quot;smtps&quot;))))
  30. (matches (list
  31. (opensmtpd-match-configuration
  32. (action
  33. (opensmtpd-action-local-delivery-configuration
  34. (name &quot;local-delivery&quot;))))
  35. (opensmtpd-match-configuration
  36. (action
  37. (opensmtpd-action-relay-configuration
  38. (name &quot;relay&quot;)))))))))</code></pre><ul><li><p>Scheme Variable: opensmtpd-service-type</p><p>Service type for the OpenSMTPD (<a href="https://www.opensmtpd.org">https://www.opensmtpd.org</a>) email server. The
  39. value for this service type is a <code>&lt;opensmtpd-configuration&gt;</code> record.</p></li><li><p>Data Type: opensmtpd-configuration</p><p>Data type representing the configuration of OpenSMTPD.</p><ul><li><p><code>package</code> (default: <code>opensmtpd</code>)</p><p>The OpenSMTPD package to use.</p></li><li><p><code>config-file</code> (default: <code>#f</code>)</p><p>File-like object of the OpenSMTPD configuration file to use. By default it
  40. listens on the loopback network interface, and allows for mail from users
  41. and daemons on the local machine, as well as permitting email to remote
  42. servers. Run <code>man smtpd.conf</code> for more information.</p></li><li><p><code>bounce</code> (default: <code>(list &quot;4h&quot;)</code>)</p><p><code>bounce</code> is a list of strings, which send warning messages to the envelope
  43. sender when temporary delivery failures cause a message to remain in the
  44. queue for longer than string &lt;span class=&quot;underline&quot;&gt;delay&lt;/span&gt;. Each string &lt;span class=&quot;underline&quot;&gt;delay&lt;/span&gt; parameter consists
  45. of a string beginning with a positive decimal integer and a unit s, m, h,
  46. or d. At most four delay parameters can be specified.</p></li><li><p><code>listen-ons</code> (default: <code>(list (opensmtpd-listen-on-configuration))</code> )</p><p><code>listen-ons</code> is a list of <code>&lt;opensmtpd-listen-on-configuration&gt;</code> records.
  47. This list details what interfaces and ports OpenSMTPD listens on as well as
  48. other information.</p></li><li><p><code>listen-on-socket</code> (default: <code>(opensmtpd-listen-on-socket-configuration-configuration)</code> )</p><p>Listens for incoming connections on the Unix domain socket.</p></li><li><p><code>includes</code> (default: <code>#f</code>)</p><p><code>includes</code> is a list of string &lt;span class=&quot;underline&quot;&gt;filenames&lt;/span&gt;. Each filename’s contents is
  49. additional configuration that is inserted into the top of the configuration
  50. file.</p></li><li><p><code>matches</code> default:</p><pre><code>(list (opensmtpd-match-configuration
  51. (action (opensmtpd-action-local-delivery-configuration
  52. (name &quot;local&quot;)
  53. (method &quot;mbox&quot;)))
  54. (for (opensmtpd-option-configuration
  55. (option &quot;for local&quot;))))
  56. (opensmtpd-match-configuration
  57. (action (opensmtpd-action-relay-configuration
  58. (name &quot;outbound&quot;)))
  59. (from (opensmtpd-option-configuration
  60. (option &quot;from local&quot;)))
  61. (for (opensmtpd-option-configuration
  62. (option &quot;for any&quot;)))))</code></pre><p><code>matches</code> is a list of <code>&lt;opensmtpd-match-configuration&gt;</code> records, which
  63. matches incoming mail and sends it to a correspending action. The match
  64. records are evaluated sequentially, with the first match winning. If an
  65. incoming mail does not match any match records, then it is rejected.</p></li><li><p><code>mta-max-deferred</code> (default: <code>100</code>)</p><p>When delivery to a given host is suspended due to temporary failures, cache
  66. at most &lt;span class=&quot;underline&quot;&gt;number&lt;/span&gt; envelopes for that host such that they can be delivered as
  67. soon as another delivery succeeds to that host. The default is 100.</p></li><li><p><code>queue</code> (default: <code>#f</code>)</p><p><code>queue</code> expects an <code>&lt;opensmtpd-queue-configuration&gt;</code> record. With it, one may
  68. compress and encrypt queue-ed emails as well as set the default expiration
  69. time for temporarily undeliverable messages.</p></li><li><p><code>smtp</code> (default: <code>#f</code>)</p><p><code>smtp</code> expects an <code>&lt;opensmtpd-smtp-configuration&gt;</code> record, which lets one
  70. specifiy how large email may be along with other settings.</p></li><li><p><code>srs</code> (default: <code>#f</code>)</p><p><code>srs</code> expects an <code>&lt;opensmtpd-srs-configuration&gt;</code> record, which lets one set
  71. up SRS, the Sender Rewritting Scheme.</p></li></ul></li><li><p>Data Type: opensmtpd-listen-on-configuration</p><p>Data type representing the configuration of an
  72. <code>&lt;opensmtpd-listen-on-configuration&gt;</code>. Listen on the fieldname <code>interface</code> for
  73. incoming connections, using the same syntax as for ifconfig(8). The interface
  74. parameter may also be an string interface group, an string IP address, or a
  75. string domain name. Listening can optionally be restricted to a specific
  76. address fieldname <code>family</code>, which can be either “inet4” or “inet6”.</p><ul><li><p><code>interface</code> (default: “lo”)</p><p>The string interface to listen for incoming connections. These interface can
  77. usually be found by the command <code>ip link</code>.</p></li><li><p><code>family</code> (default: <code>#f</code>)</p><p>The string IP family to use. Valid strings are “inet4” or “inet6”.</p></li><li><p><code>auth</code> (default: <code>#f</code>)</p><p>Support SMTPAUTH: clients may only start SMTP transactions after successful
  78. authentication. If <code>auth</code> is <code>#t</code>, then users are authenticated against
  79. their own normal login credentials. Alternatively <code>auth</code> may be an
  80. <code>&lt;opensmtpd-table-configuration&gt;</code> whose users are authenticated against
  81. their passwords.</p></li><li><p><code>auth-optional</code> (default: <code>#f</code>)</p><p>Support SMTPAUTH optionally: clients need not authenticate, but may do so.
  82. This allows the <code>&lt;opensmtpd-listen-on-configuration&gt;</code> to both accept
  83. incoming mail from untrusted senders and permit outgoing mail from
  84. authenticated users (using <code>&lt;opensmtpd-match-configuration&gt;</code> fieldname
  85. <code>auth</code>). It can be used in situations where it is not possible to listen on
  86. a separate port (usually the submission port, 587) for users to
  87. authenticate.</p></li><li><p><code>filters</code> (default: <code>#f</code>)</p><p>A list of one or many <code>&lt;opensmtpd-filter-configuration&gt;</code> or
  88. <code>&lt;opensmtpd-filter-phase-configuration&gt;</code> records. The filters are applied
  89. sequentially. These records listen and filter on connections handled by this
  90. listener.</p></li><li><p><code>hostname</code> (default: <code>#f</code>)</p><p>Use string “hostname” in the greeting banner instead of the default server
  91. name.</p></li><li><p><code>hostnames</code> (default: <code>#f</code>)</p><p>Override the server name for specific addresses. Use a
  92. <code>&lt;opensmtpd-table-configuration&gt;</code> containing a mapping of string IP
  93. addresses to hostnames. If the address on which the connection arrives
  94. appears in the mapping, the associated hostname is used.</p></li><li><p><code>mask-src</code> (default: <code>#f</code>)</p><p>If <code>#t</code>, then omit the from part when prepending “Received” headers.</p></li><li><p><code>disable-dsn</code> (default: <code>#f</code>)</p><p>When <code>#t</code>, then disable the DSN (Delivery Status Notification) extension.</p></li><li><p><code>pki</code> (default: <code>#f</code>)</p><p>For secure connections, use an <code>&lt;opensmtpd-pki-configuration&gt;</code>
  95. to prove a mail server’s identity.</p></li><li><p><code>port</code> (default: <code>#f</code>)</p><p>Listen on the &lt;span class=&quot;underline&quot;&gt;integer&lt;/span&gt; port instead of the default port of 25.</p></li><li><p><code>proxy-v2</code> (default: <code>#f</code>)</p><p>If <code>#t</code>, then support the PROXYv2 protocol, rewriting appropriately source
  96. address received from proxy.</p></li><li><p><code>received-auth</code> (default: <code>#f</code>)</p><p>If <code>#t</code>, then in “Received” headers, report whether the session was
  97. authenticated and by which local user.</p></li><li><p><code>senders</code> (default: <code>#f</code>)</p><p>Look up the authenticated user in the supplied
  98. <code>&lt;opensmtpd-table-configuration&gt;</code> to find the email addresses that user is
  99. allowed to submit mail as.</p></li><li><p><code>secure-connection</code> (default: <code>#f</code>)</p><p>This is a string of one of these options:</p></li></ul></li></ul><blockquote><pre><code> |----------------------+---------------------------------------------|
  100. | &quot;smtps&quot; | Support SMTPS, by default on port 465. |
  101. |----------------------+---------------------------------------------|
  102. | &quot;tls&quot; | Support STARTTLS, by default on port 25. |
  103. |----------------------+---------------------------------------------|
  104. | &quot;tls-require-verify&quot; | Like tls, but force clients to establish |
  105. | | a secure connection before being allowed to |
  106. | | start an SMTP transaction. With the verify |
  107. | | option, clients must also provide a valid |
  108. | | certificate to establish an SMTP session. |
  109. |----------------------+---------------------------------------------|</code></pre></blockquote><pre><code>- `tag` (default: `#f`)
  110. Clients connecting to the listener are tagged with the given string tag.</code></pre><ul><li><p>Data Type: opensmtpd-listen-on-socket-configuration</p><p>Data type representing the configuration of an
  111. <code>&lt;opensmtpd-listen-on-socket-configuration&gt;</code>. Listen for incoming SMTP
  112. connections on the Unix domain socket <code>/var/run/smtpd.sock</code>. This is done by
  113. default, even if the directive is absent.</p><ul><li><p><code>filters</code> (default: <code>#f</code>)</p><p>A list of one or many <code>&lt;opensmtpd-filter-configuration&gt;</code> or
  114. <code>&lt;opensmtpd-filter-phase-configuration&gt;</code> records. These filter incoming
  115. connections handled by this listener.</p></li><li><p><code>mask-src</code> (default: <code>#f</code>)</p><p>If <code>#t</code>, then omit the from part when prepending “Received” headers.</p></li><li><p><code>tag</code> (default: <code>#f</code>)</p><p>Clients connecting to the listener are tagged with the given string tag.</p></li></ul></li><li><p>Data Type: opensmtpd-match-configuration</p><p>This data type represents the configuration of an
  116. <code>&lt;opensmtpd-match-configuration&gt;</code> record.</p><p>If at least one mail envelope matches the options of one match record, receive
  117. the incoming message, put a copy into each matching envelope, and atomically
  118. save the envelopes to the mail spool for later processing by the respective
  119. <code>&lt;opensmtpd-action-configuration&gt;</code> found in fieldname <code>action</code>.</p><ul><li><p><code>action</code> (default: <code>#f</code>)</p><p>If mail matches this match configuration, then do this action. Valid values
  120. include <code>&lt;opensmtpd-action-local-delivery-configuration&gt;</code> or
  121. <code>&lt;opensmtpd-action-relay-configuration&gt;</code>.</p></li><li><p><code>options</code> (default: <code>#f</code>) <code>&lt;opensmtpd-option-configuration&gt;</code>
  122. The fieldname ’option’ is a list of unique
  123. <code>&lt;opensmtpd-option-configuration&gt;</code> records.</p><p>Each <code>&lt;opensmtpd-option-configuration&gt;</code> record’s fieldname ’option’ has some
  124. mutually exclusive options: there can be one “for” and one “from” option.</p><p>The following matching options are supported and can all be negated via (not
  125. #t). The options that support a table (anything surrounded with ’&lt;’ and ’&gt;’
  126. eg: &lt;table&gt;), also support specifying regex via (regex #t).</p><ul><li><p><code>for any</code></p><p>Specify that session may address any destination.</p></li><li><p><code>for local</code></p><p>Specify that session may address any local domain. This is the default,
  127. and may be omitted.</p></li><li><p><code>for domain _domain_ | &lt;domain&gt;</code></p><p>Specify that session may address the string or list table &lt;span class=&quot;underline&quot;&gt;domain&lt;/span&gt;.</p></li><li><p><code>for rcpt-to _recipient_ | &lt;recipient&gt;</code></p><p>Specify that session may address the string or list table &lt;span class=&quot;underline&quot;&gt;recipient&lt;/span&gt;.</p></li><li><p><code>from any</code></p><p>Specify that session may originate from any source.</p></li><li><p><code>from auth</code></p><p>Specify that session may originate from any authenticated user, no matter
  128. the source IP address.</p></li><li><p><code>from auth _user_ | &lt;user&gt;</code></p><p>Specify that session may originate from authenticated &lt;span class=&quot;underline&quot;&gt;user&lt;/span&gt; or user list
  129. user, no matter the source IP address.</p></li><li><p><code>from local</code></p><p>Specify that session may only originate from a local IP address, or from
  130. the local enqueuer. This is the default, and may be omitted.</p></li><li><p><code>from mail-from _sender_ | &lt;sender&gt;</code></p><p>Specify that session may originate from &lt;span class=&quot;underline&quot;&gt;sender&lt;/span&gt; or table &lt;span class=&quot;underline&quot;&gt;sender&lt;/span&gt;, no
  131. matter the source IP address.</p></li><li><p><code>from rdns</code></p><p>Specify that session may only originate from an IP address that resolves
  132. to a reverse DNS.</p></li><li><p><code>from rdns _hostname_ | &lt;hostname&gt;</code></p><p>Specify that session may only originate from an IP address that resolves
  133. to a reverse DNS matching string or list string &lt;span class=&quot;underline&quot;&gt;hostname&lt;/span&gt;.</p></li><li><p><code>from socket</code></p><p>Specify that session may only originate from the local enqueuer.</p></li><li><p><code>from src _address_ | &lt;address&gt;</code></p><p>Specify that session may only originate from string or list table address
  134. which can be a specific &lt;span class=&quot;underline&quot;&gt;address&lt;/span&gt; or a subnet expressed in CIDR-notation.</p></li><li><p><code>auth</code></p><p>Matches transactions which have been authenticated.</p></li><li><p><code>auth _username_ | &lt;username&gt;</code></p><p>Matches transactions which have been authenticated for user or user list
  135. &lt;span class=&quot;underline&quot;&gt;username&lt;/span&gt;.</p></li><li><p><code>helo _helo-name_ | &lt;helo-name&gt;</code></p><p>Specify that session’s HELO / EHLO should match the string or list table
  136. &lt;span class=&quot;underline&quot;&gt;helo-name&lt;/span&gt;.</p></li><li><p><code>mail-from _sender_ | &lt;sender&gt;</code></p><p>Specify that transactions’s MAIL FROM should match the string or list
  137. table &lt;span class=&quot;underline&quot;&gt;sender&lt;/span&gt;.</p></li><li><p><code>rcpt-to _recipient_ | &lt;recipient&gt;</code></p><p>Specify that transaction’s RCPT TO should match the string or list table
  138. &lt;span class=&quot;underline&quot;&gt;recipient&lt;/span&gt;.</p></li><li><p><code>tag tag</code>
  139. Matches transactions tagged with the given &lt;span class=&quot;underline&quot;&gt;tag&lt;/span&gt;.</p></li><li><p><code>tls</code>
  140. Specify that transaction should take place in a TLS channel.</p></li></ul><p>Here is a simple example:</p><pre><code>(opensmtpd-option-configuration
  141. (not #t)
  142. (regex #f)
  143. (option &quot;for domain&quot;)
  144. (data (opensmtpd-table-configuration
  145. (name &quot;domain-table&quot;)
  146. (data (list &quot;gnu.org&quot; &quot;dismail.de&quot;)))))</code></pre><p>The mail must NOT come from the domains <code>gnu.org</code> or <code>dismail.de</code>.</p></li><li><p>Data Type: opensmtpd-option-configuration</p></li></ul></li><li><p>Data Type: opensmtpd-action-local-delivery-configuration</p><p>This data type represents the configuration of an
  147. <code>&lt;opensmtpd-action-local-delivery-configuration&gt;</code> record.</p><ul><li><p><code>name</code> (default: <code>#f</code>)</p><p><code>name</code> is the string name of the relay action.</p></li><li><p><code>method</code> (default: <code>&quot;mbox&quot;</code>)</p><p>The email delivery option. Valid options are:</p><ul><li><p><code>&quot;mbox&quot;</code></p><p>Deliver the message to the user’s mbox with mail.local(8).</p></li><li><p><code>&quot;expand-only&quot;</code></p><p>Only accept the message if a delivery method was specified in an aliases
  148. or &lt;span class=&quot;underline&quot;&gt;.forward file&lt;/span&gt;.</p></li><li><p><code>&quot;forward-only&quot;</code></p><p>Only accept the message if the recipient results in a remote address after
  149. the processing of aliases or forward file.</p></li><li><p><code>&lt;opensmtpd-lmtp-configuration&gt;</code></p><p>Deliver the message to an LMTP server at
  150. <code>&lt;opensmtpd-lmtp-configuration&gt;</code>’s fieldname <code>destination</code>. The location
  151. may be expressed as string host:port or as a UNIX socket. Optionally,
  152. <code>&lt;opensmtpd-lmtp-configuration&gt;</code>’s fieldname <code>rcpt-to</code> might be specified
  153. to use the recipient email address (after expansion) instead of the local
  154. user in the LMTP session as RCPT TO.</p></li><li><p><code>&lt;opensmtpd-maildir-configuration&gt;</code></p><p>Deliver the message to the maildir in
  155. <code>&lt;opensmtpd-maildir-configuration&gt;</code>’s fieldname <code>pathname</code> if specified,
  156. or by default to <code>~/Maildir</code>.</p><p>The pathname may contain format specifiers that are expanded before use
  157. (see the below section about Format Specifiers).</p><p>If <code>&lt;opensmtpd-maildir-configuration&gt;</code>’s record fieldname <code>junk</code> is <code>#t</code>,
  158. then message will be moved to the ‘Junk’ folder if it contains a positive
  159. ‘X-Spam’ header. This folder will be created under fieldname <code>pathname</code> if
  160. it does not yet exist.</p></li><li><p><code>&lt;opensmtpd-mda-configuration&gt;</code></p><p>Delegate the delivery to the <code>&lt;opensmtpd-mda-configuration&gt;</code>’s fieldname
  161. <code>command</code> (type string) that receives the message on its standard input.</p><p>The <code>command</code> may contain format specifiers that are expanded before use
  162. (see Format Specifiers).</p></li></ul></li><li><p><code>alias</code> (default: <code>#f</code>)</p><p>Use the mapping table for aliases expansion. <code>alias</code> is an
  163. <code>&lt;opensmtpd-table-configuration&gt;</code>.</p></li><li><p><code>ttl</code> (default: <code>#f</code>)</p><p><code>ttl</code> is a string specify how long a message may remain in the queue. It’s
  164. format is <code>n{s|m|h|d}</code>. eg: “4m” is four minutes.</p></li><li><p><code>user</code> (default: <code>#f</code> )</p><p><code>user</code> is the string username for performing the delivery, to be looked up
  165. with getpwnam(3).</p><p>This is used for virtual hosting where a single username is in charge of
  166. handling delivery for all virtual users.</p><p>This option is not usable with the mbox delivery method.</p></li><li><p><code>userbase</code> (default: <code>#f</code>)</p><p><code>userbase</code> is an <code>&lt;opensmtpd-table-configuration&gt;</code> record for mapping user
  167. lookups instead of the getpwnam(3) function.</p><p>The fieldnames <code>user</code> and <code>userbase</code> are mutually exclusive.</p></li><li><p><code>virtual</code> (default: <code>#f</code>)</p><p><code>virtual</code> is an <code>&lt;opensmtpd-table-configuration&gt;</code> record is used for virtual
  168. expansion.</p></li></ul></li><li><p>Data Type: opensmtpd-action-relay-configuration</p><p>This data type represents the configuration of an
  169. <code>&lt;opensmtpd-action-relay-configuration&gt;</code> record.</p><ul><li><p><code>name</code> (default: <code>#f</code>)</p><p><code>name</code> is the string name of the relay action.</p></li><li><p><code>backup</code> (default: <code>#f</code>)</p><p>When <code>#t</code>, operate as a backup mail exchanger delivering messages to any
  170. mail exchanger with higher priority.</p></li><li><p><code>backup-mx</code> (default: <code>#f</code>)</p><p>Operate as a backup mail exchanger delivering messages to any mail exchanger
  171. with higher priority than mail exchanger identified as string name.</p></li><li><p><code>helo</code> (default: <code>#f</code>)</p><p>Advertise string heloname as the hostname to other mail exchangers during
  172. the HELO phase.</p></li><li><p><code>helo-src</code> (default: <code>#f</code> )</p><p>Use the mapping <code>&lt;openmstpd-table-configuration&gt;</code> to look up a hostname
  173. matching the source address, to advertise during the HELO phase.</p></li><li><p><code>domain</code> (default: <code>#f</code>)</p><p>Do not perform MX lookups but look up destination domain in an
  174. <code>&lt;opensmtpd-table-configuration&gt;</code> and use matching relay url as relay host.</p></li><li><p><code>host</code> (default: <code>#f</code>)</p><p>Do not perform MX lookups but relay messages to the relay host described by
  175. the string relay-url. The format for relay-url is
  176. <code>[proto://[label@]]host[:port]</code>. The following protocols are available:</p><p>Unless noted, port defaults to 25.</p><p>The label corresponds to an entry in a credentials table, as documented in
  177. <code>table(5)</code>. It is used with the <code>&quot;smtp+tls&quot;</code> and <code>&quot;smtps&quot;</code> protocols for
  178. authentication. Server certificates for those protocols are verified by
  179. default.</p></li><li><p><code>pki</code> (default: <code>#f</code>)</p><p>For secure connections, use the certificate associated with
  180. <code>&lt;opensmtpd-pki-configuration&gt;</code> (declared in a pki directive) to prove the
  181. client’s identity to the remote mail server.</p></li><li><p><code>srs</code> (default: <code>#f</code>)</p><p>If <code>#t</code>, then when relaying a mail resulting from a forward, use the Sender
  182. Rewriting Scheme to rewrite sender address.</p></li><li><p><code>tls</code> (default: <code>#f</code>) boolean or string “no-verify”</p><p>When <code>#t</code>, Require TLS to be used when relaying, using mandatory STARTTLS by
  183. default. When used with a smarthost, the protocol must not be
  184. <code>&quot;smtp+notls://&quot;</code>. When string <code>&quot;no-verify&quot;</code>, then do not require a valid
  185. certificate.</p></li><li><p><code>auth</code> (default: <code>#f</code>) <code>&lt;opensmtpd-table-configuration&gt;</code></p><p>Use the alist <code>&lt;opensmtpd-table-configuration&gt;</code> for connecting to relay-url
  186. using credentials. This option is usable only with fieldname <code>host</code> option.</p></li><li><p><code>mail-from</code> (default: <code>#f</code>) string</p><p>Use the string &lt;span class=&quot;underline&quot;&gt;mailaddress&lt;/span&gt; as MAIL FROM address within the SMTP transaction.</p></li><li><p><code>src</code> (default: <code>#f</code>) string | <code>&lt;opensmtpd-table-configuration&gt;</code></p><p>Use the string or <code>&lt;opensmtpd-table-configuration&gt;</code> sourceaddr for the
  187. source IP address, which is useful on machines with multiple interfaces. If
  188. the list contains more than one address, all of them are used in such a way
  189. that traffic is routed as efficiently as possible.</p></li></ul></li><li><p>Data Type: opensmtpd-filter-configuration</p><p>This data type represents the configuration of an
  190. <code>&lt;opensmtpd-filter-configuration&gt;</code>. This is the filter record one should use
  191. if they want to use an external package to filter email eg: rspamd or
  192. spamassassin.</p><ul><li><p><code>name</code> (default: <code>#f</code>)</p><p>The string name of the filter.</p></li><li><p><code>proc</code> (default: <code>#f</code>)</p><p>The string command or process name. If <code>proc-exec</code> is <code>#t</code>, <code>proc</code> is
  193. treated as a command to execute. Otherwise, it is a process name.</p></li><li><p><code>proc-exec</code> (default: <code>#f</code>)</p></li></ul></li><li><p>Data Type: opensmtpd-filter-phase-configuration</p><p>This data type represents the configuration of an
  194. <code>&lt;opensmtpd-filter-phase-configuration&gt;</code>.</p><p>In a regular workflow, smtpd(8) may accept or reject a message based only on
  195. the content of envelopes. Its decisions are about the handling of the message,
  196. not about the handling of an active session.</p><p>Filtering extends the decision making process by allowing smtpd(8) to stop at
  197. each phase of an SMTP session, check that options are met, then decide if a
  198. session is allowed to move forward.</p><p>With filtering via an <code>&lt;opensmtpd-filter-phase-configuration&gt;</code> record, a
  199. session may be interrupted at any phase before an envelope is complete. A
  200. message may also be rejected after being submitted, regardless of whether the
  201. envelope was accepted or not.</p><ul><li><p><code>name</code> (default: <code>#f</code>)</p><p>The string name of the filter phase.</p></li><li><p><code>phase-name</code> (default: <code>#f</code>)</p><p>The string name of the phase. Valid values are:</p></li></ul></li></ul><pre><code>- `options` (default `#f`)
  202. A list of unique `&lt;opensmtpd-option-configuration&gt;` records.
  203. At each phase, various options, specified by a list of
  204. `&lt;opensmtpd-option-configuration&gt;`, may be checked. The
  205. `&lt;opensmtpd-option-configuration&gt;`&amp;rsquo;s fieldname &amp;rsquo;option&amp;rsquo; values of: &amp;ldquo;fcrdns&amp;rdquo;,
  206. &amp;ldquo;rdns&amp;rdquo;, and &amp;ldquo;src&amp;rdquo; data are available in all phases, but other data must have
  207. been already submitted before they are available. Options with a `&lt;table&gt;`
  208. next to them require the `&lt;opensmtpd-option-configuration&gt;`&amp;rsquo;s fieldname
  209. `data` to be an `&lt;opensmtpd-table-configuration&gt;`. There are the available
  210. options:
  211. These conditions may all be negated by setting
  212. `&lt;opensmtpd-option-configuration&gt;`&amp;rsquo;s fieldname `not` to `#t`.
  213. Any conditions that require a table may indicate that tables include regexs
  214. setting `&lt;opensmtpd-option-configuration&gt;`&amp;rsquo;s fieldname `regex` to `#t`.
  215. - `decision`
  216. A string decision to be taken. Some decisions require an `message` or
  217. `value`. Valid strings are:
  218. Decisions that involve a message require that the message be RFC valid,
  219. meaning that they should either start with a 4xx or 5xx status code.
  220. Descisions can be taken at any phase, though junking can only happen before
  221. a message is committed.
  222. - `message` (default `#f`)
  223. A string message beginning with a 4xx or 5xx status code.
  224. - `value` (default: `#f`)
  225. A number value. `value` and `message` are mutually exclusive.</code></pre><ul><li><p>Data Type: opensmtpd-option-configuration</p><p>This data type represents the configuration of an
  226. <code>&lt;opensmtpd-option-configuration&gt;</code>, which is used by
  227. <code>&lt;opensmtpd-filter-phase-configuration&gt;</code> and <code>&lt;opensmtpd-match-configuration&gt;</code>
  228. to match various options for email.</p><ul><li><p><code>conditition</code> (default <code>#f</code>)</p><p>A string option to be taken. Some options require a string or an
  229. <code>&lt;opensmtpd-table-configuration&gt;</code> via the fieldname data. When the option
  230. record is used inside of an <code>&lt;opensmtpd-filter-phase-configuration&gt;</code>, then
  231. valid strings are:</p><p>At each phase, various options may be matched. The fcrdns, rdns, and src
  232. data are available in all phases, but other data must have been already
  233. submitted before they are available.</p></li></ul></li></ul><pre><code> When `&lt;opensmtpd-option-configuration&gt;` is used inside of an
  234. `&lt;opensmtpd-match-configuration&gt;`, then valid strigs for fieldname `option`
  235. are: &amp;ldquo;for&amp;rdquo;, &amp;ldquo;for any&amp;rdquo;, &amp;ldquo;for local&amp;rdquo;, &amp;ldquo;for domain&amp;rdquo;, &amp;ldquo;for rcpt-to&amp;rdquo;, &amp;ldquo;from any&amp;rdquo;
  236. &amp;ldquo;from auth&amp;rdquo;, &amp;ldquo;from local&amp;rdquo;, &amp;ldquo;from mail-from&amp;rdquo;, &amp;ldquo;from rdns&amp;rdquo;, &amp;ldquo;from socket&amp;rdquo;,
  237. &amp;ldquo;from src&amp;rdquo;, &amp;ldquo;auth&amp;rdquo;, &amp;ldquo;helo&amp;rdquo;, &amp;ldquo;mail-from&amp;rdquo;, &amp;ldquo;rcpt-to&amp;rdquo;, &amp;ldquo;tag&amp;rdquo;, or &amp;ldquo;tls&amp;rdquo;.
  238. - `data` (default `#f`) `&lt;opensmtpd-table-configuration&gt;`
  239. Some options require a table to be present. One would specify that table
  240. here.
  241. - `regex` (default: `#f`) boolean
  242. Any options using a table may indicate that tables hold regex by
  243. prefixing the table name with the keyword regex.
  244. - `not` (default: `#f`) boolean
  245. When `#t`, this option record is negated.</code></pre><ul><li><p>Data Type: opensmtpd-table-configuration</p><p>This data type represents the configuration of an
  246. <code>&lt;opensmtpd-table-configuration&gt;</code>.</p><ul><li><p><code>name</code> (default <code>#f</code>)</p><p><code>name</code> is the name of the <code>&lt;opensmtpd-table-configuration&gt;</code> record.</p></li><li><p><code>data</code> (default: <code>#f</code>)</p><p><code>data</code> expects a list of strings or an alist, which is a list of
  247. cons cells. eg: <code>(data (list (&quot;james&quot; . &quot;password&quot;)))</code> OR
  248. <code>(data (list (&quot;gnu.org&quot; &quot;fsf.org&quot;)))</code>.</p></li></ul></li><li><p>Data Type: opensmtpd-pki-configuration</p><p>This data type represents the configuration of an
  249. <code>&lt;opensmtpd-pki-configuration&gt;</code>.</p><ul><li><p><code>domain</code> (default <code>#f</code>)</p><p><code>domain</code> is the string name of the <code>&lt;opensmtpd-pki-configuration&gt;</code> record.</p></li><li><p><code>cert</code> (default: <code>#f</code>)</p><p><code>cert</code> (default: <code>#f</code>)</p><p><code>cert</code> is the string certificate filename to use for this pki.</p></li><li><p><code>key</code> (default: <code>#f</code>)</p><p><code>key</code> is the string certificate falename to use for this pki.</p></li><li><p><code>dhe</code> (default: <code>&quot;none&quot;</code>)</p><p>Specify the DHE string parameter to use for DHE cipher suites with host
  250. pkiname. Valid parameter values are “none”, “legacy”, or “auto”. For “legacy”, a
  251. fixed key length of 1024 bits is used, whereas for “auto”, the key length is
  252. determined automatically. The default is “none”, which disables DHE cipher
  253. suites.</p></li></ul></li><li><p>Data Type: opensmtpd-maildir-configuration</p><ul><li><p><code>pathname</code> (default: <code>&quot;~/Maildir&quot;</code>)</p><p>Deliver the message to the maildir if pathname if specified, or by default
  254. to <code>~/Maildir</code>.</p><p>The pathname may contain format specifiers that are expanded before use
  255. (see FORMAT SPECIFIERS).</p></li><li><p><code>junk</code> (default: <code>#f</code>)</p><p>If the junk argument is <code>#t</code>, then the message will be moved to the <code>‘Junk’</code>
  256. folder if it contains a positive <code>‘X-Spam’</code> header. This folder will be
  257. created under pathname if it does not yet exist.</p></li></ul></li><li><p>Data Type: opensmtpd-mda-configuration</p><ul><li><p><code>name</code></p><p>The string name for this MDA command.</p></li><li><p><code>command</code></p><p>Delegate the delivery to a command that receives the message on its standard
  258. input.</p><p>The command may contain format specifiers that are expanded before use (see
  259. FORMAT SPECIFIERS).</p></li></ul></li><li><p>Data Type: opensmtpd-queue-configuration</p><ul><li><p><code>compression</code> (default <code>#f</code>)</p><p>Store queue files in a compressed format. This may be useful to save disk
  260. space.</p></li><li><p><code>encryption</code> (default <code>#f</code>)</p><p>Encrypt queue files with EVP&lt;sub&gt;aes&lt;/sub&gt;&lt;sub&gt;256&lt;/sub&gt;&lt;sub&gt;gcm&lt;/sub&gt;(3). If no key is specified, it is
  261. read with getpass(3). If the string stdin or a single dash (‘-’) is given
  262. instead of a key, the key is read from the standard input.</p></li><li><p><code>ttl-delay</code> (default <code>#f</code>)</p><p>Set the default expiration time for temporarily undeliverable messages,
  263. given as a positive decimal integer followed by a unit s, m, h, or d. The
  264. default is four days (“4d”).</p></li></ul></li><li><p>Data Type: opensmtpd-smtp-configuration</p><p>Data type representing an <code>&lt;opensmtpd-smtp-configuration&gt;</code> record.</p><ul><li><p><code>ciphers</code> (default: <code>#f</code>)</p><p>Set the control string for SSL&lt;sub&gt;CTX&lt;/sub&gt;&lt;sub&gt;set&lt;/sub&gt;&lt;sub&gt;cipher&lt;/sub&gt;&lt;sub&gt;list&lt;/sub&gt;(3). The default is
  265. “HIGH:!aNULL:!MD5”.</p></li><li><p><code>limit-max-mails</code> (default: <code>100</code>)</p><p>Limit the number of messages to count for each sessio</p></li><li><p><code>limit-max-rcpt</code> (default: <code>1000</code>)</p><p>Limit the number of recipients to count for each transaction.</p></li><li><p><code>max-message-size</code> (default: <code>35M</code>)</p><p>Reject messages larger than size, given as a positive number of bytes or as
  266. a string to be parsed with scan&lt;sub&gt;scaled&lt;/sub&gt;(3).</p></li><li><p><code>sub-addr-delim character</code> (default: <code>+</code>)</p><p>When resolving the local part of a local email address, ignore the ASCII
  267. character and all characters following it. This is helpful for email
  268. filters. <code>&quot;admin+bills@gnu.org&quot;</code> is the same email address as
  269. <code>&quot;admin@gnu.org&quot;</code>. BUT an email filter can filter emails addressed to first
  270. email address into a ’Bills’ email folder.</p></li></ul></li><li><p>Data Type: opensmtpd-srs-configuration</p><ul><li><p><code>key</code> (default: <code>#f</code>)</p><p>Set the secret key to use for SRS, the Sender Rewriting Scheme.</p></li><li><p><code>backup-key</code> (default: <code>#f</code>)</p><p>Set a backup secret key to use as a fallback for SRS. This can be used to
  271. implement SRS key rotation.</p></li><li><p><code>ttl-delay</code> (default: <code>&quot;4d&quot;</code>)</p><p>Set the time-to-live delay for SRS envelopes. After this delay, a bounce
  272. reply to the SRS address will be discarded to limit risks of forged
  273. addresses.</p></li></ul></li><li><p>Format Specifiers</p><p>Some configuration records support expansion of their parameters at
  274. runtime. Such records (for example
  275. <code>&lt;opensmtpd-maildir-configuration&gt;</code>, <code>&lt;opensmtpd-mda-configuration&gt;</code>) may use
  276. format specifiers which are expanded before delivery or relaying. The
  277. following formats are currently supported:</p></li></ul><pre><code>Expansion formats also support partial expansion using the optional bracket notations
  278. with substring offset. For example, with recipient domain `“example.org”`:
  279. In addition, modifiers may be applied to the token. For example, with recipient
  280. `“User+Tag@Example.org”`:</code></pre></div></article></section></main><footer><p>© 2020 Joshua Branson. The text on this site is free culture under the Creative Commons Attribution Share-Alike 4.0 International license.</p><p>This website is build with Haunt, a static site generator written in Guile Scheme. Source code is <a href="https://notabug.org/jbranso/gnucode.me">available.</a></p><p>The color theme of this website is based off of the famous <a href="#3f3f3f" target="_blank">zenburn</a> theme.</p></footer></body>