> On 20 Dec 2020, at 07:13, Sebastien Marie <sema...@online.fr> wrote:
>
> On Sat, Dec 19, 2020 at 10:36:32PM +0000, gil...@poolp.org wrote:
>> Hello,
>>
>> Whenever a rule with a local action (mbox, maildir, lmtp or mda) is matched,
>> smtpd will
>> attempt to search for a ~/.forward file in the recipient directory and
>> process it. This
>> may be convenient for some setups but it is an implicit behavior that's not
>> overridable
>> and not always wanted.
>>
>> This diff changes this behavior by requiring the admins to explicitly allow
>> the forward
>> files processing in the actions when desired:
>>
>> action "local_users" maildir forward-file
>>
>>
>> With this diff, if forward-file is not specified, code to request parent
>> process for an
>> fd is bypassed and the expansion layer just pretends parent couldn't find
>> one. This let
>> the code fallback in an already existing code path with the proper behavior
>> and is very
>> uninvasive.
>>
>
> if I could understood the direction (which is fine as it makes the
> daemon less behaviour dependant on a user settings), the default seems
> wrong to me (at least for now, and for OpenBSD base specifically).
>
> Currently, root@ mail delivery is based on /root/.forward file:
> install is writing this file to redirect root@ mail to user (if user
> was created at install-time). It is done this way since 2011 (see
> distrib/miniroot/install.sh rev 1.218). So I assume that all installs
> which were done with a user configured, since 2011, could use it.
Yes, the default would need to be changed as follows:
mini$ diff -uNp smtpd.conf smtpd.conf.new
--- smtpd.conf Mon Dec 14 22:13:04 2020
+++ smtpd.conf.new Sun Dec 20 09:43:22 2020
@@ -11,7 +11,7 @@ listen on socket
#
listen on all hostname debug.poolp.org
-action "local_mail" maildir alias <aliases>
+action "local_mail" maildir alias <aliases> forward-file
action "outbound" relay
# Uncomment the following to accept external mail for domain "example.org"
mini$
> At first step, I would keep the default smtpd.conf with "forward-file"
> option set. It would make smtpd(1) to default to no "forward-file" if
> not set (what your diff do), but set the default to with
> "forward-file" for OpenBSD base.
>
> Admin could remove the option if he/she doesn't use it.
Yes, I agree and I was showing the idea more than suggesting a default
configuration for OpenBSD base.
If the default config had the diff I showed above, which is what you suggest,
then there would be no behaviour change on a default install.
As for existing setups, as I answered to millert@, there could even be a two
release plan so that not having the keyword would not break
forward file but just warn the admin in logs that the keyword is now needed
whenever a .forward file is used. This would push them into
adapting their configuration file before it breaks a year from now. Since
there’s currently no way of not having forward files, then this does
not break setups as not doing anything keeps the old behaviour + warnings.