Skip to content

scripts: make policyd-spf configurable#3246

Merged
georglauterbach merged 2 commits intomasterfrom
spf-configurable
Apr 11, 2023
Merged

scripts: make policyd-spf configurable#3246
georglauterbach merged 2 commits intomasterfrom
spf-configurable

Conversation

@georglauterbach
Copy link
Copy Markdown
Member

Description

Users of Rspamd do not need policyd-spf, hence it should be configurable. With v13.0.0, the default should change to 0 because ENABLE_RSPAMD will default to 1.

Fixes #

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@georglauterbach georglauterbach added kind/new feature A new feature is requested in this issue or implemeted with this PR area/features service/security/dkim-dmarc-spf labels Apr 10, 2023
@georglauterbach georglauterbach added this to the v12.1.0 milestone Apr 10, 2023
@georglauterbach georglauterbach self-assigned this Apr 10, 2023
@github-actions
Copy link
Copy Markdown
Contributor

Documentation preview for this PR is ready! 🎉

Built with commit: f607f95

@polarathene
Copy link
Copy Markdown
Member

With v13.0.0, the default should change to 0 because ENABLE_RSPAMD will default to 1.

If you are defaulting to Rspamd that soon, please get it into a state that it's more standardized for configuration like we support with other features already.

Last I saw the docs were being very vague on local storage and saying to mount content directly into /etc instead of leveraging our common /tmp/docker-mailserver config volume and copying from there like other features do (and which supports the change-detection service to automatically update / reload services from config changes).

There is still advice about manual config management (and placement, including no strict file name, such as dkim signing module). Along with a DSL of sorts config file you've designed, which I've not looked too much into.

I get the impression of the support being rushed / pushed a bit eagerly, with potential for burdening yourself with more maintenance as rspamd is largely your area of the project.

Copy link
Copy Markdown
Member

@polarathene polarathene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the env/docs to communicate rspamd relevance, but will approve on the basis it'll no longer be relevant 6 months later.


##### ENABLE_POLICYD_SPF

Enabled `policyd-spf` in Postfix's configuration. You will likely want to set this to `0` in case you're using Rspamd ([`ENABLE_RSPAMD=1`](#enable_rspamd)).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the rspamd context necessary?

Shouldn't this detection just be handled within the scripts as a conflict like we usually do? Emit a warning in the logs instead?

Eventually, if it makes no sense to have the alternatives possible to use while Rspamd is active, throw an error on startup, all of which will be temporary with the plan to drop support for our non-rspamd SPF/DKIM/DMARC validators?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point; I will be adding these checks soon. I think the Rspamd context does not hurt at all, and the only relevant setup where this setting really should be used as of now is ENABLE_RSPAMD=1.

Comment on lines +100 to +103
else
_log 'debug' 'Disabling policyd-spf'
sedfile -i -E 's|check_policy_service unix:private/policyd-spf, ||g' /etc/postfix/main.cf
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to include this in the enable logic above?

# From (but only for smtpd_recipient_restrictions):
# https://github.com/docker-mailserver/docker-mailserver/blob/bbe1d2da3117264c484a87c75813b0d3da71161a/target/postfix/main.cf#L51
reject_unauth_destination, reject_unauth_pipelining

# To (sed value inbetween):
reject_unauth_destination, check_policy_service unix:private/policyd-spf, reject_unauth_pipelining

Bit more work to support, I'm not going to block since this snippet will be removed before the end of the year I assume.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually thought the same, but then I think it is easier with my initial way. You're right though: this should be removed by the end of the year :)

@georglauterbach georglauterbach merged commit 9ee33a8 into master Apr 11, 2023
@georglauterbach georglauterbach deleted the spf-configurable branch April 11, 2023 06:52
georglauterbach added a commit that referenced this pull request Apr 14, 2023
Basically #3246 (comment)

Looking at
https://github.com/docker-mailserver/docker-mailserver/actions/runs/4699505235/jobs/8333061595?pr=3261,
we can see that `postconf` is complaining:

```txt
postconf: warning: /etc/postfix/main.cf: unused parameter: policyd-spf_time_limit=3600
```

This PR resolves the matter and puts all the code that integrates
policyd-spf in one place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/features kind/new feature A new feature is requested in this issue or implemeted with this PR service/security/dkim-dmarc-spf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants