summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
2024-09-05note that "|" and ":include:" are disallowed for root;Jason McIntyre
prompted by mail from illya meyer ok gilles
2024-09-05remove note falsely claiming that :include: is disallowedJason McIntyre
(it is, but only for root, which i'll address in separate commit); ok mp gilles
2024-09-03fix some typos; courtesy of codespell; ok gilles@Omar Polo
2024-09-03bump versionGilles Chehade
2024-08-12implement the report response for proc-filters tooOmar Polo
Reported by renegm on GitHub: <https://github.com/OpenSMTPD/OpenSMTPD/issues/1257> ok gilles@
2024-07-26- document "ca" in the action ... relay sectionJason McIntyre
from philipp plus openbsd at bureaucracy de - within the "ca" section, refer to "listen on" and "action ... relay", which is the actual syntax ok op
2024-06-11smtpd: fix indentTheo Buehler
ok op
2024-06-09introduce a new K_AUTH service to allow offloading the credentials to aGilles Chehade
table for non-crypt(3) authentication. tables configured with auth that support K_AUTH are asked to check if a user and passwd are valid rather than asked to provide the password for a user so smtpd does crypt(3) on its side. helps with cases like ldap or custom auth. ok op@
2024-06-02remove prototypes with no matching functionJonathan Gray
leave prototypes with functions in OpenSMTPD-extras ok op@
2024-05-28actually honour the services supported by the proc tablesOmar Polo
ok gilles@
2024-05-23require an error message on table_proc failure repliesOmar Polo
The error message is not really used, it just gets translated to a TEMPFAIL, but it allows to have mandatory logging of errors instead of relying on tables to hopefully log something. To ease the transition, don't make it mandatory in smtpd(8) yet, but document it as such. ok millert@, gilles@
2024-05-23catch EOFs during table_proc handshakeOmar Polo
while here also do a s/fatalx/fatal since getline() sets errno on failure. ok millert@, gilles@
2024-05-22align table_proc id printing with the rest of smtpdOmar Polo
ok gilles@
2024-05-22improve the documentation for fetch requestOmar Polo
point out that it is supposed to wrap around and fix the misleading example, then highlight that not-found can only be returned by empty tables. ok gilles@
2024-05-14oops, fix previous. wrong patch committed. was lacking the final \nOmar Polo
2024-05-14include the filter protocol version in the handshakeOmar Polo
This adds "config|protocol|0.7" during the filters handshake, like was done for the tables too, so that the filters can know the version of the protocol right from the start. ok gilles@
2024-05-14sync smtpd and protocol version in smtpd-filters(7) examples; ok gilles@Omar Polo
2024-05-14remove no-op methods from table_getpwnam; ok gilles@Omar Polo
2024-05-14use C99 syntax for filling the table_backend structs; ok gilles@Omar Polo
2024-05-13fix some leaks; ok op@Jonathan Gray
2024-05-07add smtpd-tables.7 for real; spotted by tb, thanks!Omar Polo
2024-05-07change the smtpd table protocolOmar Polo
Using imsg for the "proc" table (external programs) has proven quite painful in practice since a lot of smtpd internals (structs, enums, etc..) have to be kept in sync with the various tables implementations. Instead, a filter-like protocol for tables decouples the implementations and allows to write and test tables easily. The new text-based transport protocol is documented in the (added) smtpd-tables(7) manpage. The old imsg protocol is no longer supported and existing tables have to be converted. In particular, users of opensmtpd-extras tables will need install the new opensmtpd-table-* packages. With lots of suggestions and improvements from gilles and a tweak from Philipp (philipp+openbsd [at] bureaucracy [dot] de), thanks! ok gilles
2024-05-07install smtpd-tables(7)Omar Polo
2024-05-02unbreak parsing of IPv6 addresses in file-backed table(5)sOmar Polo
The file parser splits the line on the ':' character too for key-value tables, and so mis-parses IPv6 addresses. The "::1 localhost" example in table(5) is actually parsed as key "" and value ":1 localhost". For list tables, the "# @list" marker can be used as a workaround, but for key-valued the parser has to be fixed. There are also some weird edge cases when splitting the lines. Now the parser always splits on the first whitespace or colon, and then strips the spaces. For lines starting with '[' the parser will jump to the matching ']' before attempting to split. So, for example: [::1]:localhost becomes "[::1]" -> "localhost" [::1] example.org becomes "[::1]" -> "example.org" foo: bar becomes "foo" -> "bar" foo::bar becomes "foo" -> ":bar" foo : bar becomes "foo" -> ": bar" etc... This only affects the parser for file table(5)s and makemap(8). Inline tables or "proc" tables are unaffected. ok gilles@
2024-04-24fix error return in fork_proc_backend(); ok gilles@Omar Polo
2024-04-23correct indentation; no functional changeJonathan Gray
ok tb@
2024-03-24permament -> permanentJonathan Gray
2024-03-20fix ORCPT handlingOmar Polo
due to a swapped strlcpy() arguments we don't save the ORCPT argument after validation. There's no buffer overflow since dsn_orcpt is zeroed. Spotted by Tassilo Philipp, thanks! ok millert gilles
2024-03-18improve the MDA documentationOmar Polo
- add a pointer to the section when documenting the `mda' keyword - rename the section to MDA COMMANDS - document also what happens when the MDA doesn't exit with status 0 - add the missing environment variables - sort the variables - minor other tweaks to the text with several improvements from jmc, ok jmc
2024-03-15add some initial documentation regarding MDAsOmar Polo
this adds some initial commentary for how MDAs should behave and in what environment they are executed. diff from Philipp (philipp+openbsd [at] bureaucracy [dot] de) with some tweaks from Richard Toohey and me. ok gilles@
2024-03-15set ORIGINAL_RECIPIENT in the environment of mda scriptsOmar Polo
mostly for compatibility with postfix since some mdas (like public-inbox) make use of it. diff from Philipp (philipp+openbsd [at] bureaucracy [dot] de) ok gilles@
2024-03-02bump version to 7.5.0Omar Polo
2024-02-19no need to be as strict with table formats on various match constraints,Gilles Chehade
this prevents the reuse of T_HASH tables in T_LIST contexts when the key column actually makes sense by itself. diff from Philipp (philipp+openbsd [at] bureaucracy [dot] de)
2024-02-11unify smtpd and makemap table parserOmar Polo
These are supposed to parse the same file format but have subtle difference in the handling of comments, continuation lines and escaping. Converge both to the simpler smtpd parser which doesn't handle continuation lines nor escaping, and support comments only at the start of the line. improvements and ok millert@
2024-02-03missing "s" after apostrophe;Jason McIntyre
2024-02-03leave the command for mbox delivery unsetOmar Polo
The mbox delivery is handled apart from the other delivery methods. Since the mda is already hardcoded in mda_mbox(), there's no need to fill the command string in parse.y. While here also assess that for mbox deliveries the command is unset at delivery time too. based on a diff by gilles ok gilles@, millert@
2024-02-03document that when an alternate delivery user is provided in aOmar Polo
dispatcher, no .forward file except that of the alternate delivery user is processed. ok gilles@, millert@
2024-02-02when an alternate delivery user is provided in a dispatcher, do not processGilles Chehade
any recipient .forward file except that of the alternate delivery user. ok millert@
2024-02-02there's no good reason to allow smtpd to execute custom command set by rootGilles Chehade
in a .forward file so disallow custom commands and file reading, only allow setting forward addresses and users. as root is no longer allowed to run any MDA but mbox, we can be stricter on the setup of the MDA process and refuse to exec anything that's not an mbox dispatcher. tested by op@ who edited a root envelope to simulate an exploit injecting a custom command in a root envelope, smtpd refused to exec. ok millert@ and op@
2024-02-02Run lmtp deliveries as the recipient user, not SMTPD_USER (_smtpd).Todd C. Miller
This is a backout of revision 1.278. Delivery via lmtp is not limited to running mail.lmtp, it may also be modified by a user's .forward file (if any). OK gilles@
2024-01-28allow escaping inside quotesOmar Polo
RFC5322 allows for escapes using \ inside quotes. Otherwise, headers such as From: "\"Doe, John\"" <op> get mangled as "\"Doe@localhost, John\" <op> since \ would be treated as ordinary character and not the escape for the quote. Bug reported by TobiasEgg on the OpenSMTPD-portable github repository. ok millert@
2024-01-20Use imsg_get_fd() to access the fd passed via imsgs.Claudio Jeker
Most of the conversion is simple there is just log_imsg() that can no longer display the fd since imsg_get_fd() can only be called once. OK op@
2024-01-04fix IPv6 addresses table lookupsOmar Polo
Rework parse_sockaddr() to not reach inet_pton() with a brace-wrapped IPv6 address. Issue reported by Kirill Miazine. ok millert@
2024-01-04set_localaddrs(): don't wrap IPv6s address with braces twiceOmar Polo
ss_to_text() already wraps ipv6 addresses in braces, so no need to do it again and no need to do that for IPv4 addresses too. ok millert@
2024-01-03relax ORCPT syntax validationOmar Polo
We expected the ORCPT parameter to be a valid rfc822 address. This is wrong on multiple levels: - any other IANA-registered "addr-type" can be used - the parameter may be encoded and we didn't decode it prior validation - RFC3461 explicitly states that "[..] the address associated with the ORCPT keyword is NOT constrained to conform to the syntax rules for that 'addr-type'". Instead, just validate the xtext and preserve the ORCPT value as-is. Issue originally reported by Tim Kuijsten, Tassilo Philipp and others. ok millert@
2023-12-27sync table(5) with realityOmar Polo
There are two different parser for table(5)s with different edge cases. Adjust the documentation to what the strictier of the two (smtpd internal parser) accepts, even if makemap(8) allows for more. In particular, adjust the description for the comments (that cannot be 'anywhere in the file'), document the special comment @list and mention that splitting is done on the colon character too. ok and many improvements from jmc@
2023-12-23remove trailing whitespacesOmar Polo
2023-12-05reject headers that start with a space or tabOmar Polo
If the first header starts with a space but still contains a colon character, it is added to the body mail effectively appending it to the Received header due to the folding rules. Issue reported by Crystal Kolipe ok millert@, giovanni@
2023-12-03add the `no-dsn' option to `listen on socket' tooOmar Polo
ok millert@
2023-12-03set the socket family too to mirror the LISTEN case; no-op in practiceOmar Polo
since AF_UNSPEC is zero.