| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Additional prefix is pretty useless, and I wanted to do this for a long time now.
These are not templates, but files that are "simply" used with nc.
The wrapper is made so custon options can be applied with flags, and common arguments are defaults. The actual invocation is easy to read but requires the e-mail files to be adjusted. This will happen in a latter commit.
Basically remove the `-templates` suffix (because, again, they are not templates) and adjust the contents by removing the first parts (like EHLO:, RCPT TO:, MAIL FROM:).
|
Documentation preview for this PR is ready! 🎉 Built with commit: 9e29a54 |
Sorry, something went wrong.
There was a problem hiding this comment.
The final 2 commits where the bulk of changes with diffs exist is yet to be reviewed.
Sorry, something went wrong.
|
While I prefer keeping git blame happy and smaller PRs, I doubt anyone else was going to get around to this :P Thanks for putting in the time and effort! ❤️
👍 NOTE: You'll want to extract out docs/content/config/security/ssl.md from the first commit though (or just append commits and we'll squash it all, since I'm probably one of the very few that extensively uses git blame to care 😂 ). Commit: use swaks now instead of nc
🎉 🚀 Commit: move e-mails and adjust contents slightly
Renames with modifications to those same files in a single commit 😭 For context, the SMTP commands are removed in favor of retaining only the DATA content.
The bulk of our "templates" had a fairly consistent set of values, with most using the following command pattern: HELO mail.external.tld MAIL FROM: user@external.tld RCPT TO: <recipient here> DATA <data content here> . QUIT There is some drift, and this PR also adds some inconsistencies. I'll touch on that separately. Commit: adjust tests to use new functions I haven't got around to reviewing these two properly yet. I'll tackle them in my next review pass. |
Sorry, something went wrong.
The supervisord config was recently updated for Postgrey to log to it's own file. The test was changed accordingly and passed #3724 Doesn't seem like it'd be related to that 🤔 The test-case has a TODO comment questioning if it was testing correctly in the first place:
Presumably this:
Would not result in localhost if sent from a separate container? (like the postscreen.bats tests). I'm note sure why the test fails now though, since all we're doing is using nc to send to Postgrey directly: This is reliant upon: While the test-case after that passes has relatively the same configs: It may be affected by prior test-cases, where your changes aren't producing the same interaction anymore? (you could verify by bringing back the removed test helper method from that file) I'd first tail the log to verify that it's actually getting the content we want to check for. It's probably unlikely, but perhaps the blank line you dropped affects the outcome with nc too? 🤷♂️ |
Sorry, something went wrong.
I tried this, many times, with different configurations, but it never worked, so I used the STDIN approach. Might be worth adding a comment.
This was literally it, oh dear... |
Sorry, something went wrong.
|
We're now seeing this error in postscreen.bats: $ make clean generate-accounts test/postscreen
postscreen.bats
✓ [Postscreen] should fail send when talking out of turn [195]
✗ [Postscreen] should successfully pass postscreen and get postfix greeting message (respecting postscreen_greet_wait time) [6408]
(from function `assert_success' in file test/test_helper/bats-assert/src/assert_success.bash, line 42,
in test file test/tests/parallel/set1/spam_virus/postscreen.bats, line 55)
`assert_success' failed
-- command failed --
status : 24
output (19 lines):
=== Trying 172.17.0.2:25...
=== Connected to 172.17.0.2.
<- 220-mail.example.test ESMTP
<- 220 mail.example.test ESMTP
-> EHLO mail.external.tld
<- 250-mail.example.test
<- 250-PIPELINING
<- 250-SIZE 10240000
<- 250-ETRN
<- 250-ENHANCEDSTATUSCODES
<- 250-8BITMIME
<- 250 CHUNKING
-> MAIL FROM:<user@external.tld>
<- 250 2.1.0 Ok
-> RCPT TO:<user1@localhost.localdomain>
<** 450 4.1.8 <user@external.tld>: Sender address rejected: Domain not found
-> QUIT
<- 221 2.0.0 Bye
=== Connection closed with remote host.
--
2 tests, 1 failure in 11 seconds
make: *** [Makefile:70: test/postscreen] Error 1 |
Sorry, something went wrong.
Interesting that it doesn't seem relevant to other tests that are using similar files missing the blank line.. Could be that your removed line version was lacking the trailing LF (but then editorconfig rule should have caught it).
You've changed the From: data header, but I thought the _send_email() default would override that (user@external.tld, same as the original MAIL FROM: sender address). (EDIT: annnnd it clearly does as the log shows) https://github.com/docker-mailserver/docker-mailserver/pull/3732/files#r1438741770 The test was previously handled this way: # NOTE: Sometimes fails on first attempt (trying too soon?),
# Instead of a `run` + asserting partial, Using repeat + internal grep match:
_repeat_until_success_or_timeout 10 _should_wait_turn_speaking_smtp \
"${CONTAINER2_NAME}" \
"${CONTAINER1_IP}" \
'/tmp/docker-mailserver-test/email-templates/postscreen.txt' \
'220 mail.example.test ESMTP'While now it is: # Send from mail client container (CONTAINER2_NAME) to DMS server container (CONTAINER1_NAME):
CONTAINER_NAME=${CONTAINER2_NAME} _send_email --server "${CONTAINER1_IP}" 'postscreen'
assert_successThe pass condition has changed. Originally we only cared about that first response from DMS as success, now you're expecting the full transaction to be successful. Looks like we were working around the issue 😝
Probably making a DNS lookup, and .tld is not a valid TLD. No worries we can fix that, but it may expect the IP to match the client container IP too after that? (and likewise check for SPF, which we don't support atm until switching test-suite to compose.yaml) This failure condition will be due to the sender restriction, specifically reject_unknown_sender_domain. We recently had an issue related to the reject_unknown_sender_domain restriction (last portion of the quote, although the earlier portion is relevant context, related to the quoted failure snippet above):
This highlights a reason for why I want tests that send mail to ideally be handled from a separate container and MTA (HELO/EHLO) + sender domain to better test in conditions that reflect actual deployment :) a) Without throwing CoreDNS into the mix, I think we could use --add-host 'external.test:1.2.3.4' as another arg for CONTAINER1_NAME, but you'd need the IP in advance 😖 Both are simple to manage with compose.yaml, while a probably requires b (custom network) anyway. You can refer to LDAP or the current OAuth PR for how we approach that. Alternatively, less correct solutions:
|
Sorry, something went wrong.
|
Reviewing the next two commits now (removal of SMTP commands from email "templates" + test adjustments), this'll take me a while. I'll provide a new checklist summary after that, so we can quickly get this review wrapped up and PR merged 🥳 |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry took a bit longer than expected. Not complete but most of it is covered.
No time tonight to summarize unfortunately. Some of the feedback is just contextual notes without any action required in this PR.
Sorry, something went wrong.
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This change is not meant to be permanent, but only to make handling file names uniform for now.
|
I hope I addressed all of your very valuable feedback now. I have opened an issue to track the follow-up changes to this PR (that ought to be easier to come up with, and review - fingers crossed). From 1a65775 onward, review commit by commit; I grouped the changes. I also resolved the conversations that I addressed, and I left the feedback unresolved that can (and will) be resolved only later. |
Sorry, something went wrong.
|
Oh, I thought I fixed everything. The last issue in the test about disabled ClamAV/SA could be resolved by adding --env PERMIT_DOCKER=container to ´CUSTOM_SETUP_ARGUMENTS` (I just tested it). You can directly apply this @polarathene if you think this is fine :) |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks to be in a pretty good state now 👍
Didn't have as much time today, but will return tomorrow. Should be good for @casperklein to weigh in if he wants to review.
Sorry, something went wrong.
|
@casperklein do you want to review as well or is it okay if we merge with @polarathene's review alone? |
Sorry, something went wrong.
|
I can't say when I'll have time for this. So if tests are passing and you both think the changes are fine, go ahead and merge 👍 |
Sorry, something went wrong.
There was a problem hiding this comment.
I'll apply these changes and merge.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Use swaks instead of nc. This PR is a blocker for properly implementing #3727. Review commit by commit.
Fixes #3728
Type of change
Checklist: