Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO]: Sieve - Access original recipient address before alias resolution #3904

Open
polarathene opened this issue Feb 23, 2024 · 1 comment
Labels
area/documentation area/features kind/improvement Improve an existing feature, configuration file or the documentation kind/question Someone asked a question - feel free to answer meta/help wanted The OP requests help from others - chime in! :D service/dovecot service/postfix stale-bot/ignore Indicates that this issue / PR shall not be closed by our stale-checking CI
Milestone

Comments

@polarathene
Copy link
Member

polarathene commented Feb 23, 2024

Description

I touched on this while adding these notes and reference them with more detailed insights shared in this discussion (focused on resolving the recipient for a catch-all alias).

This issue is more for visibility/discovery, but if a proper solution is identified we could probably document that in our sieve docs page, and consider official feature support on the master.cf side at least if the modifications are non-trivial.


For now it is believed that the lmtp service + transport in /etc/postfix/master.cf just needs to add some extra flags, and for /etc/postfix/main.cf to rate limit delivering mail per recipient to Dovecot instead of delegating Dovecot to manage. Doing so would make additional headers Delivered-To + X-Original-To available to Sieve:

user-patches.sh:

#!/bin/bash

# Required for the Postfix to send with original recipient headers for Sieve to use:
# Change from default limit of 50 to 1,
# Postfix will send mail with multiple recipients to Dovecot one at a time
# instead of delegating to Dovecot to manage all at once:
postconf lmtp_destination_recipient_limit=1

# Modify the `lmtp` service to use the `lmtp` transport command with extra `flags=DO` arg:
# This will enable both `Delivered-To:` and `X-Original-To` headers for Sieve to have access:
postconf -F 'lmtp/unix/command=lmtp flags=DO'

Current queries:

  • There's potentially a concern with other services like Amavis integration with Postfix possibly interfering with the expected recipient value being resolved before the feature config above would be handled? Requested user tries without anti-spam service enabled to confirm.
  • User in discussion only mentioned trying with X-Original-To, whereas Delivered-To may be what they're after as it's the envelope recipient address which shouldn't be altered AFAIK (even with Amavis involved).
@polarathene polarathene added meta/help wanted The OP requests help from others - chime in! :D kind/question Someone asked a question - feel free to answer service/dovecot service/postfix area/features kind/improvement Improve an existing feature, configuration file or the documentation area/documentation labels Feb 23, 2024
@georglauterbach georglauterbach added this to the v15.0.0 milestone Feb 29, 2024
@github-actions github-actions bot added the meta/stale This issue / PR has become stale and will be closed if there is no further activity label Mar 21, 2024
@docker-mailserver docker-mailserver deleted a comment from github-actions bot Mar 21, 2024
@polarathene polarathene added stale-bot/ignore Indicates that this issue / PR shall not be closed by our stale-checking CI and removed meta/stale This issue / PR has become stale and will be closed if there is no further activity labels Mar 21, 2024
@polarathene
Copy link
Member Author

The linked discussion has had some recent feedback of the advice I provided working well all of a sudden. While another user said they didn't need any of it, but has not responded yet with context requested.

If someone gets around to investigating this, it'd be good to contribute several test cases for those different contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation area/features kind/improvement Improve an existing feature, configuration file or the documentation kind/question Someone asked a question - feel free to answer meta/help wanted The OP requests help from others - chime in! :D service/dovecot service/postfix stale-bot/ignore Indicates that this issue / PR shall not be closed by our stale-checking CI
Projects
None yet
Development

No branches or pull requests

2 participants