Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit for Autoconfig #343

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

jackdeguest
Copy link

Added Autodiscovery configuration interface to Postfix Admin version 3.3 (?).
Files added are:

  • AUTOCONFIG folder containing elements to be moved, including sql scripts for the 3 database drivers supported.
  • en.lang, fr.lang, ja.lang updated
  • config.inc.php updated to contain certain preferences pertaining to payload signature
  • functions.inc.php adding 3 new functions: db_begin, db_commit and db_rollback
    An INSTALL.md is added giving instruction including on how to set up Apache Virtual Host and DNS zone. Maybe need to add information for Nginx?
    Autoconfig uses foreign key to work properly.
    This addition has been tested thoroughly by me but some bugs may have slipped my attention.

// This is a per-domain admin, so we use the table domain_admis to cross check which configuration he/she has access
elseif ( authentication_has_role( 'admin' ) ) {
$E_username = escape_string( $user );
$sql = "SELECT DISTINCT ad.config_id FROM $table_domain d LEFT JOIN $table_autoconfig_domains ad ON ad.domain = d.domain WHERE d.active IS TUE AND d.username='$E_username'";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this TUE a typo?

Can you rewrite it so there's no chance of $sql being undefined.
E.g. default $sql to whatever the 'admin' user has ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Yes, this should have been TRUE. This reminds me I have not tested this interface as regular admin. Only as super admin, which is why I did not bump into this issue before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

( and probably 'table domain_admins' in the comment 👍

@DavidGoodwin
Copy link
Member

Thank you kindly for catching and correcting my typos !

Most of them are from running 'composer psalm' and 'composer format' on the code.

I haven't done much yet.

@HLFH
Copy link

HLFH commented Aug 7, 2023

@jackdeguest @DavidGoodwin Any updates about status? I was thinking it was a good idea to try to integrate Autoconfig, Mobileconfig, potentially Autodiscover, and other autodiscovery helper mechanisms into Postfixadmin, so the email user only needs to provide an email address and a password.

@ETE-Design
Copy link

@jackdeguest Would be great with information for Nginx also.

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.

None yet

5 participants