postfixadmin
postfixadmin copied to clipboard
smtp_sendmail_tls not existing in current config file
Haven't had a need to use postfixadmin in some time. Maybe since 2019 ish? Just haven't added mailboxes or anything since then. But I've had it running and installed. Had need to do some stuff in it today, and got 500's at every turn for config options NULL when expected string.
I'm using the repo version of stable on Debian, 3.3.13-1. For reference.
Google led me to all the issue threads. And I know you have a fix in a future release. I get what's happening. My config file is from an old version cira 2019 ish, and new versions use config options that didn't exist then. Causing fatal PHP errors that make the app unusable.
I even went so far as to bring up the current config.inc.php in github, and make much of my old config file match the new file. Aside from things I had set myself of course.
However, ran into the error on smtp_sendmail_tls not existing. That's a value that was not in my config file from whatever version Debian had in 2019, and is also not in the CURRENT config files on github.
Maybe it was a config not used in 2019, used in 3.3.13, then dropped in a later version?
Mainly dropping this here in case anyone else runs into it.
Error in log: Config::read(): attempt to read undefined config option "smtp_sendmail_tls", returning null
Fix is adding this to the config file:
$CONF['smtp_sendmail_tls'] = false;
Of interest, I also had to add about 8 values in other places that were missing.
@postfixadmin An idea (though it's a pain in the a$$ to implement) that I've done in my own apps, is to version the config files. Normally, I just have the version # of the app in the config file, and check if the config file version matches the current running version. If it does not, I read all the values the user has set into memory, and recreate a new config file in my current version's format. That way new values I've added are in the file, along with all the user's custom settings.
In fact, I don't ship a config file at all. The first run dynamically creates it based on the users initial input at install time. (First run).
My newest process actually dropped config files, and I use the database. Since this is a web based PHP app, that is an option as well. Only have maybe the DB connection settings/admin password in the config file. Everything else is set on a PHP page interface?
Just thoughts....