Skip to content

Add initial Python Virtual Vacation diagnostics - #1118

Open
TrapoSAMA wants to merge 3 commits into
postfixadmin:masterfrom
TrapoSAMA:agent/python-virtual-vacation
Open

Add initial Python Virtual Vacation diagnostics#1118
TrapoSAMA wants to merge 3 commits into
postfixadmin:masterfrom
TrapoSAMA:agent/python-virtual-vacation

Conversation

@TrapoSAMA

@TrapoSAMA TrapoSAMA commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 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.

Validation

  • Python 3.6 grammar parse: passed
  • python -m py_compile VIRTUAL_VACATION/vacation.py: passed
  • python -m unittest discover -s VIRTUAL_VACATION/tests -p test_vacation.py -v: 12 tests passed
  • git diff --check: passed
  • 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.

@TrapoSAMA
TrapoSAMA marked this pull request as ready for review August 14, 2026 11:36
@DavidGoodwin

Copy link
Copy Markdown
Member

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.

@TrapoSAMA

Copy link
Copy Markdown
Contributor Author

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?

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.

2 participants