You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a standalone Python 3.6+ Virtual Vacation setup and diagnostics script
discover and load effective PostfixAdmin configuration through PHP CLI
generate a separate native INI configuration without overwriting the Perl configuration
check runtime dependencies, database connectivity, required tables, and SMTP connectivity
provide an interactive real-message SMTP test
document installation, configuration inheritance, optional least-privilege database access, and the current prototype boundary
Motivation
The existing vacation.pl integration has a simple runtime contract, but diagnosing its Perl dependencies and creating its configuration can require trial and error. This initial Python implementation provides explicit setup and diagnostics while preserving the current PostfixAdmin database and transport assumptions.
Current scope
This is intentionally not a production replacement for vacation.pl yet. It does not process piped messages or send vacation replies, and the documentation explicitly instructs administrators not to install it in master.cf at this stage.
Ruff 0.16.3 with the Python 3.6-compatible core rule selection (E4, E7, E9, F, and I) and Ruff's lowest supported target (py37): passed
live installation flow validated separately on Python 3.9 with PostfixAdmin configuration discovery, MySQL/MariaDB dependency detection, database/table checks, SMTP check, and interactive SMTP test
The unrestricted Ruff rule set was not used because many of its modernization suggestions require Python 3.9 or 3.10 syntax and would violate this script's Python 3.6 compatibility target.
I have thought about having a PHP implementation of the vacation script a few times - given the PHP mailparse extension is quite good, but never had the motivation to do so.
Thanks, David. A PHP CLI implementation could preserve the same Postfix pipe contract and would allow the production version to load PostfixAdmin configuration and reuse project database conventions directly. The main trade-off I see is that mailparse is an additional PECL dependency (and requires mbstring), whereas Python provides MIME parsing in its standard library.
Before continuing beyond the setup, diagnostics, and SMTP test in this draft: would you prefer the eventual production replacement for vacation.pl to be implemented as a PHP CLI service rather than in Python?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Motivation
The existing
vacation.plintegration has a simple runtime contract, but diagnosing its Perl dependencies and creating its configuration can require trial and error. This initial Python implementation provides explicit setup and diagnostics while preserving the current PostfixAdmin database and transport assumptions.Current scope
This is intentionally not a production replacement for
vacation.plyet. It does not process piped messages or send vacation replies, and the documentation explicitly instructs administrators not to install it inmaster.cfat this stage.Validation
python -m py_compile VIRTUAL_VACATION/vacation.py: passedpython -m unittest discover -s VIRTUAL_VACATION/tests -p test_vacation.py -v: 12 tests passedgit diff --check: passedE4,E7,E9,F, andI) and Ruff's lowest supported target (py37): passedThe unrestricted Ruff rule set was not used because many of its modernization suggestions require Python 3.9 or 3.10 syntax and would violate this script's Python 3.6 compatibility target.