summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
AgeCommit message (Collapse)Author
3 daysIn smtpd enable fdpassing on all imsgbufs apart from the one in mproc.cClaudio Jeker
that was specially handled before. On the control socket fdpassing needs to be enabled when a IMSG_CTL_SMTP_SESSION message is received. OK tb@
3 daysRemove the imsgbuf_read_nofd() hack since the imsgbuf APIClaudio Jeker
rquires the caller to enable fdpassing. OK tb@
3 daysUnify error reporting in various control programs.Claudio Jeker
Just use "read error" since the code also uses "write error" for the imsg_flush case. OK tb@
3 daysbgpd and smtpd include their own imsgbuf_read_nofd() implementation.Claudio Jeker
Adjust that one as well apart from that the conversion to the new imsgbuf_read read behaviour is trivial. OK tb@
3 daysUse imsgbuf_queuelen() instead of accessing the w.queue member.Claudio Jeker
OK tb@
3 daysRename imsg_init, imsg_clear, imsg_read, imsg_write and imsg_flush toClaudio Jeker
imsgbuf_init, imsgbuf_clear, imsgbuf_read, imsgbuf_write and imsgbuf_flush. This separates the imsgbuf API from the per-imsg API. OK tb@
3 daysConvert imsg_write() callers to the new simplified return logic.Claudio Jeker
OK tb@
3 daysIntroduce imsg_write() and use it instead of msgbuf_write().Claudio Jeker
imsg_write() is just a thin wrapper around msgbuf_write(). So this is mostly search and replace. OK tb@
3 daysUse imsg_flush() instead of implementing the same by hand.Claudio Jeker
OK tb@
2024-11-05mark up fix; from jesper wallinJason McIntyre
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@