[postfix] Obfuscate the IP on smtp-auth server #3297
No reviewers
Labels
No labels
ai-review-please
freeze-break-request
post-freeze
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
infra/ansible!3297
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "zlopez/ansible:12835"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This will update configuration to clean Received header from e-mail
forwarded by smtp-auth-iso01 server to prevent leaking of internal IPs.
See infra/tickets#12835
Signed-off-by: Michal Konecny mkonecny@redhat.com
AI Code Review
📋 MR Summary
This merge request updates the Postfix configuration on smtp-auth servers to strip 'Received' headers to prevent leaking internal IP addresses.
Detailed Code Review
The approach of creating a separate cleanup service (
ascleanup) and binding it to the submission service viacleanup_service_nameis the correct and secure way to strip headers in Postfix without affecting other traffic. However, there is a critical typo in the file names between the actual file on disk, the Ansible copy task, and the Postfixmaster.cfconfiguration. This will break the deployment and potentially the mail service if Postfix fails to reload.📂 File Reviews
📄 `roles/base/tasks/postfix.yml` - Adds an Ansible task to deploy the new Postfix header checks file.
header_checks_submission.smtp-auth(plural 'checks'), but thesrcanddestin the Ansible task useheader_check_submission(singular 'check'). Furthermore,master.cfexpects/etc/postfix/header_checks_submission. This will cause the copy task to fail, or Postfix to fail to start.srcanddestto match the actual filename and the path defined inmaster.cf.✅ Summary
header_checks_submissionin the Ansible task to match the committed file name and the path expected bymaster.cf.postfix-pcrepackage is installed on the target servers, as the configuration specifically requestspcre:/etc/postfix/....🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
661e8244f867953a5eaa67953a5eaa3f1e07dd89AI Code Review
📋 MR Summary
This MR configures the smtp-auth server to obfuscate internal IP addresses by stripping
Received:headers from forwarded emails.Received:headers.master.cfto implement a dedicatedascleanupservice for the submission port using the new header checks.postfix-pcrepackage installation and deployment logic for the new header checks file to the Ansible base role.Detailed Code Review
The implementation correctly applies standard Postfix patterns to strip sensitive submission headers. Creating a dedicated cleanup service (
ascleanup) tied to the submission port ensures that only authenticated submitted messages have theirReceived:headers stripped, rather than interfering with all mail flowing through the standard cleanup service. The Ansible tasks properly gate the file deployment tosmtp-authhosts.📂 File Reviews
📄 `roles/base/tasks/postfix.yml` - Adds the postfix-pcre package and handles the deployment of the header checks file.
postfix-pcrepackage is added to the base package installation list, which will install it on all hosts, whereas the header checks file is only deployed onsmtp-auth*hosts. If you only want this package on the smtp-auth servers, consider moving the package installation to a conditionally executed task.postfix-pcreto a separate task with awhen: inventory_hostname.startswith('smtp-auth')condition, or leave as is if having it on all base nodes is acceptable.✅ Summary
postfix-pcrepackage only tosmtp-authhosts if it is not required system-wide.🤖 AI Code Review | Generated with ai-code-review | Model:
gemini-3.1-pro-preview⚠️ AI-generated suggestions may be incorrect. Verify before applying. Not a replacement for human review.
I think I addressed the major issue on this PR now.