Skip to content

Fix #1027 - Support templating mail#1028

Draft
bwbroersma wants to merge 1 commit intonginx:masterfrom
bwbroersma:gh1028-support-templating-mail
Draft

Fix #1027 - Support templating mail#1028
bwbroersma wants to merge 1 commit intonginx:masterfrom
bwbroersma:gh1028-support-templating-mail

Conversation

@bwbroersma
Copy link

I have hereby read the F5 CLA and agree to its terms.

Proposed changes

Checklist

  • I have read the contributing guidelines
  • I have signed the F5 Contributor License Agreement (CLA)
  • I have run ./update.sh and ensured all entrypoint/Dockerfile template changes have been applied to the relevant image entrypoint scripts & Dockerfiles
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md and/or modules/README.md)

@bwbroersma bwbroersma requested a review from a team as a code owner February 27, 2026 10:47
@github-actions
Copy link

github-actions bot commented Feb 27, 2026

✅ All required contributors have signed the F5 CLA for this PR. Thank you!
Posted by the CLA Assistant Lite bot.

@bwbroersma
Copy link
Author

I have hereby read the F5 CLA and agree to its terms

@bwbroersma bwbroersma force-pushed the gh1028-support-templating-mail branch from 43bd71b to b1ee25a Compare February 27, 2026 11:45
Added functions to keep it DRY
@bwbroersma bwbroersma force-pushed the gh1028-support-templating-mail branch from b1ee25a to 238c0ab Compare February 27, 2026 11:51
@bwbroersma bwbroersma marked this pull request as draft February 27, 2026 11:52
@thresheek
Copy link
Member

Thank you for your contribution! It does make sense to have it templated.

I've started work to add stream templates to the tests to make sure those work as intended: https://github.com/thresheek/docker-nginx/commits/tests-templates/

It would make sense to test the mail template functionality as well.

CI issues seem to be unrelated, opened #1029 to fix those.

@bwbroersma
Copy link
Author

@thresheek Hey, sorry for sending this PR a bit early, I did some work on it in October last year, and lost track of progress. Since this is a dependency for another PR and forgetting it wasn't finished I created this pull request, later realized it was still missing tests (and some renaming variables were not yet committed, and almost got lost in the rebase).

A simple test would be:

# smtp.conf.mail-template
server_name server-name;
auth_http http://127.0.0.1:9000/;
server {
    listen 25;
    protocol smtp;
}

Optional auth handler:

# smtp_auth_http.conf.template
server {
    listen 127.0.0.1:9000;
    location / {
        default_type text/plain;
        add_header Auth-Status "Login not supported since this is a dummy nginx smtp handler";
        add_header Auth-Error-Code "550 5.3.5";
        return 200;
    }
}

A test could be:

$ echo "QUIT\r\n" | nc 127.0.0.1 25

which should results in:

220 server-name ESMTP ready
221 2.0.0 Bye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support templating mail

2 participants