author | Alberto Bertogli
<albertito@blitiri.com.ar> 2022-09-02 10:11:40 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2022-09-02 10:11:40 UTC |
parent | 7e38a877e89dce53cc6b17875ac7ec16c5c2fda9 |
internal/aliases/aliases.go | +11 | -15 |
internal/auth/auth.go | +2 | -1 |
internal/courier/mda.go | +2 | -2 |
internal/smtp/smtp.go | +7 | -8 |
internal/sts/sts.go | +0 | -1 |
internal/userdb/userdb.go | +3 | -7 |
test/util/minidns/minidns.go | +3 | -4 |
diff --git a/internal/aliases/aliases.go b/internal/aliases/aliases.go index 4e62e50..f83dea2 100644 --- a/internal/aliases/aliases.go +++ b/internal/aliases/aliases.go @@ -3,16 +3,15 @@ // The resolver can parse many files for different domains, and perform // lookups to resolve the aliases. // -// -// File format +// # File format // // It generally follows the traditional aliases format used by sendmail and // exim. // // The file can contain lines of the form: // -// user: address, address -// user: | command +// user: address, address +// user: | command // // Lines starting with "#" are ignored, as well as empty lines. // User names cannot contain spaces, ":" or commas, for parsing reasons. This @@ -27,18 +26,16 @@ // If the user is the string "*", then it is considered a "catch-all alias": // emails that don't match any known users or other aliases will be sent here. // -// -// Recipients +// # Recipients // // Recipients can be of different types: -// - Email: the usual user@domain we all know and love, this is the default. -// - Pipe: if the right side starts with "| ", the rest of the line specifies -// a command to pipe the email through. -// Command and arguments are space separated. No quoting, escaping, or -// replacements of any kind. +// - Email: the usual user@domain we all know and love, this is the default. +// - Pipe: if the right side starts with "| ", the rest of the line specifies +// a command to pipe the email through. +// Command and arguments are space separated. No quoting, escaping, or +// replacements of any kind. // -// -// Lookups +// # Lookups // // The resolver will perform lookups recursively, until it finds all the final // recipients. @@ -46,8 +43,7 @@ // There are recursion limits to avoid alias loops. If the limit is reached, // the entire resolution will fail. // -// -// Suffix removal +// # Suffix removal // // The resolver can also remove suffixes from emails, and drop characters // completely. This can be used to turn "user+blah@domain" into "user@domain", diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 4f02fdf..7668f02 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -162,7 +162,8 @@ func (a *Authenticator) Reload() error { // DecodeResponse decodes a plain auth response. // // It must be a a base64-encoded string of the form: -// <authorization id> NUL <authentication id> NUL <password> +// +// <authorization id> NUL <authentication id> NUL <password> // // https://tools.ietf.org/html/rfc4954#section-4.1. // diff --git a/internal/courier/mda.go b/internal/courier/mda.go index dbf36a9..72d3454 100644 --- a/internal/courier/mda.go +++ b/internal/courier/mda.go @@ -20,8 +20,8 @@ var ( // MDA delivers local mail by executing a local binary, like procmail or // maildrop. It works with any binary that: -// - Receives the email to deliver via stdin. -// - Exits with code EX_TEMPFAIL (75) for transient issues. +// - Receives the email to deliver via stdin. +// - Exits with code EX_TEMPFAIL (75) for transient issues. type MDA struct { Binary string // Path to the binary. Args []string // Arguments to pass. diff --git a/internal/smtp/smtp.go b/internal/smtp/smtp.go index c011f5e..4f77470 100644 --- a/internal/smtp/smtp.go +++ b/internal/smtp/smtp.go @@ -1,9 +1,8 @@ // Package smtp implements the Simple Mail Transfer Protocol as defined in RFC // 5321. It extends net/smtp as follows: // -// - Supports SMTPUTF8, via MailAndRcpt. -// - Adds IsPermanent. -// +// - Supports SMTPUTF8, via MailAndRcpt. +// - Adds IsPermanent. package smtp import ( @@ -87,11 +86,11 @@ func (c *Client) MailAndRcpt(from string, to string) error { // prepareForSMTPUTF8 prepares the address for SMTPUTF8. // It returns: -// - The address to use. It is based on addr, and possibly modified to make -// it not need the extension, if the server does not support it. -// - Whether the address needs the extension or not. -// - An error if the address needs the extension, but the client does not -// support it. +// - The address to use. It is based on addr, and possibly modified to make +// it not need the extension, if the server does not support it. +// - Whether the address needs the extension or not. +// - An error if the address needs the extension, but the client does not +// support it. func (c *Client) prepareForSMTPUTF8(addr string) (string, bool, error) { // ASCII address pass through. if isASCII(addr) { diff --git a/internal/sts/sts.go b/internal/sts/sts.go index afcd0eb..dd2227d 100644 --- a/internal/sts/sts.go +++ b/internal/sts/sts.go @@ -3,7 +3,6 @@ // Note that "report" mode is not supported. // // Reference: https://tools.ietf.org/html/rfc8461 -// package sts import ( diff --git a/internal/userdb/userdb.go b/internal/userdb/userdb.go index ba66eaa..8b07c46 100644 --- a/internal/userdb/userdb.go +++ b/internal/userdb/userdb.go @@ -1,7 +1,6 @@ // Package userdb implements a simple user database. // -// -// Format +// # Format // // The user database is a file containing a list of users and their passwords, // encrypted with some scheme. @@ -13,21 +12,18 @@ // Users must be UTF-8 and NOT contain whitespace; the library will enforce // this. // -// -// Schemes +// # Schemes // // The default scheme is SCRYPT, with hard-coded parameters. The API does not // allow the user to change this, at least for now. // A PLAIN scheme is also supported for debugging purposes. // -// -// Writing +// # Writing // // The functions that write a database file will not preserve ordering, // invalid lines, empty lines, or any formatting. // // It is also not safe for concurrent use from different processes. -// package userdb //go:generate protoc --go_out=. --go_opt=paths=source_relative userdb.proto diff --git a/test/util/minidns/minidns.go b/test/util/minidns/minidns.go index 7fc7911..0a15554 100644 --- a/test/util/minidns/minidns.go +++ b/test/util/minidns/minidns.go @@ -5,18 +5,17 @@ // // It takes an "answers" file which contains lines with the following format: // -// <domain> <type> <value> +// <domain> <type> <value> // // For example: // -// blah A 1.2.3.4 -// blah MX mx1 +// blah A 1.2.3.4 +// blah MX mx1 // // Supported types: A, AAAA, MX, TXT. // // It's only meant to be used for testing, so it's not robust, performant, or // standards compliant. -// package main import (